"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
+set(USE_STATIC_CODEC2 TRUE 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.")
--- /dev/null
+apt-get install cmake gcc g++ libportaudio-dev libhamlib-dev libsamplerate-dev libsndfile-dev libsox-dev libgtk-3-dev libasound-dev
--- /dev/null
+apt-get install libportaudio2 libhamlib2 libsamplerate0 libsndfile1 libsox2 libgtk-3-0 libasound2
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>
+(from any prefered, but empty directory outside of the source)
+$ cmake -DBOOTSTRAP_WXWIDGETS=TRUE /path/to/fdmdv2
$ make
(wxWidgets is downloaded and built)
$ cmake .
+++ /dev/null
-diff -Naur libctb-0.16.orig/CMakeLists.txt libctb-0.16/CMakeLists.txt
---- libctb-0.16.orig/CMakeLists.txt 1969-12-31 18:00:00.000000000 -0600
-+++ libctb-0.16/CMakeLists.txt 2013-06-10 14:05:30.328586762 -0500
-@@ -0,0 +1,55 @@
-+cmake_minimum_required(VERSION 2.6)
-+project(libctb)
-+
-+set(LIBCTB_VERSION_MAJOR 0)
-+set(LIBCTB_VERSION_MINOR 16)
-+# Set patch level for bug fix updates which do not affect API/ABI.
-+set(LIBCTB_VERSION_PATCH FALSE)
-+set(LIBCTB_VERSION ${LIBCTB_VERSION_MAJOR}.${LIBCTB_VERSION_MINOR})
-+if(LIBCTB_VERSION_PATCH)
-+ set(LIBCTB_VERSION ${LIBCTB_VERSION}.${LIBCTB_VERSION_PATCH})
-+endif(LIBCTB_VERSION_PATCH)
-+
-+if(NOT CMAKE_BUILD_TYPE)
-+ set(CMAKE_BUILD_TYPE Release)
-+endif(NOT CMAKE_BUILD_TYPE)
-+
-+option(BUILD_SHARED_LIBS
-+ "Build CTB library as a shared library. Turn off for a static library." ON)
-+option(GPIB "Build with GPIB support." OFF)
-+option(SAMPLES "Build sample program." OFF)
-+
-+add_definitions(-D_THREAD_SAFE -DPIC)
-+
-+set(LIBCTB_LINK_LIBS "")
-+
-+if(WIN32)
-+ message(STATUS "Performing Windows based build.")
-+ add_definitions(-mthreads)
-+ find_library(WINMM_LIBRARY winmm)
-+ if(NOT WINMM_LIBRARY)
-+ message(FATAL_ERROR
-+ "The winmm library is required on Windows platforms.")
-+ endif(NOT WINMM_LIBRARY)
-+ list(APPEND LIBCTB_LINK_LIBS ${WINMM_LIBRARY})
-+ #find_library(GPIB_LIBRARY NAMES gpib gpib32 gpib32.lib
-+ # PATHS ${CMAKE_SOURCE_DIR}/lib)
-+ set(GPIB_LIBRARY ${CMAKE_SOURCE_DIR}/lib/gpib32.lib)
-+ message(STATUS "GPIB Library: ${GPIB_LIBRARY}")
-+ list(APPEND LIBCTB_LINK_LIBS ${GPIB_LIBRARY})
-+else(WIN32)
-+ message(STATUS "Performing POSIX based build.")
-+ add_definitions(-fPIC)
-+endif(WIN32)
-+
-+find_package(Threads REQUIRED)
-+message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
-+list(APPEND LIBCTB_LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
-+
-+include_directories(include)
-+add_subdirectory(src)
-+add_subdirectory(include)
-+
-+if(SAMPLES)
-+ add_subdirectory(samples)
-+endif(SAMPLES)
-diff -Naur libctb-0.16.orig/include/CMakeLists.txt libctb-0.16/include/CMakeLists.txt
---- libctb-0.16.orig/include/CMakeLists.txt 1969-12-31 18:00:00.000000000 -0600
-+++ libctb-0.16/include/CMakeLists.txt 2013-05-17 15:23:57.642330757 -0500
-@@ -0,0 +1,30 @@
-+set(INCDIR ctb-${LIBCTB_VERSION_MAJOR}.${LIBCTB_VERSION_MINOR})
-+
-+install(FILES
-+ ${INCDIR}/ctb.h
-+ ${INCDIR}/fifo.h
-+ ${INCDIR}/gpib.h
-+ ${INCDIR}/getopt.h
-+ ${INCDIR}/portscan.h
-+ ${INCDIR}/iobase.h
-+ ${INCDIR}/kbhit.h
-+ ${INCDIR}/serport.h
-+ ${INCDIR}/serportx.h
-+ ${INCDIR}/timer.h
-+ DESTINATION include/${INCDIR}
-+)
-+
-+if(WIN32)
-+ install(FILES
-+ ${INCDIR}/win32/getopt.h
-+ ${INCDIR}/win32/gpib-32.h
-+ ${INCDIR}/win32/serport.h
-+ DESTINATION include/${INCDIR}/win32
-+ )
-+else(WIN32)
-+ install(FILES
-+ ${INCDIR}/linux/serport.h
-+ ${INCDIR}/linux/timer.h
-+ DESTINATION include/${INCDIR}/linux
-+ )
-+endif(WIN32)
-diff -Naur libctb-0.16.orig/include/ctb-0.16/serport.h libctb-0.16/include/ctb-0.16/serport.h
---- libctb-0.16.orig/include/ctb-0.16/serport.h 2010-09-26 08:49:51.000000000 -0500
-+++ libctb-0.16/include/ctb-0.16/serport.h 2013-10-08 14:05:24.901905094 -0500
-@@ -10,9 +10,9 @@
- /////////////////////////////////////////////////////////////////////////////
-
- #if defined (WIN32)
--# include "ctb-0.16/win32/serport.h"
-+# include "win32/serport.h"
- #else
--# include "ctb-0.16/linux/serport.h"
-+# include "linux/serport.h"
- #endif
-
- #endif
-diff -Naur libctb-0.16.orig/include/ctb-0.16/serport.h.inc libctb-0.16/include/ctb-0.16/serport.h.inc
---- libctb-0.16.orig/include/ctb-0.16/serport.h.inc 1969-12-31 18:00:00.000000000 -0600
-+++ libctb-0.16/include/ctb-0.16/serport.h.inc 2010-09-26 08:49:51.000000000 -0500
-@@ -0,0 +1,20 @@
-+#ifndef LIBCTB_SERPORT_H_INCLUDED_
-+#define LIBCTB_SERPORT_H_INCLUDED_
-+
-+/////////////////////////////////////////////////////////////////////////////
-+// Name: serport.h
-+// Purpose: simple wrapper file
-+// Author: Joachim Buermann
-+// Copyright: (c) 2010 Joachim Buermann
-+// Licence: wxWindows licence
-+/////////////////////////////////////////////////////////////////////////////
-+
-+#if defined (WIN32)
-+# include "ctb-0.16/win32/serport.h"
-+#else
-+# include "ctb-0.16/linux/serport.h"
-+#endif
-+
-+#endif
-+// __SERPORT_BASE_H
-+
-diff -Naur libctb-0.16.orig/samples/CMakeLists.txt libctb-0.16/samples/CMakeLists.txt
---- libctb-0.16.orig/samples/CMakeLists.txt 1969-12-31 18:00:00.000000000 -0600
-+++ libctb-0.16/samples/CMakeLists.txt 2013-05-17 11:12:30.449892653 -0500
-@@ -0,0 +1,9 @@
-+if(GPIB)
-+ add_definitions(-DGPIB=1)
-+else(GPIB)
-+ add_definitions(-DGPIB=0)
-+endif(GPIB)
-+
-+add_executable(ctbtest ctbtest.cpp)
-+target_link_libraries(ctbtest libctb ${LIBCTB_LINK_LIBS})
-+install(TARGETS ctbtest DESTINATION bin)
-diff -Naur libctb-0.16.orig/src/CMakeLists.txt libctb-0.16/src/CMakeLists.txt
---- libctb-0.16.orig/src/CMakeLists.txt 1969-12-31 18:00:00.000000000 -0600
-+++ libctb-0.16/src/CMakeLists.txt 2013-05-17 11:12:15.569201549 -0500
-@@ -0,0 +1,37 @@
-+set(LIBCTB_SRCS
-+ fifo.cpp
-+ #kbhit.cpp
-+ serportx.cpp
-+ getopt.cpp
-+ iobase.cpp
-+ portscan.cpp)
-+
-+if(WIN32)
-+ list(APPEND LIBCTB_SRCS
-+ win32/serport.cpp
-+ win32/timer.cpp)
-+else(WIN32)
-+ list(APPEND LIBCTB_SRCS
-+ linux/serport.cpp
-+ linux/timer.cpp)
-+endif(WIN32)
-+
-+if(GPIB)
-+ message(STATUS "GPIB support enabled.")
-+ list(APPEND LIBCTB_SRCS gpib.cpp)
-+else(GPIB)
-+ message(STATUS "GPIB support disabled.")
-+endif(GPIB)
-+
-+add_library(libctb ${LIBCTB_SRCS})
-+target_link_libraries(libctb ${LIBCTB_LINK_LIBS})
-+set_target_properties(libctb
-+ PROPERTIES OUTPUT_NAME ctb-${LIBCTB_VERSION_MAJOR}.${LIBCTB_VERSION_MINOR})
-+
-+# NOTE: cmake may have been updated by now but the ${LIB_SUFFIX} is handy for
-+# multi-lib *nix systems (32bit libraries go in /usr/lib, 64bit in /usr/lib64)
-+install(TARGETS libctb
-+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
-+ LIBRARY DESTINATION lib${LIB_SUFFIX}
-+ RUNTIME DESTINATION bin
-+ )
+++ /dev/null
-# src/Makefile.linux
-# David Rowe 10 Oct 2012
-#
-# Makefile for Linux - builds the less common libraries locally and
-# doesn't install them.
-#
-# $ make -f Makefile.linux
-
-SVN_REVISION=$(shell svnversion)
-
-# The list of required libraries, we will build this as we go
-LIBS_TO_BUILD :=
-
-SYSTEM_HAMLIB=y
-SYSTEM_PORTAUDIO=n
-
-# wxWidgets ---------------------------------------------
-
-ifneq ($(SYSTEM_WXWIDGETS),y)
-WXWIDGETS=wxWidgets-2.9.4
-WX_GTK_PATH=$(WXWIDGETS)/build_gtk
-WX_CONFIG=$(WX_GTK_PATH)/wx-config
-LIBS_TO_BUILD += $(WXWIDGETS)/.built
-else
-WX_CONFIG=$(shell which wx-config)
-endif
-WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags)
-WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
-
-# Portaudio ---------------------------------------------
-
-ifeq ($(SYSTEM_PORTAUDIO),n)
-PORTAUDIO=portaudio
-PORTAUDIO_TARBALL=pa_stable_v19_20111121
-PORTAUDIO_INC=-I$(PORTAUDIO)/include
-PORTAUDIO_LIB=$(PORTAUDIO)/lib/.libs/libportaudio.a
-LIBS_TO_BUILD += $(PORTAUDIO)/.built
-
-# 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
-
-LIBASOUND=$(shell echo "int main(void) {return 0;}" | gcc -xc - -lasound 2>/dev/null ; if [ $$? -eq 0 ] ; then echo "-lasound" ; fi )
-
-else
-PORTAUDIO_INC ?= $(shell pkg-config portaudio-2.0 --cflags)
-PORTAUDIO_LIB ?= $(shell pkg-config portaudio-2.0 --libs)
-
-# libasound will be taken care of by pkg-config
-LIBASOUND=
-endif
-
-# Codec 2 -----------------------------------------------
-
-CODEC2=codec2-dev
-CODEC2_INC=-I$(CODEC2)/src
-CODEC2_LIB=$(CODEC2)/build_dir/src/libcodec2.a
-
-# Sox ---------------------------------------------------
-# (libmagic is rqd or later versions of Ubuntu)
-
-SOX=sox-14.4.0
-ifeq ($(SYSTEM_SOX),y)
-SOX_INC ?= $(shell pkg-config sox --cflags)
-SOX_LIB ?= $(shell pkg-config sox --libs)
-else
-SOX_INC=-I$(SOX)/src/
-SOX_LIB=$(SOX)/src/.libs/libsox.a
-LIBS_TO_BUILD += $(SOX)/.built
-endif
-
-# Hamlib ---------------------------------------------------
-
-HAMLIB=hamlib-1.2.15.3
-ifeq ($(SYSTEM_HAMLIB),y)
-#HAMLIB_INC ?= $(shell pkg-config hamlib --cflags)
-#HAMLIB_LIB ?= $(shell pkg-config hamlib --libs)
-HAMLIB_LIB = -lhamlib
-else
-HAMLIB_INC=-I$(HAMLIB)/include/hamlib
-# TODO: need to include all the backends too
-HAMLIB_LIB=$(HAMLIB)/src/.libs/libhamlib.a
-LIBS_TO_BUILD += $(HAMLIB)/.built
-endif
-
-# CTB ---------------------------------------------------
-
-CTB=libctb-0.16
-CTB_INC=-I$(CTB)/include
-CTB_LIB=$(CTB)/lib/libctb-0.16.a
-LIBS_TO_BUILD += $(CTB)/.built
-
-# FreeDV ------------------------------------------------
-
-CPP_FLAGS = -D_NO_AUTOTOOLS_ $(WX_CPPFLAGS) $(PORTAUDIO_INC) $(CODEC2_INC) \
- $(HAMLIB_INC) $(CTB_INC) $(SOX_INC) -I. -g -Wall -O2 \
- -DSVN_REVISION='"$(SVN_REVISION)"' -MMD -MP
-FREEDV_LIBS = $(WX_LIBS) $(PORTAUDIO_LIB) $(CODEC2_LIB) $(SOX_LIB) $(HAMLIB_LIB) \
- $(CTB_LIB) -lm -lpthread -lsndfile -lsamplerate $(LIBASOUND)
-
-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_filter.o \
-dlg_options.o \
-varicode.o \
-sox_biquad.o \
-codec2-dev/src/golay23.c \
-hamlib.o
-
-all: $(LIBS_TO_BUILD) $(CODEC2)/.built freedv
-
-freedv: $(OBJS)
- $(CXX) -o freedv $(OBJS) $(CPP_FLAGS) $(FREEDV_LIBS)
-
-%.o: %.cpp
- $(CXX) -MMD -MF $(@:.o=.d) $(CPP_FLAGS) -c $< -o $@
-
-%.o: %.c
- $(CC) -MMD -MF $(@:.o=.d) $(CPP_FLAGS) -c $< -o $@
-
--include $(OBJ:.o=.d)
-
-clean:
- rm -f *.d *.o freedv
-
-clean-lib:
- rm -Rf $(WXWIDGETS) $(PORTAUDIO) $(CODEC2) $(SOX) $(CTB)
- rm -f *.d *.o freedv
-
-# wxWidgets ---------------------------------------------------------
-
-ifneq ($(WXWIDGETS),)
-$(WXWIDGETS)/.built: $(WXWIDGETS)
- cd $(WXWIDGETS) && mkdir -p build_gtk && cd build_gtk && ../configure && make && touch ../.built
-
-$(WXWIDGETS): $(WXWIDGETS).tar.bz2
- tar xvjf $(WXWIDGETS).tar.bz2
-
-$(WXWIDGETS).tar.bz2:
- wget http://downloads.sourceforge.net/project/wxwindows/2.9.4/wxWidgets-2.9.4.tar.bz2
-endif
-
-# Portaudio ---------------------------------------------------------
-
-ifneq ($(PORTAUDIO),)
-$(PORTAUDIO)/.built: $(PORTAUDIO)
- cd $(PORTAUDIO) && ./configure --enable-cxx --without-jack && make && touch .built
-
-$(PORTAUDIO): $(PORTAUDIO_TARBALL).tgz
- tar xvzf $(PORTAUDIO_TARBALL).tgz
-
-$(PORTAUDIO_TARBALL).tgz:
- wget http://www.portaudio.com/archives/$(PORTAUDIO_TARBALL).tgz
-endif
-
-# Codec 2 ----------------------------------------------------------
-
-$(CODEC2)/.built: $(CODEC2)
- cd $(CODEC2)/build_dir && cmake ../ && make && touch ../.built
-
-$(CODEC2):
- svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2
-
-# sox -------------------------------------------------------------
-
-$(SOX)/.built: $(SOX)
- cd $(SOX) && \
- ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --disable-dl-sndfile --with-pulseaudio=no --without-magic \
- && make && touch .built
-
-$(SOX) : $(SOX).tar.bz2
- tar xvjf $(SOX).tar.bz2
-
-$(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
-
-# Source file dependency information
--include $(wildcard *.d)
+++ /dev/null
-# src/Makefile.linux
-# David Witten 06 Dec 2012
-#
-#
-# $ make -f Makefile.linux.dmw
-
-
-# EDIT THESE FOR YOUR SYSTEM ----------------------------
-
-WX_GTK_PATH=/home/wittend/Projects/wxWidgets-2.9.4/build_gtk
-CODEC2_PATH=/home/wittend/Projects/codec2
-# SOX_LIB_PATH=$(HOME)/sox-14.4.0/src/.libs - not required because I installed soxlib from the repo.
-
-# END EDITS ---------------------------------------------
-
-WX_CONFIG=$(WX_GTK_PATH)/wx-config
-WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags)
-WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui)
-SVN_REVISION=$(shell svnversion)
-FREEDV_VERSION=$(shell cat ../version.txt)
-CODEC2_INC=-I$(CODEC2_PATH)/src
-CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
-
-CPP_FLAGS = $(WX_CPPFLAGS) $(CODEC2_INC) -I. -g -Wall -O3 -DSVN_REV=\"$(SVN_REVISION)\" -DFREEDV_VERSION="\"$(FREEDV_VERSION)"\"
-LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lpthread -lsndfile -lsamplerate
-
-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
-
-
-all: fdmdv2
-
-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
-
-%.o: %.cpp
- g++ $(CPP_FLAGS) -c $< -o $@
-
-clean:
- rm -f *.o fdmdv2
-
+++ /dev/null
-# 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
-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)/src/.libs/libcodec2.a
-
-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) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate -lhamlib -lsox -lctb-0.16
-
-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 \
-varicode.o \
-sox_biquad.o \
-hamlib.o \
-../../codec2/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/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
-
+++ /dev/null
-# src/Makefile.win32
-# David Witten Nov 31 2012
-#
-#
-# $ make -f Makefile.Win32.dmw
-
-# EDIT THESE FOR YOUR SYSTEM ----------------------------
-
-CODEC2_PATH=D:/Projects/Radio/codec2
-INCLUDE_PATH=d:/bin/MinGW-4.6.1/msys/1.0/local/lib
-
-# not required because I installed soxlib in my:
-# D:\bin\MinGW-4.6.1\msys\1.0\local\lib folder
-# which is the equivalent from the Msys command line to
-# /usr/local/lib under Linux/Unix/BSD type OS's and therefore
-# in the default linker path
-# SOX_LIB_PATH=$(HOME)/sox-14.4.0/src/.libs
-
-# END EDITS ---------------------------------------------
-
-WX_CONFIG=wx-config
-WX_CPPFLAGS = $(shell $(WX_CONFIG) --cxxflags) -D__WXDEBUG__
-WX_LIBS = $(shell $(WX_CONFIG) --libs core, base, aui, adv, net)
-SVN_REVISION=$(shell svnversion -c /fdmdv2)
-CODEC2_INC=$(CODEC2_PATH)/src
-CODEC2_LIB=$(CODEC2_PATH)/src/.libs/libcodec2.a
-
-CPP_FLAGS = -I$(INCLUDE_PATH) $(WX_CPPFLAGS) -I$(CODEC2_INC) -I../extern/include -g -Wall -DSVN_REV=\"$(SVN_REVISION)\" -DFREEDV_VERSION="\"$(FREEDV_VERSION)"\"
-LIBS = $(WX_LIBS) $(CODEC2_LIB) -lm -lportaudiocpp -lportaudio -lpthread -lsndfile -lsamplerate
-
-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
-
-
-HDRS = ../version.h fdmdv2_main.h fdmdv2_defines.h fdmdv2_plot.h fdmdv2_plot_scalar.h fdmdv2_plot_waterfall_linux.h fdmdv2_plot_scatter.h fdmdv2_plot_spectrum.h fdmdv2_pa_wrapper.h topFrame.h dlg_audiooptions.h
-
-all: freedv
-
-freedv: $(OBJS)
- g++ -o freedv $(OBJS) $(CPP_FLAGS) $(LIBS)
-
-%.o: %.cpp $(HDRS) Makefile.win32
- g++ $(CPP_FLAGS) -c $< -o $@
-
-clean:
- rm -f *.o FreeDV.exe
-
+++ /dev/null
-//==========================================================================
-// 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;
- }
-}
-*/
+++ /dev/null
-//==========================================================================
-// 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();
-};