diff options
Diffstat (limited to 'gr-vocoder')
28 files changed, 658 insertions, 43 deletions
diff --git a/gr-vocoder/CMakeLists.txt b/gr-vocoder/CMakeLists.txt new file mode 100644 index 000000000..16ee6bbf0 --- /dev/null +++ b/gr-vocoder/CMakeLists.txt @@ -0,0 +1,109 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup dependencies +######################################################################## +INCLUDE(GrBoost) + +######################################################################## +# Register component +######################################################################## +INCLUDE(GrComponent) +GR_REGISTER_COMPONENT("gr-vocoder" ENABLE_GR_VOCODER + Boost_FOUND + ENABLE_GR_CORE_ +) + +GR_SET_GLOBAL(GR_VOCODER_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/include +) + +######################################################################## +# Begin conditional configuration +######################################################################## +IF(ENABLE_GR_VOCODER) + +######################################################################## +# Setup CPack components +######################################################################## +INCLUDE(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_VOCODER_DESCRIPTION "GNU Radio Vocoder Blocks") + +CPACK_COMPONENT("vocoder_runtime" + GROUP "Vocoder" + DISPLAY_NAME "Runtime" + DESCRIPTION "Dynamic link libraries" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("vocoder_devel" + GROUP "Vocoder" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("vocoder_python" + GROUP "Vocoder" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime" + DEPENDS "core_python;vocoder_runtime" +) + +CPACK_COMPONENT("vocoder_examples" + GROUP "Vocoder" + DISPLAY_NAME "Examples" + DESCRIPTION "Python examples for vocoder" + DEPENDS "vocoder_python" +) + +CPACK_COMPONENT("vocoder_swig" + GROUP "Vocoder" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;vocoder_python;vocoder_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +ADD_SUBDIRECTORY(lib) +ADD_SUBDIRECTORY(include) +IF(ENABLE_PYTHON) + ADD_SUBDIRECTORY(swig) + ADD_SUBDIRECTORY(python) + ADD_SUBDIRECTORY(examples) +ENDIF(ENABLE_PYTHON) + +######################################################################## +# Create Pkg Config File +######################################################################## +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-vocoder.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-vocoder.pc +@ONLY) + +INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-vocoder.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "vocoder_devel" +) + +ENDIF(ENABLE_GR_VOCODER) diff --git a/gr-vocoder/examples/CMakeLists.txt b/gr-vocoder/examples/CMakeLists.txt new file mode 100644 index 000000000..9f8172a75 --- /dev/null +++ b/gr-vocoder/examples/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Install Examples +######################################################################## +INCLUDE(GrPython) + +GR_PYTHON_INSTALL( + PROGRAMS + alaw_audio_loopback.py + codec2_audio_loopback.py + cvsd_audio_loopback.py + g721_audio_loopback.py + g723_24_audio_loopback.py + g723_40_audio_loopback.py + gsm_audio_loopback.py + ulaw_audio_loopback.py + DESTINATION ${GR_PKG_DATA_DIR}/examples/vocoder + COMPONENT "vocoder_examples" +) diff --git a/gr-vocoder/include/CMakeLists.txt b/gr-vocoder/include/CMakeLists.txt new file mode 100644 index 000000000..390a0afb5 --- /dev/null +++ b/gr-vocoder/include/CMakeLists.txt @@ -0,0 +1,43 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Install header files +######################################################################## +INSTALL(FILES + vocoder_api.h + vocoder_alaw_decode_bs.h + vocoder_alaw_encode_sb.h + vocoder_codec2_decode_ps.h + vocoder_codec2_encode_sp.h + vocoder_cvsd_decode_bs.h + vocoder_cvsd_encode_sb.h + vocoder_g721_decode_bs.h + vocoder_g721_encode_sb.h + vocoder_g723_24_decode_bs.h + vocoder_g723_24_encode_sb.h + vocoder_g723_40_decode_bs.h + vocoder_g723_40_encode_sb.h + vocoder_gsm_fr_decode_ps.h + vocoder_gsm_fr_encode_sp.h + vocoder_ulaw_decode_bs.h + vocoder_ulaw_encode_sb.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "vocoder_devel" +) diff --git a/gr-vocoder/include/Makefile.am b/gr-vocoder/include/Makefile.am index aab77e3f9..b579333a3 100644 --- a/gr-vocoder/include/Makefile.am +++ b/gr-vocoder/include/Makefile.am @@ -23,6 +23,7 @@ include $(top_srcdir)/Makefile.common # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = \ + vocoder_api.h \ vocoder_alaw_decode_bs.h \ vocoder_alaw_encode_sb.h \ vocoder_codec2_decode_ps.h \ diff --git a/gr-vocoder/include/vocoder_alaw_decode_bs.h b/gr-vocoder/include/vocoder_alaw_decode_bs.h index b71569439..f20dfefdb 100644 --- a/gr-vocoder/include/vocoder_alaw_decode_bs.h +++ b/gr-vocoder/include/vocoder_alaw_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_ALAW_DECODE_BS_H #define INCLUDED_VOCODER_ALAW_DECODE_BS_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_alaw_decode_bs; typedef boost::shared_ptr<vocoder_alaw_decode_bs> vocoder_alaw_decode_bs_sptr; -vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); +VOCODER_API vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); /*! * \brief This block performs alaw audio decoding. @@ -37,10 +38,10 @@ vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_alaw_decode_bs : public gr_sync_block +class VOCODER_API vocoder_alaw_decode_bs : public gr_sync_block { private: - friend vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); + friend VOCODER_API vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); vocoder_alaw_decode_bs(); diff --git a/gr-vocoder/include/vocoder_alaw_encode_sb.h b/gr-vocoder/include/vocoder_alaw_encode_sb.h index d1858d048..c00080fb7 100644 --- a/gr-vocoder/include/vocoder_alaw_encode_sb.h +++ b/gr-vocoder/include/vocoder_alaw_encode_sb.h @@ -23,23 +23,24 @@ #ifndef INCLUDED_VOCODER_ALAW_ENCODER_SB_H #define INCLUDED_VOCODER_ALAW_ENCODER_SB_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_alaw_encode_sb; typedef boost::shared_ptr<vocoder_alaw_encode_sb> vocoder_alaw_encode_sb_sptr; -vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); +VOCODER_API vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); /*! * \brief This block performs g.711 alaw audio encoding. * * \ingroup vocoder_blk */ -class vocoder_alaw_encode_sb : public gr_sync_block +class VOCODER_API vocoder_alaw_encode_sb : public gr_sync_block { private: - friend vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); + friend VOCODER_API vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); vocoder_alaw_encode_sb(); diff --git a/gr-vocoder/include/vocoder_api.h b/gr-vocoder/include/vocoder_api.h new file mode 100644 index 000000000..331cf5d0b --- /dev/null +++ b/gr-vocoder/include/vocoder_api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_VOCODER_API_H +#define INCLUDED_VOCODER_API_H + +#include <gruel/attributes.h> + +#ifdef gnuradio_vocoder_EXPORTS +# define VOCODER_API __GR_ATTR_EXPORT +#else +# define VOCODER_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_VOCODER_API_H */ diff --git a/gr-vocoder/include/vocoder_codec2_decode_ps.h b/gr-vocoder/include/vocoder_codec2_decode_ps.h index 02b80a454..7e7ea2d5c 100644 --- a/gr-vocoder/include/vocoder_codec2_decode_ps.h +++ b/gr-vocoder/include/vocoder_codec2_decode_ps.h @@ -22,21 +22,22 @@ #ifndef INCLUDED_VOCODER_CODEC2_DECODE_PS_H #define INCLUDED_VOCODER_CODEC2_DECODE_PS_H +#include <vocoder_api.h> #include <gr_sync_interpolator.h> class vocoder_codec2_decode_ps; typedef boost::shared_ptr<vocoder_codec2_decode_ps> vocoder_codec2_decode_ps_sptr; -vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); +VOCODER_API vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); /*! * \brief CODEC2 Vocoder Decoder * \ingroup vocoder_blk */ -class vocoder_codec2_decode_ps : public gr_sync_interpolator { +class VOCODER_API vocoder_codec2_decode_ps : public gr_sync_interpolator { void *d_codec2; - friend vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); + friend VOCODER_API vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); vocoder_codec2_decode_ps (); public: diff --git a/gr-vocoder/include/vocoder_codec2_encode_sp.h b/gr-vocoder/include/vocoder_codec2_encode_sp.h index de4784f8d..8d8588daf 100644 --- a/gr-vocoder/include/vocoder_codec2_encode_sp.h +++ b/gr-vocoder/include/vocoder_codec2_encode_sp.h @@ -22,21 +22,22 @@ #ifndef INCLUDED_VOCODER_CODEC2_ENCODE_SP_H #define INCLUDED_VOCODER_CODEC2_ENCODE_SP_H +#include <vocoder_api.h> #include <gr_sync_decimator.h> class vocoder_codec2_encode_sp; typedef boost::shared_ptr<vocoder_codec2_encode_sp> vocoder_codec2_encode_sp_sptr; -vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); +VOCODER_API vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); /*! * \brief CODEC2 Vocoder Encoder * \ingroup vocoder_blk */ -class vocoder_codec2_encode_sp : public gr_sync_decimator { +class VOCODER_API vocoder_codec2_encode_sp : public gr_sync_decimator { void *d_codec2; - friend vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); + friend VOCODER_API vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); vocoder_codec2_encode_sp (); public: diff --git a/gr-vocoder/include/vocoder_cvsd_decode_bs.h b/gr-vocoder/include/vocoder_cvsd_decode_bs.h index dd588c661..1204e298b 100644 --- a/gr-vocoder/include/vocoder_cvsd_decode_bs.h +++ b/gr-vocoder/include/vocoder_cvsd_decode_bs.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_VOCODER_CVSD_DECODE_BS_H #define INCLUDED_VOCODER_CVSD_DECODE_BS_H +#include <vocoder_api.h> #include <gr_sync_interpolator.h> class vocoder_cvsd_decode_bs; @@ -44,7 +45,7 @@ typedef boost::shared_ptr<vocoder_cvsd_decode_bs> vocoder_cvsd_decode_bs_sptr; * \param neg_accum_max Minimum integer value allowed for the internal reference. Default: "-32767" (-2^15 + 1 or MINSHORT+1) * */ -vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10, +VOCODER_API vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10, short max_step=1280, double step_decay=0.9990234375, double accum_decay= 0.96875, @@ -105,10 +106,10 @@ vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10, * */ -class vocoder_cvsd_decode_bs : public gr_sync_interpolator +class VOCODER_API vocoder_cvsd_decode_bs : public gr_sync_interpolator { private: - friend vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step, + friend VOCODER_API vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step, short max_step, double step_decay, double accum_decay, diff --git a/gr-vocoder/include/vocoder_cvsd_encode_sb.h b/gr-vocoder/include/vocoder_cvsd_encode_sb.h index da09b3927..4a2d31147 100644 --- a/gr-vocoder/include/vocoder_cvsd_encode_sb.h +++ b/gr-vocoder/include/vocoder_cvsd_encode_sb.h @@ -22,6 +22,7 @@ #ifndef INCLUDED_VOCODER_CVSD_ENCODER_SB_H #define INCLUDED_VOCODER_CVSD_ENCODER_SB_H +#include <vocoder_api.h> #include <gr_sync_decimator.h> class vocoder_cvsd_encode_sb; @@ -44,7 +45,7 @@ typedef boost::shared_ptr<vocoder_cvsd_encode_sb> vocoder_cvsd_encode_sb_sptr; * */ -vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10, +VOCODER_API vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10, short max_step=1280, double step_decay=0.9990234375, double accum_decay= 0.96875, @@ -107,10 +108,10 @@ vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10, * */ -class vocoder_cvsd_encode_sb : public gr_sync_decimator +class VOCODER_API vocoder_cvsd_encode_sb : public gr_sync_decimator { private: - friend vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step, + friend VOCODER_API vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step, short max_step, double step_decay, double accum_decay, diff --git a/gr-vocoder/include/vocoder_g721_decode_bs.h b/gr-vocoder/include/vocoder_g721_decode_bs.h index 8ce3b12e5..1ac7b993a 100644 --- a/gr-vocoder/include/vocoder_g721_decode_bs.h +++ b/gr-vocoder/include/vocoder_g721_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_G721_DECODE_BS_H #define INCLUDED_VOCODER_G721_DECODE_BS_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_g721_decode_bs; typedef boost::shared_ptr<vocoder_g721_decode_bs> vocoder_g721_decode_bs_sptr; -vocoder_g721_decode_bs_sptr vocoder_make_g721_decode_bs(); +VOCODER_API vocoder_g721_decode_bs_sptr vocoder_make_g721_decode_bs(); /*! * \brief This block performs g721 audio decoding. @@ -37,7 +38,7 @@ vocoder_g721_decode_bs_sptr vocoder_make_g721_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_g721_decode_bs : virtual public gr_sync_block +class VOCODER_API vocoder_g721_decode_bs : virtual public gr_sync_block { }; diff --git a/gr-vocoder/include/vocoder_g721_encode_sb.h b/gr-vocoder/include/vocoder_g721_encode_sb.h index 5af980640..a154537d0 100644 --- a/gr-vocoder/include/vocoder_g721_encode_sb.h +++ b/gr-vocoder/include/vocoder_g721_encode_sb.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_G721_ENCODE_SB_H #define INCLUDED_VOCODER_G721_ENCODE_SB_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_g721_encode_sb; typedef boost::shared_ptr<vocoder_g721_encode_sb> vocoder_g721_encode_sb_sptr; -vocoder_g721_encode_sb_sptr vocoder_make_g721_encode_sb(); +VOCODER_API vocoder_g721_encode_sb_sptr vocoder_make_g721_encode_sb(); /*! * \brief This block performs g721 audio encoding. @@ -37,7 +38,7 @@ vocoder_g721_encode_sb_sptr vocoder_make_g721_encode_sb(); * \ingroup vocoder_blk */ -class vocoder_g721_encode_sb : virtual public gr_sync_block +class VOCODER_API vocoder_g721_encode_sb : virtual public gr_sync_block { }; diff --git a/gr-vocoder/include/vocoder_g723_24_decode_bs.h b/gr-vocoder/include/vocoder_g723_24_decode_bs.h index 8ca94f253..80cdbddd4 100644 --- a/gr-vocoder/include/vocoder_g723_24_decode_bs.h +++ b/gr-vocoder/include/vocoder_g723_24_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_G723_24_DECODE_BS_H #define INCLUDED_VOCODER_G723_24_DECODE_BS_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_g723_24_decode_bs; typedef boost::shared_ptr<vocoder_g723_24_decode_bs> vocoder_g723_24_decode_bs_sptr; -vocoder_g723_24_decode_bs_sptr vocoder_make_g723_24_decode_bs(); +VOCODER_API vocoder_g723_24_decode_bs_sptr vocoder_make_g723_24_decode_bs(); /*! * \brief This block performs g723_24 audio decoding. @@ -37,7 +38,7 @@ vocoder_g723_24_decode_bs_sptr vocoder_make_g723_24_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_g723_24_decode_bs : virtual public gr_sync_block +class VOCODER_API vocoder_g723_24_decode_bs : virtual public gr_sync_block { }; diff --git a/gr-vocoder/include/vocoder_g723_24_encode_sb.h b/gr-vocoder/include/vocoder_g723_24_encode_sb.h index b55229980..d290e0971 100644 --- a/gr-vocoder/include/vocoder_g723_24_encode_sb.h +++ b/gr-vocoder/include/vocoder_g723_24_encode_sb.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_G723_24_ENCODE_SB_H #define INCLUDED_VOCODER_G723_24_ENCODE_SB_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_g723_24_encode_sb; typedef boost::shared_ptr<vocoder_g723_24_encode_sb> vocoder_g723_24_encode_sb_sptr; -vocoder_g723_24_encode_sb_sptr vocoder_make_g723_24_encode_sb(); +VOCODER_API vocoder_g723_24_encode_sb_sptr vocoder_make_g723_24_encode_sb(); /*! * \brief This block performs g723_24 audio encoding. @@ -37,7 +38,7 @@ vocoder_g723_24_encode_sb_sptr vocoder_make_g723_24_encode_sb(); * \ingroup vocoder_blk */ -class vocoder_g723_24_encode_sb : virtual public gr_sync_block +class VOCODER_API vocoder_g723_24_encode_sb : virtual public gr_sync_block { }; diff --git a/gr-vocoder/include/vocoder_g723_40_decode_bs.h b/gr-vocoder/include/vocoder_g723_40_decode_bs.h index 2299b8806..87a2f6892 100644 --- a/gr-vocoder/include/vocoder_g723_40_decode_bs.h +++ b/gr-vocoder/include/vocoder_g723_40_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_G723_40_DECODE_BS_H #define INCLUDED_VOCODER_G723_40_DECODE_BS_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_g723_40_decode_bs; typedef boost::shared_ptr<vocoder_g723_40_decode_bs> vocoder_g723_40_decode_bs_sptr; -vocoder_g723_40_decode_bs_sptr vocoder_make_g723_40_decode_bs(); +VOCODER_API vocoder_g723_40_decode_bs_sptr vocoder_make_g723_40_decode_bs(); /*! * \brief This block performs g723_40 audio decoding. @@ -37,7 +38,7 @@ vocoder_g723_40_decode_bs_sptr vocoder_make_g723_40_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_g723_40_decode_bs : virtual public gr_sync_block +class VOCODER_API vocoder_g723_40_decode_bs : virtual public gr_sync_block { }; diff --git a/gr-vocoder/include/vocoder_g723_40_encode_sb.h b/gr-vocoder/include/vocoder_g723_40_encode_sb.h index f349cf425..6ac0f6d05 100644 --- a/gr-vocoder/include/vocoder_g723_40_encode_sb.h +++ b/gr-vocoder/include/vocoder_g723_40_encode_sb.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_G723_40_ENCODE_SB_H #define INCLUDED_VOCODER_G723_40_ENCODE_SB_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_g723_40_encode_sb; typedef boost::shared_ptr<vocoder_g723_40_encode_sb> vocoder_g723_40_encode_sb_sptr; -vocoder_g723_40_encode_sb_sptr vocoder_make_g723_40_encode_sb(); +VOCODER_API vocoder_g723_40_encode_sb_sptr vocoder_make_g723_40_encode_sb(); /*! * \brief This block performs g723_40 audio encoding. @@ -37,7 +38,7 @@ vocoder_g723_40_encode_sb_sptr vocoder_make_g723_40_encode_sb(); * \ingroup vocoder_blk */ -class vocoder_g723_40_encode_sb : virtual public gr_sync_block +class VOCODER_API vocoder_g723_40_encode_sb : virtual public gr_sync_block { }; diff --git a/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h b/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h index 4c6248d39..748ff5f0f 100644 --- a/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h +++ b/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h @@ -23,21 +23,22 @@ #ifndef INCLUDED_VOCODER_GSM_FR_DECODE_PS_H #define INCLUDED_VOCODER_GSM_FR_DECODE_PS_H +#include <vocoder_api.h> #include <gr_sync_interpolator.h> class vocoder_gsm_fr_decode_ps; typedef boost::shared_ptr<vocoder_gsm_fr_decode_ps> vocoder_gsm_fr_decode_ps_sptr; -vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); +VOCODER_API vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); /*! * \brief GSM 06.10 Full Rate Vocoder Decoder * \ingroup vocoder_blk */ -class vocoder_gsm_fr_decode_ps : public gr_sync_interpolator { +class VOCODER_API vocoder_gsm_fr_decode_ps : public gr_sync_interpolator { struct gsm_state *d_gsm; - friend vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); + friend VOCODER_API vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); vocoder_gsm_fr_decode_ps (); public: diff --git a/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h b/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h index d1803c82e..18f78f525 100644 --- a/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h +++ b/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h @@ -23,12 +23,13 @@ #ifndef INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H #define INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H +#include <vocoder_api.h> #include <gr_sync_decimator.h> class vocoder_gsm_fr_encode_sp; typedef boost::shared_ptr<vocoder_gsm_fr_encode_sp> vocoder_gsm_fr_encode_sp_sptr; -vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); +VOCODER_API vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); /*! * \brief GSM 06.10 Full Rate Vocoder Encoder @@ -36,10 +37,10 @@ vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); * * shorts in; 33 byte packets out */ -class vocoder_gsm_fr_encode_sp : public gr_sync_decimator { +class VOCODER_API vocoder_gsm_fr_encode_sp : public gr_sync_decimator { struct gsm_state *d_gsm; - friend vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); + friend VOCODER_API vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); vocoder_gsm_fr_encode_sp (); public: diff --git a/gr-vocoder/include/vocoder_ulaw_decode_bs.h b/gr-vocoder/include/vocoder_ulaw_decode_bs.h index 1126c6cb3..f69358168 100644 --- a/gr-vocoder/include/vocoder_ulaw_decode_bs.h +++ b/gr-vocoder/include/vocoder_ulaw_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_ULAW_DECODE_BS_H #define INCLUDED_VOCODER_ULAW_DECODE_BS_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_ulaw_decode_bs; typedef boost::shared_ptr<vocoder_ulaw_decode_bs> vocoder_ulaw_decode_bs_sptr; -vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); +VOCODER_API vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); /*! * \brief This block performs ulaw audio decoding. @@ -37,10 +38,10 @@ vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_ulaw_decode_bs : public gr_sync_block +class VOCODER_API vocoder_ulaw_decode_bs : public gr_sync_block { private: - friend vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); + friend VOCODER_API vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); vocoder_ulaw_decode_bs(); diff --git a/gr-vocoder/include/vocoder_ulaw_encode_sb.h b/gr-vocoder/include/vocoder_ulaw_encode_sb.h index eddc4f4e5..a1c2af05b 100644 --- a/gr-vocoder/include/vocoder_ulaw_encode_sb.h +++ b/gr-vocoder/include/vocoder_ulaw_encode_sb.h @@ -23,23 +23,24 @@ #ifndef INCLUDED_VOCODER_ULAW_ENCODER_SB_H #define INCLUDED_VOCODER_ULAW_ENCODER_SB_H +#include <vocoder_api.h> #include <gr_sync_block.h> class vocoder_ulaw_encode_sb; typedef boost::shared_ptr<vocoder_ulaw_encode_sb> vocoder_ulaw_encode_sb_sptr; -vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); +VOCODER_API vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); /*! * \brief This block performs g.711 ulaw audio encoding. * * \ingroup vocoder_blk */ -class vocoder_ulaw_encode_sb : public gr_sync_block +class VOCODER_API vocoder_ulaw_encode_sb : public gr_sync_block { private: - friend vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); + friend VOCODER_API vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); vocoder_ulaw_encode_sb(); diff --git a/gr-vocoder/lib/CMakeLists.txt b/gr-vocoder/lib/CMakeLists.txt new file mode 100644 index 000000000..74138b050 --- /dev/null +++ b/gr-vocoder/lib/CMakeLists.txt @@ -0,0 +1,74 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup the include and linker paths +######################################################################## +INCLUDE_DIRECTORIES( + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_VOCODER_INCLUDE_DIRS} +) + +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Setup library +######################################################################## +LIST(APPEND gr_vocoder_sources + vocoder_alaw_decode_bs.cc + vocoder_alaw_encode_sb.cc + vocoder_codec2_decode_ps.cc + vocoder_codec2_encode_sp.cc + vocoder_cvsd_decode_bs.cc + vocoder_cvsd_encode_sb.cc + vocoder_g721_decode_bs.cc + vocoder_g721_encode_sb.cc + vocoder_g723_24_decode_bs.cc + vocoder_g723_24_encode_sb.cc + vocoder_g723_40_decode_bs.cc + vocoder_g723_40_encode_sb.cc + vocoder_gsm_fr_decode_ps.cc + vocoder_gsm_fr_encode_sp.cc + vocoder_ulaw_decode_bs.cc + vocoder_ulaw_encode_sb.cc +) + +######################################################################## +# Include subdirs rather to populate to the sources lists. +######################################################################## +GR_INCLUDE_SUBDIRECTORY(codec2) +GR_INCLUDE_SUBDIRECTORY(g7xx) +GR_INCLUDE_SUBDIRECTORY(gsm) + +LIST(APPEND vocoder_libs + gnuradio-core + ${Boost_LIBRARIES} +) + +ADD_LIBRARY(gnuradio-vocoder SHARED ${gr_vocoder_sources}) +TARGET_LINK_LIBRARIES(gnuradio-vocoder ${vocoder_libs}) +SET_TARGET_PROPERTIES(gnuradio-vocoder PROPERTIES DEFINE_SYMBOL "gnuradio_vocoder_EXPORTS") +SET_TARGET_PROPERTIES(gnuradio-vocoder PROPERTIES SOVERSION ${LIBVER}) + +INSTALL(TARGETS gnuradio-vocoder + LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "vocoder_runtime" # .so/.dylib file + ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "vocoder_devel" # .lib file + RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "vocoder_runtime" # .dll file +) diff --git a/gr-vocoder/lib/codec2/CMakeLists.txt b/gr-vocoder/lib/codec2/CMakeLists.txt new file mode 100644 index 000000000..3a666fb59 --- /dev/null +++ b/gr-vocoder/lib/codec2/CMakeLists.txt @@ -0,0 +1,113 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Create executable to generate other sources +# http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build +######################################################################## +IF(NOT CMAKE_CROSSCOMPILING) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + ADD_EXECUTABLE(generate_codebook ${CMAKE_CURRENT_SOURCE_DIR}/generate_codebook.c) + TARGET_LINK_LIBRARIES(generate_codebook -lm) + EXPORT(TARGETS generate_codebook APPEND FILE ${EXPORT_FILE}) +ENDIF() + +######################################################################## +# Create codebook +######################################################################## +SET(CODEBOOKS + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp1.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp2.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp3.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp4.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp5.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp6.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp7.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp8.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp9.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/lsp10.txt +) + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebook.c + DEPENDS generate_codebook ${CODEBOOKS} + COMMAND generate_codebook lsp_cb ${CODEBOOKS} > ${CMAKE_CURRENT_BINARY_DIR}/codebook.c +) + +######################################################################## +# Create codebookd +######################################################################## +SET(CODEBOOKSD + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp1.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp2.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp3.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp4.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp5.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp6.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp7.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp8.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp9.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp10.txt +) + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c + DEPENDS generate_codebook ${CODEBOOKSD} + COMMAND generate_codebook lsp_cbd ${CODEBOOKSD} > ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c +) + +######################################################################## +# Create codebookdvq +######################################################################## +SET(CODEBOOKSDVQ + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp1.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp2.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp3.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp4.txt + ${CMAKE_CURRENT_SOURCE_DIR}/codebook/dlsp5.txt +) + +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/codebookdvq.c + DEPENDS generate_codebook ${CODEBOOKSDVQ} + COMMAND generate_codebook lsp_cbdvq ${CODEBOOKSDVQ} > ${CMAKE_CURRENT_BINARY_DIR}/codebookdvq.c +) + +######################################################################## +# Append all sources in this dir +######################################################################## +LIST(APPEND gr_vocoder_sources + ${CMAKE_CURRENT_BINARY_DIR}/codebook.c + ${CMAKE_CURRENT_BINARY_DIR}/codebookd.c + ${CMAKE_CURRENT_BINARY_DIR}/codebookdvq.c + + ${CMAKE_CURRENT_SOURCE_DIR}/dump.c + ${CMAKE_CURRENT_SOURCE_DIR}/lpc.c + ${CMAKE_CURRENT_SOURCE_DIR}/nlp.c + ${CMAKE_CURRENT_SOURCE_DIR}/postfilter.c + ${CMAKE_CURRENT_SOURCE_DIR}/sine.c + ${CMAKE_CURRENT_SOURCE_DIR}/codec2.c + ${CMAKE_CURRENT_SOURCE_DIR}/fft.c + ${CMAKE_CURRENT_SOURCE_DIR}/kiss_fft.c + ${CMAKE_CURRENT_SOURCE_DIR}/interp.c + ${CMAKE_CURRENT_SOURCE_DIR}/lsp.c + ${CMAKE_CURRENT_SOURCE_DIR}/phase.c + ${CMAKE_CURRENT_SOURCE_DIR}/quantise.c + ${CMAKE_CURRENT_SOURCE_DIR}/pack.c +) diff --git a/gr-vocoder/lib/g7xx/CMakeLists.txt b/gr-vocoder/lib/g7xx/CMakeLists.txt new file mode 100644 index 000000000..4c67109e1 --- /dev/null +++ b/gr-vocoder/lib/g7xx/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Append all sources in this dir +######################################################################## +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +LIST(APPEND gr_vocoder_sources + ${CMAKE_CURRENT_SOURCE_DIR}/g711.c + ${CMAKE_CURRENT_SOURCE_DIR}/g72x.c + ${CMAKE_CURRENT_SOURCE_DIR}/g721.c + ${CMAKE_CURRENT_SOURCE_DIR}/g723_24.c + ${CMAKE_CURRENT_SOURCE_DIR}/g723_40.c +) diff --git a/gr-vocoder/lib/gsm/CMakeLists.txt b/gr-vocoder/lib/gsm/CMakeLists.txt new file mode 100644 index 000000000..128f87231 --- /dev/null +++ b/gr-vocoder/lib/gsm/CMakeLists.txt @@ -0,0 +1,49 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Append all sources in this dir +######################################################################## +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + +SET(gsm_sources + ${CMAKE_CURRENT_SOURCE_DIR}/add.c + ${CMAKE_CURRENT_SOURCE_DIR}/code.c + ${CMAKE_CURRENT_SOURCE_DIR}/debug.c + ${CMAKE_CURRENT_SOURCE_DIR}/decode.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_create.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_decode.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_destroy.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_encode.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_explode.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_implode.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_option.c + ${CMAKE_CURRENT_SOURCE_DIR}/gsm_print.c + ${CMAKE_CURRENT_SOURCE_DIR}/long_term.c + ${CMAKE_CURRENT_SOURCE_DIR}/lpc.c + ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.c + ${CMAKE_CURRENT_SOURCE_DIR}/rpe.c + ${CMAKE_CURRENT_SOURCE_DIR}/short_term.c + ${CMAKE_CURRENT_SOURCE_DIR}/table.c +) + +SET_SOURCE_FILES_PROPERTIES(${gsm_sources} + PROPERTIES COMPILE_DEFINITION "NeedFunctionPrototypes=1" +) +LIST(APPEND gr_vocoder_sources ${gsm_sources}) diff --git a/gr-vocoder/lib/gsm/gsm_create.c b/gr-vocoder/lib/gsm/gsm_create.c index de0b125b4..a59aa2f2a 100644 --- a/gr-vocoder/lib/gsm/gsm_create.c +++ b/gr-vocoder/lib/gsm/gsm_create.c @@ -30,7 +30,6 @@ static char const ident[] = "$Header$"; #include "gsm.h" #include "private.h" #include "proto.h" -#include <strings.h> gsm gsm_create P0() { diff --git a/gr-vocoder/python/CMakeLists.txt b/gr-vocoder/python/CMakeLists.txt new file mode 100644 index 000000000..c3702ad70 --- /dev/null +++ b/gr-vocoder/python/CMakeLists.txt @@ -0,0 +1,50 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup python install +######################################################################## +INCLUDE(GrPython) + +GR_PYTHON_INSTALL( + FILES + __init__.py + cvsd.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/vocoder + COMPONENT "vocoder_python" +) + +######################################################################## +# Handle the unit tests +######################################################################## +IF(ENABLE_TESTING) +INCLUDE(GrTest) +FILE(GLOB py_qa_test_files "qa_*.py") +FOREACH(py_qa_test_file ${py_qa_test_files}) + GET_FILENAME_COMPONENT(py_qa_test_name ${py_qa_test_file} NAME_WE) + SET(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_BINARY_DIR}/gr-vocoder/python + ${CMAKE_BINARY_DIR}/gr-vocoder/swig + ) + SET(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-vocoder) + GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) +ENDFOREACH(py_qa_test_file) +ENDIF(ENABLE_TESTING) diff --git a/gr-vocoder/swig/CMakeLists.txt b/gr-vocoder/swig/CMakeLists.txt new file mode 100644 index 000000000..61d123a74 --- /dev/null +++ b/gr-vocoder/swig/CMakeLists.txt @@ -0,0 +1,61 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup swig generation +######################################################################## +INCLUDE(GrPython) +INCLUDE(GrSwig) + +SET(GR_SWIG_INCLUDE_DIRS + ${GR_VOCODER_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} +) + +SET(GR_SWIG_LIBRARIES gnuradio-vocoder) + +GR_SWIG_MAKE(vocoder_swig vocoder_swig.i) + +GR_SWIG_INSTALL( + TARGETS vocoder_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/vocoder + COMPONENT "vocoder_python" +) + +INSTALL( + FILES + vocoder_alaw_decode_bs.i + vocoder_alaw_encode_sb.i + vocoder_codec2_decode_ps.i + vocoder_codec2_encode_sp.i + vocoder_cvsd_decode_bs.i + vocoder_cvsd_encode_sb.i + vocoder_g721_decode_bs.i + vocoder_g721_encode_sb.i + vocoder_g723_24_decode_bs.i + vocoder_g723_24_encode_sb.i + vocoder_g723_40_decode_bs.i + vocoder_g723_40_encode_sb.i + vocoder_gsm_fr_encode_sp.i + vocoder_gsm_fr_decode_ps.i + vocoder_ulaw_decode_bs.i + vocoder_ulaw_encode_sb.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "vocoder_swig" +) |