diff options
231 files changed, 2455 insertions, 5955 deletions
diff --git a/config/Makefile.am b/config/Makefile.am index 68ff3c78c..535844507 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -51,12 +51,7 @@ m4macros = \ grc_gnuradio_examples.m4 \ grc_grc.m4 \ grc_gr_atsc.m4 \ - grc_gr_audio_alsa.m4 \ - grc_gr_audio_jack.m4 \ - grc_gr_audio_oss.m4 \ - grc_gr_audio_osx.m4 \ - grc_gr_audio_portaudio.m4 \ - grc_gr_audio_windows.m4 \ + grc_gr_audio.m4 \ grc_gr_comedi.m4 \ grc_gr_gcell.m4 \ grc_gr_gpio.m4 \ diff --git a/config/grc_gnuradio_examples.m4 b/config/grc_gnuradio_examples.m4 index 0aad0c0da..203f39d0d 100644 --- a/config/grc_gnuradio_examples.m4 +++ b/config/grc_gnuradio_examples.m4 @@ -20,12 +20,14 @@ dnl Boston, MA 02110-1301, USA. AC_DEFUN([GRC_GNURADIO_EXAMPLES],[ GRC_ENABLE(gnuradio-examples) - dnl Do not do gnuradio-examples if gnuradio-core skipped + dnl Do not do gnuradio-examples if gnuradio-core or gr-audio skipped GRC_CHECK_DEPENDENCY(gnuradio-examples, gnuradio-core) + GRC_CHECK_DEPENDENCY(gnuradio-examples, gr-audio) AC_CONFIG_FILES([ \ gnuradio-examples/Makefile \ gnuradio-examples/c++/Makefile \ + gnuradio-examples/c++/audio/Makefile \ gnuradio-examples/python/Makefile \ gnuradio-examples/grc/Makefile \ gnuradio-examples/python/apps/hf_explorer/Makefile \ diff --git a/config/grc_gr_audio.m4 b/config/grc_gr_audio.m4 new file mode 100644 index 000000000..bcb19be35 --- /dev/null +++ b/config/grc_gr_audio.m4 @@ -0,0 +1,112 @@ +dnl Copyright 2011 Free Software Foundation, Inc. +dnl +dnl This file is part of GNU Radio +dnl +dnl GNU Radio is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl GNU Radio is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with GNU Radio; see the file COPYING. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, +dnl Boston, MA 02110-1301, USA. + +AC_DEFUN([GRC_GR_AUDIO],[ + GRC_ENABLE(gr-audio) + + GRC_CHECK_DEPENDENCY(gr-audio, gnuradio-core) + + #################################################################### + ## ALSA Support + #################################################################### + PKG_CHECK_MODULES(ALSA, alsa >= 0.9,[GR_AUDIO_ALSA_SUPPORT=true], + [GR_AUDIO_ALSA_SUPPORT=false;AC_MSG_RESULT([gr-audio alsa support requires package alsa, not found.])]) + AM_CONDITIONAL(GR_AUDIO_ALSA_SUPPORT, $GR_AUDIO_ALSA_SUPPORT) + + #################################################################### + ## OSS Support + #################################################################### + dnl Make sure the correct library and/or headers are available. + case $host_os in + netbsd*) + AC_HAVE_LIBRARY(ossaudio,[GR_AUDIO_OSS_SUPPORT=true], + [GR_AUDIO_OSS_SUPPORT=false;AC_MSG_RESULT([gr-audio oss support requires library ossaudio, not found.])]) + if test $GR_AUDIO_OSS_SUPPORT != false; then + OSS_LIBS=-lossaudio + AC_SUBST(OSS_LIBS) + AC_MSG_RESULT([Using OSS library $OSS_LIBS]) + fi + ;; + darwin*) + dnl OSX / Darwin can't use OSS + GR_AUDIO_OSS_SUPPORT=false + ;; + *) + AC_CHECK_HEADER(sys/soundcard.h,[GR_AUDIO_OSS_SUPPORT=true], + [GR_AUDIO_OSS_SUPPORT=false;AC_MSG_RESULT([gr-audio oss support requires sys/soundcard.h, not found.])]) + esac + AM_CONDITIONAL(GR_AUDIO_OSS_SUPPORT, $GR_AUDIO_OSS_SUPPORT) + + #################################################################### + ## Jack Support + #################################################################### + PKG_CHECK_MODULES(JACK, jack >= 0.8, [GR_AUDIO_JACK_SUPPORT=true], + [GR_AUDIO_JACK_SUPPORT=false;AC_MSG_RESULT([gr-audio jack support requires package jack, not found.])]) + AM_CONDITIONAL(GR_AUDIO_JACK_SUPPORT, $GR_AUDIO_JACK_SUPPORT) + + #################################################################### + ## OSX Support + #################################################################### + case "$host_os" in + darwin*) + MACOSX_AUDIOUNIT([GR_AUDIO_OSX_SUPPORT=true], + [GR_AUDIO_OSX_SUPPORT=false;AC_MSG_RESULT([gr-audio osx support requires AudioUnit, not found.])]) + ;; + *) + AC_MSG_RESULT([gr-audio osx support will build on Mac OS X and Darwin only.]) + GR_AUDIO_OSX_SUPPORT=false + ;; + esac + AM_CONDITIONAL(GR_AUDIO_OSX_SUPPORT, $GR_AUDIO_OSX_SUPPORT) + + #################################################################### + ## PortAudio Support + #################################################################### + PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19,[GR_AUDIO_PORTAUDIO_SUPPORT=true], + [GR_AUDIO_PORTAUDIO_SUPPORT=false;AC_MSG_RESULT([gr-audio portaudio support requires package portaudio, not found.])]) + AM_CONDITIONAL(GR_AUDIO_PORTAUDIO_SUPPORT, $GR_AUDIO_PORTAUDIO_SUPPORT) + + #################################################################### + ## Windows Support + #################################################################### + case "$host_os" in + cygwin*|win*|mingw*) + AC_HAVE_LIBRARY(winmm, [GR_AUDIO_WINDOWS_SUPPORT=true], + [GR_AUDIO_WINDOWS_SUPPORT=false;AC_MSG_RESULT([gr-audio windows support requires library winmm, not found.])]) + ;; + *) + AC_MSG_RESULT([gr-audio windows support will build on a Windows Unix environment only.]) + GR_AUDIO_WINDOWS_SUPPORT=false + ;; + esac + WINAUDIO_LIBS=-lwinmm + AC_SUBST(WINAUDIO_LIBS) + AM_CONDITIONAL(GR_AUDIO_WINDOWS_SUPPORT, $GR_AUDIO_WINDOWS_SUPPORT) + + AC_CONFIG_FILES([ \ + gr-audio/Makefile \ + gr-audio/grc/Makefile \ + gr-audio/include/Makefile \ + gr-audio/lib/Makefile \ + gr-audio/swig/Makefile \ + gr-audio/gnuradio-audio.pc \ + ]) + + GRC_BUILD_CONDITIONAL(gr-audio) +]) diff --git a/config/grc_gr_audio_alsa.m4 b/config/grc_gr_audio_alsa.m4 deleted file mode 100644 index 35389d81d..000000000 --- a/config/grc_gr_audio_alsa.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. -dnl -dnl This file is part of GNU Radio -dnl -dnl GNU Radio is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3, or (at your option) -dnl any later version. -dnl -dnl GNU Radio is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with GNU Radio; see the file COPYING. If not, write to -dnl the Free Software Foundation, Inc., 51 Franklin Street, -dnl Boston, MA 02110-1301, USA. - -AC_DEFUN([GRC_GR_AUDIO_ALSA],[ - GRC_ENABLE(gr-audio-alsa) - - dnl Don't do gr-audio-alsa if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-alsa, gnuradio-core) - - dnl If execution gets to here, $passed will be: - dnl with : if the --with code didn't error out - dnl yes : if the --enable code passed muster and all dependencies are met - dnl no : otherwise - if test $passed = yes; then - dnl Don't do gr-audio-alsa if the 'alsa' package is not installed. - PKG_CHECK_MODULES(ALSA, alsa >= 0.9,[], - [passed=no;AC_MSG_RESULT([gr-audio-alsa requires package alsa, not found.])]) - fi - - AC_CONFIG_FILES([ \ - gr-audio-alsa/Makefile \ - gr-audio-alsa/gnuradio-audio-alsa.pc \ - gr-audio-alsa/src/Makefile \ - gr-audio-alsa/src/run_guile_tests \ - gr-audio-alsa/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-alsa,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_alsa], - [chmod +x gr-audio-alsa/src/run_tests gr-audio-alsa/src/run_guile_tests]) - ]) -]) diff --git a/config/grc_gr_audio_jack.m4 b/config/grc_gr_audio_jack.m4 deleted file mode 100644 index d1853588b..000000000 --- a/config/grc_gr_audio_jack.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. -dnl -dnl This file is part of GNU Radio -dnl -dnl GNU Radio is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3, or (at your option) -dnl any later version. -dnl -dnl GNU Radio is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with GNU Radio; see the file COPYING. If not, write to -dnl the Free Software Foundation, Inc., 51 Franklin Street, -dnl Boston, MA 02110-1301, USA. - -AC_DEFUN([GRC_GR_AUDIO_JACK],[ - GRC_ENABLE(gr-audio-jack) - - dnl Don't do gr-audio-jack if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-jack, gnuradio-core) - - dnl If execution gets to here, $passed will be: - dnl with : if the --with code didn't error out - dnl yes : if the --enable code passed muster and all dependencies are met - dnl no : otherwise - if test $passed = yes; then - dnl Don't do gr-audio-jack if in 'jack' isn't installed - PKG_CHECK_MODULES(JACK, jack >= 0.8, [], - [passed=no;AC_MSG_RESULT([gr-audio-jack requires package jack, not found.])]) - fi - - AC_CONFIG_FILES([ \ - gr-audio-jack/Makefile \ - gr-audio-jack/gnuradio-audio-jack.pc \ - gr-audio-jack/src/Makefile \ - gr-audio-jack/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-jack,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_jack], [chmod +x gr-audio-jack/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_oss.m4 b/config/grc_gr_audio_oss.m4 deleted file mode 100644 index 13c83bba9..000000000 --- a/config/grc_gr_audio_oss.m4 +++ /dev/null @@ -1,63 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. -dnl -dnl This file is part of GNU Radio -dnl -dnl GNU Radio is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3, or (at your option) -dnl any later version. -dnl -dnl GNU Radio is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with GNU Radio; see the file COPYING. If not, write to -dnl the Free Software Foundation, Inc., 51 Franklin Street, -dnl Boston, MA 02110-1301, USA. - -AC_DEFUN([GRC_GR_AUDIO_OSS],[ - GRC_ENABLE(gr-audio-oss) - - dnl Don't do gr-audio-oss if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-oss, gnuradio-core) - - dnl If execution gets to here, $passed will be: - dnl with : if the --with code didn't error out - dnl yes : if the --enable code passed muster and all dependencies are met - dnl no : otherwise - if test $passed = yes; then - dnl Make sure the correct library and/or headers are available. - case $host_os in - netbsd*) - AC_HAVE_LIBRARY(ossaudio,[], - [passed=no;AC_MSG_RESULT([gr-audio-oss requires library ossaudio, not found.])]) - if test $passed != no; then - OSS_LIBS=-lossaudio - AC_SUBST(OSS_LIBS) - AC_MSG_RESULT([Using OSS library $OSS_LIBS]) - fi - ;; - darwin*) - dnl OSX / Darwin can't use OSS - passed=no - ;; - *) - AC_CHECK_HEADER(sys/soundcard.h,[], - [passed=no;AC_MSG_RESULT([gr-audio-oss requires sys/soundcard.h, not found.])]) - esac - fi - - AC_CONFIG_FILES([ \ - gr-audio-oss/Makefile \ - gr-audio-oss/gnuradio-audio-oss.pc \ - gr-audio-oss/src/Makefile \ - gr-audio-oss/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-oss,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_oss], [chmod +x gr-audio-oss/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_osx.m4 b/config/grc_gr_audio_osx.m4 deleted file mode 100644 index df8634ff6..000000000 --- a/config/grc_gr_audio_osx.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2010 Free Software Foundation, Inc. -dnl -dnl This file is part of GNU Radio -dnl -dnl GNU Radio is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3, or (at your option) -dnl any later version. -dnl -dnl GNU Radio is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with GNU Radio; see the file COPYING. If not, write to -dnl the Free Software Foundation, Inc., 51 Franklin Street, -dnl Boston, MA 02110-1301, USA. - -AC_DEFUN([GRC_GR_AUDIO_OSX],[ - GRC_ENABLE(gr-audio-osx) - - dnl Don't do gr-audio-osx if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-osx, gnuradio-core) - - dnl If execution gets to here, $passed will be: - dnl with : if the --with code didn't error out - dnl yes : if the --enable code passed muster and all dependencies are met - dnl no : otherwise - if test $passed = yes; then - case "$host_os" in - darwin*) - MACOSX_AUDIOUNIT([], - [passed=no;AC_MSG_RESULT([gr-audio-osx requires AudioUnit, not found.])]) - ;; - *) - AC_MSG_RESULT([gr-audio-osx will build on Mac OS X and Darwin only.]) - passed=no - ;; - esac - fi - - AC_CONFIG_FILES([ \ - gr-audio-osx/Makefile \ - gr-audio-osx/src/Makefile \ - gr-audio-osx/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-osx,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_osx], [chmod +x gr-audio-osx/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_portaudio.m4 b/config/grc_gr_audio_portaudio.m4 deleted file mode 100644 index ff551b38a..000000000 --- a/config/grc_gr_audio_portaudio.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. -dnl -dnl This file is part of GNU Radio -dnl -dnl GNU Radio is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3, or (at your option) -dnl any later version. -dnl -dnl GNU Radio is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with GNU Radio; see the file COPYING. If not, write to -dnl the Free Software Foundation, Inc., 51 Franklin Street, -dnl Boston, MA 02110-1301, USA. - -AC_DEFUN([GRC_GR_AUDIO_PORTAUDIO],[ - GRC_ENABLE(gr-audio-portaudio) - - dnl Don't do gr-audio-portaudio if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-portaudio, gnuradio-core) - - dnl If execution gets to here, $passed will be: - dnl with : if the --with code didn't error out - dnl yes : if the --enable code passed muster and all dependencies are met - dnl no : otherwise - if test $passed = yes; then - dnl Don't do gr-audio-portaudio if the 'portaudio' library is unavailable. - PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19,[], - [passed=no;AC_MSG_RESULT([gr-audio-portaudio requires package portaudio, not found.])]) - fi - - AC_CONFIG_FILES([ \ - gr-audio-portaudio/Makefile \ - gr-audio-portaudio/gnuradio-audio-portaudio.pc \ - gr-audio-portaudio/src/Makefile \ - gr-audio-portaudio/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-portaudio,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_portaudio], [chmod +x gr-audio-portaudio/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_windows.m4 b/config/grc_gr_audio_windows.m4 deleted file mode 100644 index bb6244163..000000000 --- a/config/grc_gr_audio_windows.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. -dnl -dnl This file is part of GNU Radio -dnl -dnl GNU Radio is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3, or (at your option) -dnl any later version. -dnl -dnl GNU Radio is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with GNU Radio; see the file COPYING. If not, write to -dnl the Free Software Foundation, Inc., 51 Franklin Street, -dnl Boston, MA 02110-1301, USA. - -AC_DEFUN([GRC_GR_AUDIO_WINDOWS],[ - GRC_ENABLE(gr-audio-windows) - - dnl Don't do gr-audio-windows if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-windows, gnuradio-core) - - dnl If execution gets to here, $passed will be: - dnl with : if the --with code didn't error out - dnl yes : if the --enable code passed muster and all dependencies are met - dnl no : otherwise - if test $passed = yes; then - case "$host_os" in - cygwin*|win*|mingw*) - dnl Don't do gr-audio-windows if the 'winmm' library isn't available. - AC_HAVE_LIBRARY(winmm, [], - [passed=no;AC_MSG_RESULT([gr-audio-windows requires library winmm, not found.])]) - ;; - *) - AC_MSG_RESULT([gr-audio-windows will build on a Windows Unix environment only.]) - passed=no - ;; - esac - fi - - AC_CONFIG_FILES([ \ - gr-audio-windows/Makefile \ - gr-audio-windows/src/Makefile \ - gr-audio-windows/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-windows,[ - WINAUDIO_LIBS=-lwinmm - AC_SUBST(WINAUDIO_LIBS) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_audio_windows], [chmod +x gr-audio-windows/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_qtgui.m4 b/config/grc_gr_qtgui.m4 index 4027bb332..92392c883 100644 --- a/config/grc_gr_qtgui.m4 +++ b/config/grc_gr_qtgui.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. +dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -29,13 +29,12 @@ AC_DEFUN([GRC_GR_QTGUI],[ dnl no : otherwise PYTHON_CHECK_MODULE([PyQt4.QtCore], [PyQt4 for Qt4], \ - [passed=yes], [passed=no], \ - [PyQt4.QtCore.PYQT_VERSION >= 260000]) + [], [passed=no], \ + [PyQt4.QtCore.PYQT_VERSION >= 260000]) - # Enable this if we want to test for PyQwt, too - #PYTHON_CHECK_MODULE([PyQt4.Qwt5], [PyQwt5 for Qt4], \ - # [passed=yes], [passed=no], \ - # [PyQt4.Qwt5.QWT_VERSION >= 327000]) + PYTHON_CHECK_MODULE([PyQt4.Qwt5], [PyQwt5 for Qt4], \ + [], [passed=no], \ + [PyQt4.Qwt5.QWT_VERSION >= 327000]) # Check for: # QtOpenGL @@ -82,6 +81,7 @@ AC_DEFUN([GRC_GR_QTGUI],[ AC_CONFIG_FILES([ \ gr-qtgui/Makefile \ + gr-qtgui/grc/Makefile \ gr-qtgui/src/Makefile \ gr-qtgui/src/lib/Makefile \ gr-qtgui/src/python/Makefile \ diff --git a/config/grc_gr_usrp.m4 b/config/grc_gr_usrp.m4 index b850f0050..c3d2667ca 100644 --- a/config/grc_gr_usrp.m4 +++ b/config/grc_gr_usrp.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. +dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -26,6 +26,7 @@ AC_DEFUN([GRC_GR_USRP],[ AC_CONFIG_FILES([ \ gr-usrp/Makefile \ + gr-usrp/grc/Makefile \ gr-usrp/gnuradio-usrp.pc \ gr-usrp/src/Makefile \ gr-usrp/src/run_tests \ diff --git a/config/grc_gr_usrp2.m4 b/config/grc_gr_usrp2.m4 index 5a9bb3b70..3d64db6d6 100644 --- a/config/grc_gr_usrp2.m4 +++ b/config/grc_gr_usrp2.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2008 Free Software Foundation, Inc. +dnl Copyright 2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -26,6 +26,7 @@ AC_DEFUN([GRC_GR_USRP2],[ AC_CONFIG_FILES([ \ gr-usrp2/Makefile \ + gr-usrp2/grc/Makefile \ gr-usrp2/gnuradio-usrp2.pc \ gr-usrp2/src/Makefile \ gr-usrp2/src/run_tests \ diff --git a/config/grc_gr_wxgui.m4 b/config/grc_gr_wxgui.m4 index c443f7c6c..17925fcc5 100644 --- a/config/grc_gr_wxgui.m4 +++ b/config/grc_gr_wxgui.m4 @@ -36,6 +36,7 @@ AC_DEFUN([GRC_GR_WXGUI],[ AC_CONFIG_FILES([ \ gr-wxgui/Makefile \ gr-wxgui/gr-wxgui.pc \ + gr-wxgui/grc/Makefile \ gr-wxgui/src/Makefile \ gr-wxgui/src/python/Makefile \ gr-wxgui/src/python/plotter/Makefile \ diff --git a/configure.ac b/configure.ac index 7546eb302..73ebbd6af 100644 --- a/configure.ac +++ b/configure.ac @@ -219,20 +219,11 @@ AC_CHECK_LIB(m, sincos, [AC_DEFINE([HAVE_SINCOS],[1],[Define to 1 if your system AC_CHECK_LIB(m, sincosf,[AC_DEFINE([HAVE_SINCOSF],[1],[Define to 1 if your system has `sincosf'.])]) AC_CHECK_LIB(m, sinf, [AC_DEFINE([HAVE_SINF],[1],[Define to 1 if your system has `sinf'.])]) AC_CHECK_LIB(m, cosf, [AC_DEFINE([HAVE_COSF],[1],[Define to 1 if your system has `cosf'.])]) -AC_CHECK_LIB(m, trunc, [AC_DEFINE([HAVE_TRUNC],[1],[Define to 1 if your system has `trunc'.])]) AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])]) AC_CHECK_LIB(m, log2, [AC_DEFINE([HAVE_LOG2],[1],[Define to 1 if your system has 'log2'.])]) #AC_FUNC_MKTIME AH_BOTTOM([ -#ifndef HAVE_TRUNC -#include <math.h> -inline static double trunc(double x) -{ - return x >= 0 ? floor(x) : ceil(x); -} -#endif - #ifndef HAVE_EXP10 #include <math.h> inline static double exp10(double x) @@ -367,12 +358,7 @@ GRC_GR_USRP dnl this must come after GRC_USRP GRC_GR_USRP2 GRC_GR_GCELL dnl this must come after GRC_GCELL and GRC_GNURADIO_CORE GRC_GR_MSDD6000 -GRC_GR_AUDIO_ALSA -GRC_GR_AUDIO_JACK -GRC_GR_AUDIO_OSS -GRC_GR_AUDIO_OSX -GRC_GR_AUDIO_PORTAUDIO -GRC_GR_AUDIO_WINDOWS +GRC_GR_AUDIO GRC_GR_ATSC GRC_GR_COMEDI GRC_GR_CVSD_VOCODER diff --git a/gnuradio-core/src/lib/bug_work_around_6.cc b/gnuradio-core/src/lib/bug_work_around_6.cc index b829360fc..f8012af0d 100644 --- a/gnuradio-core/src/lib/bug_work_around_6.cc +++ b/gnuradio-core/src/lib/bug_work_around_6.cc @@ -1,3 +1,3 @@ // if libgrio has no sources, it doesn't get built correctly - -static int gr_bug_work_around_6 __attribute__((unused)); +#include <gruel/attributes.h> +static int gr_bug_work_around_6 __GR_ATTR_UNUSED; diff --git a/gnuradio-core/src/lib/filter/qa_gr_rotator.cc b/gnuradio-core/src/lib/filter/qa_gr_rotator.cc index ce71a3d88..ef41127fd 100644 --- a/gnuradio-core/src/lib/filter/qa_gr_rotator.cc +++ b/gnuradio-core/src/lib/filter/qa_gr_rotator.cc @@ -20,6 +20,11 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <gruel/attributes.h> #include <cppunit/TestAssert.h> #include <qa_gr_rotator.h> #include <gr_rotator.h> @@ -29,7 +34,7 @@ // error vector magnitude -__attribute__((unused)) static float +__GR_ATTR_UNUSED static float error_vector_mag(gr_complex a, gr_complex b) { return abs(a-b); diff --git a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc index 3c379ea25..2fc97a78a 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc @@ -20,6 +20,11 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <gruel/attributes.h> #include <cppunit/TestAssert.h> #include <qa_gri_mmse_fir_interpolator_cc.h> #include <gri_mmse_fir_interpolator_cc.h> @@ -55,7 +60,7 @@ void qa_gri_mmse_fir_interpolator_cc::t1() { static const unsigned N = 100; - gr_complex input[N + 10] __attribute__ ((aligned (8))); + __GR_ATTR_ALIGNED(8) gr_complex input[N + 10]; for (unsigned i = 0; i < NELEM(input); i++) input[i] = test_fcn ((double) i); diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc index 0f6f0d719..bff22be25 100644 --- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc +++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -28,6 +28,7 @@ #include <gr_io_signature.h> #include <gr_sincos.h> #include <math.h> +#include <boost/math/special_functions/trunc.hpp> gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity) @@ -62,7 +63,7 @@ gr_frequency_modulator_fc::work (int noutput_items, // to avoid loss of precision in the addition above. if (fabs (d_phase) > 16 * M_PI){ - double ii = trunc (d_phase / (2 * M_PI)); + double ii = boost::math::trunc (d_phase / (2 * M_PI)); d_phase = d_phase - (ii * 2 * M_PI); } diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h index 024d74ada..f17b68aa0 100644 --- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h +++ b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_MPSK_RECEIVER_CC_H #define INCLUDED_GR_MPSK_RECEIVER_CC_H +#include <gruel/attributes.h> #include <gr_block.h> #include <gr_complex.h> #include <fstream> @@ -299,7 +300,7 @@ protected: static const unsigned int DLLEN = 8; //! delay line plus some length for overflow protection - gr_complex d_dl[2*DLLEN] __attribute__ ((aligned(8))); + __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN]; //! index to delay line unsigned int d_dl_idx; diff --git a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc index a37189c24..fc0c12ce6 100644 --- a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc +++ b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009,2010 Free Software Foundation, Inc. + * Copyright 2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,6 +26,7 @@ #include <gr_histo_sink_f.h> #include <gr_io_signature.h> +#include <boost/math/special_functions/round.hpp> static float get_clean_num(float num){ if (num == 0) return 0; @@ -101,7 +102,7 @@ gr_histo_sink_f::send_frame(void){ int index; float bin_width = (maximum - minimum)/(d_num_bins-1); for (unsigned int i = 0; i < d_sample_count; i++){ - index = round((d_samps[i] - minimum)/bin_width); + index = boost::math::iround((d_samps[i] - minimum)/bin_width); /* ensure the index range in case a small floating point error is involed */ if (index < 0) index = 0; if (index >= (int)d_num_bins) index = d_num_bins-1; diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc index b60a6e3ab..a96aadc72 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2004,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,6 +33,7 @@ #include <cmath> #include <fcntl.h> #include <gruel/thread.h> +#include <boost/math/special_functions/round.hpp> // win32 (mingw/msvc) specific #ifdef HAVE_IO_H @@ -224,7 +225,7 @@ gr_wavfile_sink::convert_to_short(float sample) sample = d_min_sample_val; } - return (short int) roundf(sample); + return (short int) boost::math::iround(sample); } diff --git a/gnuradio-core/src/lib/missing/bug_work_around_8.cc b/gnuradio-core/src/lib/missing/bug_work_around_8.cc index b2cbdb3d9..5e431a210 100644 --- a/gnuradio-core/src/lib/missing/bug_work_around_8.cc +++ b/gnuradio-core/src/lib/missing/bug_work_around_8.cc @@ -1,2 +1,3 @@ // if libmisc has no sources, it doesn't get built correctly -static int gr_bug_work_around_8 __attribute__((unused)); +#include <gruel/attributes.h> +static int gr_bug_work_around_8 __GR_ATTR_UNUSED; diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.h b/gnuradio-core/src/lib/runtime/gr_buffer.h index aa26f1e09..e5725d386 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.h +++ b/gnuradio-core/src/lib/runtime/gr_buffer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2009,2010 Free Software Foundation, Inc. + * Copyright 2004,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,6 +27,7 @@ #include <boost/weak_ptr.hpp> #include <gruel/thread.h> #include <gruel/pmt.h> +#include <deque> class gr_vmcircbuf; diff --git a/gnuradio-core/src/lib/runtime/gr_flowgraph.cc b/gnuradio-core/src/lib/runtime/gr_flowgraph.cc index 27f6257cc..0d3bbb011 100644 --- a/gnuradio-core/src/lib/runtime/gr_flowgraph.cc +++ b/gnuradio-core/src/lib/runtime/gr_flowgraph.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -28,6 +28,7 @@ #include <gr_io_signature.h> #include <stdexcept> #include <sstream> +#include <iterator> #define GR_FLOWGRAPH_DEBUG 0 diff --git a/gnuradio-core/src/python/gnuradio/Makefile.am b/gnuradio-core/src/python/gnuradio/Makefile.am index a3f3518de..eff35e95c 100644 --- a/gnuradio-core/src/python/gnuradio/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2007,2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2004-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,7 +26,6 @@ SUBDIRS = gr gru gruimpl blks2 blks2impl vocoder grpython_PYTHON = \ __init__.py \ - audio.py \ eng_notation.py \ eng_option.py \ modulation_utils.py \ diff --git a/gnuradio-core/src/python/gnuradio/audio.py b/gnuradio-core/src/python/gnuradio/audio.py deleted file mode 100644 index f6e921f0e..000000000 --- a/gnuradio-core/src/python/gnuradio/audio.py +++ /dev/null @@ -1,88 +0,0 @@ -# -# Copyright 2004,2006 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. -# - -""" -This is the 'generic' audio or soundcard interface. - -The behavior of this module is controlled by the [audio] audio_module -configuration parameter. If it is 'auto' we attempt to import modules -from the known_modules list, using the first one imported successfully. - -If [audio] audio_module is not 'auto', we assume it's the name of -an audio module and attempt to import it. -""" - -__all__ = ['source', 'sink'] - -from gnuradio import gr -import sys - -source = None -sink = None - - -known_modules = ( - 'audio_alsa', 'audio_oss', 'audio_osx', 'audio_jack', 'audio_portaudio', 'audio_windows') - - -def try_import(name): - """ - Build a blob of code and try to execute it. - If it succeeds we will have set the globals source and sink - as side effects. - - returns True or False - """ - global source, sink - full_name = "gnuradio." + name - code = """ -import %s -source = %s.source -sink = %s.sink -""" % (full_name, full_name, full_name) - try: - exec code in globals() - return True - except ImportError: - return False - - -def __init__ (): - p = gr.prefs() # get preferences (config file) object - verbose = p.get_bool('audio', 'verbose', False) - module = p.get_string('audio', 'audio_module', 'auto') - - if module == 'auto': # search our list for the first one that we can import - for m in known_modules: - if try_import(m): - if verbose: sys.stderr.write('audio: using %s\n' % (m,)) - return - raise ImportError, 'Unable to locate an audio module.' - - else: # use the one the user specified - if try_import(module): - if verbose: sys.stderr.write('audio: using %s\n' % (module,)) - else: - msg = 'Failed to import user-specified audio module %s' % (module,) - if verbose: sys.stderr.write('audio: %s\n' % (msg,)) - raise ImportError, msg - -__init__() diff --git a/gnuradio-examples/c++/Makefile.am b/gnuradio-examples/c++/Makefile.am index 43c63847a..5a49e0e89 100644 --- a/gnuradio-examples/c++/Makefile.am +++ b/gnuradio-examples/c++/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2006,2008 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,4 +20,4 @@ # include $(top_srcdir)/Makefile.common -#SUBDIRS = dial_tone +SUBDIRS = audio diff --git a/gnuradio-examples/c++/dial_tone/.gitignore b/gnuradio-examples/c++/audio/.gitignore index c5e345858..bb08aaf91 100644 --- a/gnuradio-examples/c++/dial_tone/.gitignore +++ b/gnuradio-examples/c++/audio/.gitignore @@ -1,5 +1,3 @@ -/.deps -/.libs /Makefile /Makefile.in /dial_tone diff --git a/gnuradio-examples/c++/dial_tone/Makefile.am b/gnuradio-examples/c++/audio/Makefile.am index 188275fca..88bd7c1fd 100644 --- a/gnuradio-examples/c++/dial_tone/Makefile.am +++ b/gnuradio-examples/c++/audio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2006,2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,25 +21,18 @@ include $(top_srcdir)/Makefile.common -# For compiling within the GNU Radio build tree +# For compiling with the GNU Radio build tree, use include dir below. +# For compiling outside the tree, use 'pkg-config --cflags gnuradio-audio' AM_CPPFLAGS = \ - -I$(top_srcdir)/gr-audio-alsa/src \ + -I$(top_srcdir)/gr-audio/include \ $(STD_DEFINES_AND_INCLUDES) \ $(WITH_INCLUDES) -GR_AUDIO_ALSA_LA=$(top_builddir)/gr-audio-alsa/src/libgnuradio-audio-alsa.la - -# For compiling outside the tree, these will get fished out by pkgconfig +# For compiling within the GNU Radio build tree, link against GR_AUDIO_LA +# For compiling outside the tree, use 'pkg-config --libs gnuradio-audio' +GR_AUDIO_LA=$(top_builddir)/gr-audio/lib/libgnuradio-audio.la noinst_PROGRAMS = dial_tone -noinst_HEADERS = \ - dial_tone.h - -dial_tone_SOURCES = \ - dial_tone.cc \ - main.cc - -dial_tone_LDADD = \ - $(GNURADIO_CORE_LA) \ - $(GR_AUDIO_ALSA_LA) +dial_tone_SOURCES = dial_tone.cc +dial_tone_LDADD = $(GNURADIO_CORE_LA) $(GR_AUDIO_LA) diff --git a/gnuradio-examples/c++/audio/dial_tone.cc b/gnuradio-examples/c++/audio/dial_tone.cc new file mode 100644 index 000000000..e4e3d8ceb --- /dev/null +++ b/gnuradio-examples/c++/audio/dial_tone.cc @@ -0,0 +1,78 @@ +/* + * 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. + */ + + +/* + * GNU Radio C++ example creating dial tone + * ("the simplest thing that could possibly work") + * + * Send a tone each to the left and right channels of stereo audio + * output and let the user's brain sum them. + * + * GNU Radio makes extensive use of Boost shared pointers. Signal processing + * blocks are typically created by calling a "make" factory function, which + * returns an instance of the block as a typedef'd shared pointer that can + * be used in any way a regular pointer can. Shared pointers created this way + * keep track of their memory and free it at the right time, so the user + * doesn't need to worry about it (really). + * + */ + +// Include header files for each block used in flowgraph +#include <gr_top_block.h> +#include <gr_sig_source_f.h> +#include <gr_audio_sink.h> + +int main(int argc, char **argv) +{ + int rate = 48000; // Audio card sample rate + float ampl = 0.1; // Don't exceed 0.5 or clipping will occur + + // Construct a top block that will contain flowgraph blocks. Alternatively, + // one may create a derived class from gr_top_block and hold instantiated blocks + // as member data for later manipulation. + gr_top_block_sptr tb = gr_make_top_block("dial_tone"); + + // Construct a real-valued signal source for each tone, at given sample rate + gr_sig_source_f_sptr src0 = gr_make_sig_source_f(rate, GR_SIN_WAVE, 350, ampl); + gr_sig_source_f_sptr src1 = gr_make_sig_source_f(rate, GR_SIN_WAVE, 440, ampl); + + // Construct an audio sink to accept audio tones + audio_sink::sptr sink = audio_make_sink(rate); + + // Connect output #0 of src0 to input #0 of sink (left channel) + tb->connect(src0, 0, sink, 0); + + // Connect output #0 of src1 to input #1 of sink (right channel) + tb->connect(src1, 0, sink, 1); + + // Tell GNU Radio runtime to start flowgraph threads; the foreground thread + // will block until either flowgraph exits (this example doesn't) or the + // application receives SIGINT (e.g., user hits CTRL-C). + // + // Real applications may use tb->start() which returns, allowing the foreground + // thread to proceed, then later use tb->stop(), followed by tb->wait(), to cleanup + // GNU Radio before exiting. + tb->run(); + + // Exit normally. + return 0; +} diff --git a/gnuradio-examples/c++/dial_tone/README b/gnuradio-examples/c++/dial_tone/README deleted file mode 100644 index 6d5ed5059..000000000 --- a/gnuradio-examples/c++/dial_tone/README +++ /dev/null @@ -1,16 +0,0 @@ -This example requires that gr-audio-alsa be built in the main tree in order -to compile successfully. It is not built automatically. - -To build this example, you must make two modifications to the build system: - -1) Add the following line inside config/grc_gnuradio_examples.m4: - - gnuradio-examples/c++/dial_tone/Makefile - - ...to the list of Makefiles already in there. - -2) In gnuradio-examples/c++/Makefile.am, uncomment the SUBDIRS line - -# SUBDIRS = dial_tone - -Then, from the top-level directory, re-run ./bootstrap and ./configure.
\ No newline at end of file diff --git a/gr-audio-alsa/.gitignore b/gr-audio-alsa/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-alsa/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-alsa/build-stamp b/gr-audio-alsa/build-stamp deleted file mode 100644 index e69de29bb..000000000 --- a/gr-audio-alsa/build-stamp +++ /dev/null diff --git a/gr-audio-alsa/gnuradio-audio-alsa.pc.in b/gr-audio-alsa/gnuradio-audio-alsa.pc.in deleted file mode 100644 index d5147e6af..000000000 --- a/gr-audio-alsa/gnuradio-audio-alsa.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-audio-alsa -Description: The GNU Radio block for the ALSA sound system -Requires: gnuradio-core alsa -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-alsa -Cflags: -I${includedir} diff --git a/gr-audio-alsa/src/.gitignore b/gr-audio-alsa/src/.gitignore deleted file mode 100644 index 8de8fe39c..000000000 --- a/gr-audio-alsa/src/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp.py -/usrp.cc -/audio_oss.cc -/audio_oss.py -/audio_alsa.py -/audio_alsa.cc -/run_tests -/run_guile_tests -/*.pyc -/gnuradio -/guile -/python diff --git a/gr-audio-alsa/src/Makefile.am b/gr-audio-alsa/src/Makefile.am deleted file mode 100644 index 330158aa5..000000000 --- a/gr-audio-alsa/src/Makefile.am +++ /dev/null @@ -1,88 +0,0 @@ -# -# Copyright 2004,2008,2009,2010 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. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in run_guile_tests.in -DISTCLEANFILES += run_tests run_guile_tests - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_alsa_sink.h \ - audio_alsa_source.h - -noinst_HEADERS = \ - gri_alsa.h - -noinst_PYTHON = \ - qa_audio_alsa.py - -noinst_GUILE = \ - audio_alsa.test - - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -# ------------------------------------------------------------------------ -# ALSA C++ library, including OS interface, sink, and source - -lib_LTLIBRARIES = libgnuradio-audio-alsa.la - -libgnuradio_audio_alsa_la_SOURCES = \ - audio_alsa_sink.cc \ - audio_alsa_source.cc \ - gri_alsa.cc - -libgnuradio_audio_alsa_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(ALSA_LIBS) - -libgnuradio_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - - -# ------------------------------------------------------------------------ -# SWIG generated bindings - -TOP_SWIG_IFILES = \ - audio_alsa.i - -# Install so that they end up available as: -# import gnuradio.audio_alsa -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_alsa_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_alsa_la_swig_libadd = \ - libgnuradio-audio-alsa.la - -if PYTHON -TESTS += run_tests -endif - -if GUILE -TESTS += run_guile_tests -endif - - diff --git a/gr-audio-alsa/src/audio_alsa.i b/gr-audio-alsa/src/audio_alsa.i deleted file mode 100644 index 215acf33d..000000000 --- a/gr-audio-alsa/src/audio_alsa.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006,2009 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. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_alsa_sink.h" -#include "audio_alsa_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_alsa,source) - -audio_alsa_source_sptr -audio_alsa_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_alsa_source : public gr_sync_block { - - protected: - audio_alsa_source (int sampling_rate, - const std::string device_name, - bool ok_to_block = true - ) throw (std::runtime_error); - - public: - ~audio_alsa_source (); - - bool start(); - bool stop(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_alsa,sink) - -audio_alsa_sink_sptr -audio_alsa_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_alsa_sink : public gr_sync_block { - - protected: - audio_alsa_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_alsa_sink (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_alsa" "scm_init_gnuradio_audio_alsa_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-alsa/src/audio_alsa.test b/gr-audio-alsa/src/audio_alsa.test deleted file mode 100644 index 7997b9283..000000000 --- a/gr-audio-alsa/src/audio_alsa.test +++ /dev/null @@ -1,37 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; Copyright 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. -;;; See also the very end of the file, where the test-equal, test-eqv -;;; and test-eq macros are defined. - -(define-module (test-module) - #:use-module (oop goops) - #:use-module (gnuradio core) - #:use-module (gnuradio test-suite lib) - #:duplicates (merge-generics replace check)) - -;;; Just see if we can import the module... -;;; They may not have ALSA drivers, etc. - -(use-modules (gnuradio audio_alsa)) diff --git a/gr-audio-alsa/src/qa_audio_alsa.py b/gr-audio-alsa/src/qa_audio_alsa.py deleted file mode 100755 index 52dbfdc7a..000000000 --- a/gr-audio-alsa/src/qa_audio_alsa.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007,2010 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. -# - -from gnuradio import gr, gr_unittest -import audio_alsa - -class test_audio_alsa (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have ALSA drivers, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.run(test_audio_alsa, "test_audio_alsa.xml") diff --git a/gr-audio-alsa/src/run_guile_tests.in b/gr-audio-alsa/src/run_guile_tests.in deleted file mode 100644 index 5d08b0dd5..000000000 --- a/gr-audio-alsa/src/run_guile_tests.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -. @top_builddir@/setup_guile_test_env - -# 1st argument is absolute path to hand coded guile source directory -# 2nd argument is absolute path to component C++ shared library build directory -# 3nd argument is absolute path to component SWIG build directory - -add_local_paths \ - @srcdir@ \ - @abs_builddir@ \ - @abs_builddir@ - -@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@ diff --git a/gr-audio-alsa/src/run_tests.in b/gr-audio-alsa/src/run_tests.in deleted file mode 100644 index fd3963068..000000000 --- a/gr-audio-alsa/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-alsa \ - @abs_top_builddir@/gr-audio-alsa \ - @srcdir@ diff --git a/gr-audio-jack/.gitignore b/gr-audio-jack/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-jack/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-jack/gnuradio-audio-jack.pc.in b/gr-audio-jack/gnuradio-audio-jack.pc.in deleted file mode 100644 index 8fb4a2e0d..000000000 --- a/gr-audio-jack/gnuradio-audio-jack.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-audio-jack -Description: GNU Radio blocks for the JACK sound system -Requires: gnuradio-core jack -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-jack -Cflags: -I${includedir} diff --git a/gr-audio-jack/src/.gitignore b/gr-audio-jack/src/.gitignore deleted file mode 100644 index 347796beb..000000000 --- a/gr-audio-jack/src/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/audio_jack.cc -/audio_jack.py -/run_tests -/gnuradio -/guile -/python diff --git a/gr-audio-jack/src/Makefile.am b/gr-audio-jack/src/Makefile.am deleted file mode 100644 index 9a0c8b9be..000000000 --- a/gr-audio-jack/src/Makefile.am +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright 2005,2008,2009,2010 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. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_jack_sink.h \ - audio_jack_source.h - -noinst_HEADERS = \ - gri_jack.h - -lib_LTLIBRARIES = libgnuradio-audio-jack.la - -libgnuradio_audio_jack_la_SOURCES = \ - audio_jack_sink.cc \ - audio_jack_source.cc \ - gri_jack.cc - -libgnuradio_audio_jack_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(JACK_LIBS) - -libgnuradio_audio_jack_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - -noinst_PYTHON = \ - qa_jack.py - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -################################### -# SWIG interfaces and libraries - -TOP_SWIG_IFILES = \ - audio_jack.i - -# Install so that they end up available as: -# import gnuradio.audio_jack -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_jack_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_jack_la_swig_libadd = \ - libgnuradio-audio-jack.la - - -if PYTHON -TESTS += run_tests -endif diff --git a/gr-audio-jack/src/Makefile.swig.gen b/gr-audio-jack/src/Makefile.swig.gen deleted file mode 100644 index 9ca8140d4..000000000 --- a/gr-audio-jack/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 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. -# - -# Makefile.swig.gen for audio_jack.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_jack -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_jack -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_jack_pythondir_category ?= gnuradio/audio_jack -audio_jack_pylibdir_category ?= $(audio_jack_pythondir_category) -audio_jack_pythondir = $(pythondir)/$(audio_jack_pythondir_category) -audio_jack_pylibdir = $(pyexecdir)/$(audio_jack_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_jack_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_jack -# FIXME: determince whether these should be installed with gnuradio. -audio_jack_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_jack_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_jack_swiginclude_HEADERS = \ - audio_jack.i \ - $(audio_jack_swiginclude_headers) - -if PYTHON -audio_jack_pylib_LTLIBRARIES = \ - _audio_jack.la - -_audio_jack_la_SOURCES = \ - python/audio_jack.cc \ - $(audio_jack_la_swig_sources) - -audio_jack_python_PYTHON = \ - audio_jack.py \ - $(audio_jack_python) - -_audio_jack_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_jack_la_swig_libadd) - -_audio_jack_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_jack_la_swig_ldflags) - -_audio_jack_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_jack_la_swig_cxxflags) - -python/audio_jack.cc: audio_jack.py -audio_jack.py: audio_jack.i - -# Include the python dependencies for this file --include python/audio_jack.d - -endif # end of if python - -if GUILE - -audio_jack_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_jack.la -libguile_gnuradio_audio_jack_la_SOURCES = \ - guile/audio_jack.cc \ - $(audio_jack_la_swig_sources) -nobase_audio_jack_scm_DATA = \ - gnuradio/audio_jack.scm \ - gnuradio/audio_jack-primitive.scm -libguile_gnuradio_audio_jack_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_jack_la_swig_libadd) -libguile_gnuradio_audio_jack_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_jack_la_swig_ldflags) -libguile_gnuradio_audio_jack_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_jack_la_swig_cxxflags) - -guile/audio_jack.cc: gnuradio/audio_jack.scm -gnuradio/audio_jack.scm: audio_jack.i -gnuradio/audio_jack-primitive.scm: gnuradio/audio_jack.scm - -# Include the guile dependencies for this file --include guile/audio_jack.d - -endif # end of GUILE - - diff --git a/gr-audio-jack/src/audio_jack.i b/gr-audio-jack/src/audio_jack.i deleted file mode 100644 index 67747cb16..000000000 --- a/gr-audio-jack/src/audio_jack.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2009 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. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_jack_sink.h" -#include "audio_jack_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_jack,source) - -audio_jack_source_sptr -audio_jack_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_jack_source : public gr_sync_block { - - protected: - audio_jack_source (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_jack_source (); - - bool start(); - bool stop(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_jack,sink) - -audio_jack_sink_sptr -audio_jack_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_jack_sink : public gr_sync_block { - - protected: - audio_jack_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_jack_sink (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_jack" "scm_init_gnuradio_audio_jack_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-jack/src/qa_jack.py b/gr-audio-jack/src/qa_jack.py deleted file mode 100755 index ad6bee27b..000000000 --- a/gr-audio-jack/src/qa_jack.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2010 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. -# - -from gnuradio import gr, gr_unittest -import audio_jack - -class test_audio_jack (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have JACK library, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.run(test_audio_jack, "test_audio_jack.xml") diff --git a/gr-audio-jack/src/run_tests.in b/gr-audio-jack/src/run_tests.in deleted file mode 100644 index 77af85641..000000000 --- a/gr-audio-jack/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-jack \ - @abs_top_builddir@/gr-audio-jack \ - @srcdir@ diff --git a/gr-audio-oss/.gitignore b/gr-audio-oss/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-oss/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-oss/src/.gitignore b/gr-audio-oss/src/.gitignore deleted file mode 100644 index c082252f9..000000000 --- a/gr-audio-oss/src/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp.py -/usrp.cc -/audio_oss.cc -/audio_oss.py -/run_tests -/*.pyc -/gnuradio -/guile -/python diff --git a/gr-audio-oss/src/Makefile.swig.gen b/gr-audio-oss/src/Makefile.swig.gen deleted file mode 100644 index ecb03acce..000000000 --- a/gr-audio-oss/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 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. -# - -# Makefile.swig.gen for audio_oss.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_oss -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_oss -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_oss_pythondir_category ?= gnuradio/audio_oss -audio_oss_pylibdir_category ?= $(audio_oss_pythondir_category) -audio_oss_pythondir = $(pythondir)/$(audio_oss_pythondir_category) -audio_oss_pylibdir = $(pyexecdir)/$(audio_oss_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_oss_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_oss -# FIXME: determince whether these should be installed with gnuradio. -audio_oss_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_oss_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_oss_swiginclude_HEADERS = \ - audio_oss.i \ - $(audio_oss_swiginclude_headers) - -if PYTHON -audio_oss_pylib_LTLIBRARIES = \ - _audio_oss.la - -_audio_oss_la_SOURCES = \ - python/audio_oss.cc \ - $(audio_oss_la_swig_sources) - -audio_oss_python_PYTHON = \ - audio_oss.py \ - $(audio_oss_python) - -_audio_oss_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_oss_la_swig_libadd) - -_audio_oss_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_oss_la_swig_ldflags) - -_audio_oss_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_oss_la_swig_cxxflags) - -python/audio_oss.cc: audio_oss.py -audio_oss.py: audio_oss.i - -# Include the python dependencies for this file --include python/audio_oss.d - -endif # end of if python - -if GUILE - -audio_oss_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_oss.la -libguile_gnuradio_audio_oss_la_SOURCES = \ - guile/audio_oss.cc \ - $(audio_oss_la_swig_sources) -nobase_audio_oss_scm_DATA = \ - gnuradio/audio_oss.scm \ - gnuradio/audio_oss-primitive.scm -libguile_gnuradio_audio_oss_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_oss_la_swig_libadd) -libguile_gnuradio_audio_oss_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_oss_la_swig_ldflags) -libguile_gnuradio_audio_oss_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_oss_la_swig_cxxflags) - -guile/audio_oss.cc: gnuradio/audio_oss.scm -gnuradio/audio_oss.scm: audio_oss.i -gnuradio/audio_oss-primitive.scm: gnuradio/audio_oss.scm - -# Include the guile dependencies for this file --include guile/audio_oss.d - -endif # end of GUILE - - diff --git a/gr-audio-oss/src/audio_oss.i b/gr-audio-oss/src/audio_oss.i deleted file mode 100644 index 2150cba9f..000000000 --- a/gr-audio-oss/src/audio_oss.i +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 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. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_oss_sink.h" -#include "audio_oss_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_oss,sink) - -audio_oss_sink_sptr -audio_oss_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - - -class audio_oss_sink : public gr_sync_block { - protected: - audio_oss_sink (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - - public: - ~audio_oss_sink (); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_oss,source) - -audio_oss_source_sptr -audio_oss_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_oss_source : public gr_sync_block { - protected: - audio_oss_source (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - - public: - ~audio_oss_source (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_oss" "scm_init_gnuradio_audio_oss_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-oss/src/qa_oss.py b/gr-audio-oss/src/qa_oss.py deleted file mode 100755 index 365dabc25..000000000 --- a/gr-audio-oss/src/qa_oss.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007,2010 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. -# - -from gnuradio import gr, gr_unittest -import audio_oss - -class test_audio_oss (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have OSS drivers, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.run(test_audio_oss, "test_audio_oss.xml") diff --git a/gr-audio-oss/src/run_tests.in b/gr-audio-oss/src/run_tests.in deleted file mode 100644 index b1a64c212..000000000 --- a/gr-audio-oss/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-oss \ - @abs_top_builddir@/gr-audio-oss \ - @srcdir@ diff --git a/gr-audio-osx/.gitignore b/gr-audio-osx/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-osx/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-osx/README_OSX b/gr-audio-osx/README_OSX deleted file mode 100644 index 2a98e96bb..000000000 --- a/gr-audio-osx/README_OSX +++ /dev/null @@ -1,61 +0,0 @@ -Michael Dickens -2006-Apr-30 - -0) This module should compile and install in the same manner as the -other GNURadio modules (e.g. gnuradio-core), with the possible -exception that GNU libtool 1.5.20 or newer should be installed and -used (if not first in the path) via "make LIBTOOL=/..." and so forth. -Version 1.5.10 has failed making, and while picking version 1.5.20 is -somewhat arbitrary, the newer version compiles and installs easily -under OSX. - -1) This module should be automatically loaded by the Python command -"from gr import audio". The audio import script will automatically -select gr.audio_osx if it is available (though it will try to import -ALSA first, then OSS, then OSX, and finally WINDOWS audio modules, in -that order). If that import command doesn't work, try reinstalling -gnuradio-core from scratch followed by gr-audio-osx. - -2) Instantiation arguments for either source or sink are: - -* sample_rate : integer : default == 44100 - OSX converts the integer sample rate to a double internally; it - would be nice to have this input as a double natively, but that - doesn't work with other audio devices. - -* device_name : string : default == "2" - For OSX, the device name should be an integer string. This value is - the maximum number of channels to allocate (for input or output). - In the "source" case (input), the actual number of channels will be - whatever is available on that current system input device. In the - "sink" case (output), OSX will convert the provided channels into - whatever format is required by the current system output device. - For example, "3" would try to setup for 3 input or output channels. - NOTE that this is a very different use than that for other audio - modules (though they can interpret the number of channels from this - argument). - -* do_block : boolean : default == true - If the data transfer buffer between OSX internals and GNURadio gets - full, either block (true) or overwrite (false) depending on this - variable. - -The following are currently non-standard arguments: - -* channel_config : integer : default == -1 - An enum (internally) describing the channel configuration. Not - currently used, but rather reserved for future expansion. - -* max_sample_count : integer : default == -1 - The maximum number of samples to buffer between OSX internals and - GNURadio. The value -1 is mapped to 1 second's worth of data. - -3) When the buffer is full and do_block is false and new data comes -in, the oldest data will be overwritten. The source will print out -"iX" each time this happens; the sink will print out "oX". - -4) In the "src" directory is a python script "test_audio_loop" which -connects the default audio input device to the default audio output -device. This script is very useful in testing that audio is correctly -installed and both the source and sink are functional. This script is -not run by "make check". diff --git a/gr-audio-osx/TODO b/gr-audio-osx/TODO deleted file mode 100644 index e36ed2b25..000000000 --- a/gr-audio-osx/TODO +++ /dev/null @@ -1,51 +0,0 @@ -List as of 2006-Apr-22, by Michael Dickens, primary author - -* Change buffering to use gr_buffer's and necessary related classes. - Currently uses a circular_buffer I wrote myself (in - ./src/circular_buffer.h ), which hides the "circular" part from the - user but otherwise is very fast as well as thread safe. - -* A current limitation of this implementation is that the user cannot - dynamically switch audio devices (input or output) during playback - and use the new device without stopping the current executing GR and - restarting the process. I would like to figure out how to get a - CoreAudio "listener" for when the default hardware input / output - device changes (e.g. when switched by the user in the "Sound" system - preference pane). The code in ./src/audio-osx-source.cc creates - listeners for the AudioUnit being used as well as the Hardware - device, but these for some reason don't do the trick. It's possible - that the Python framework doesn't allow for one to do this. - -* In both the source and sink, move the code which defines the "Audio - Stream Basic Description" (ASBD) to a routine to do this as needed - as start-up as well as in a callback ("listener") if the default - device changes. - -* Tweak the mutex (d_internal) to only where it is truly needed - (around class-specific variables used across all threads) in order - to improve performance. Currently the mutex is used at the - start and end of any function requiring access to the class variables. - -* Change the instantiation arguments ... once those arguments are - finalized. Right now gr.audio.source () takes the sample rate (int - - should be double), the device name (std::string), a boolean for - blocking or not, and 2 completely non-standard ones for channel - configuration and the maximum sample count to buffer. These are - reasonable for OSX, but might not be for other OSs. Nothing to do - right now but wait and discuss. - -* Once the previous issue has been resolved, then the current method - of determining the number of channels needs to be updated. - Currently the "device_name" for OSX should contain a numeric string - for the maximum number of channels to use (e.g. "3" means 3 - channels, generally mapped to 2 channel stereo by OSX). The - "device_name" is generally input via "-O" in Python scripts, so "-O - 3" would allow for 3 incoming output channels (or fewer). In theory - the "channel_config" argument would make more sense for determining - channel usage. Example config strings might be "2.1" for stereo w/ - subwoofer (3 channels), "5.1" or "6.1" for various surround w/ - subwoofer (6 & 7 channels, respectively). OSX can handle all sorts - of channel configurations, but the names for these will be different - than those use for OSS or ALMA or Windows ... thus the need for a - common naming scheme for all cared-about configurations, possibly - with options for other OS-specific options. diff --git a/gr-audio-osx/src/.gitignore b/gr-audio-osx/src/.gitignore deleted file mode 100644 index 7e84b05b3..000000000 --- a/gr-audio-osx/src/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp.py -/usrp.cc -/audio_osx.cc -/audio_osx.py -/run_tests -/gnuradio -/guile -/python diff --git a/gr-audio-osx/src/Makefile.am b/gr-audio-osx/src/Makefile.am deleted file mode 100644 index fce31c9d2..000000000 --- a/gr-audio-osx/src/Makefile.am +++ /dev/null @@ -1,80 +0,0 @@ -# -# Copyright 2006,2008,2009,2010 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. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_osx_sink.h \ - audio_osx_source.h - -noinst_HEADERS = \ - audio_osx.h \ - circular_buffer.h - -noinst_PYTHON = \ - qa_osx.py \ - test_audio_loop.py - -lib_LTLIBRARIES = libgnuradio-audio-osx.la - -libgnuradio_audio_osx_la_SOURCES = \ - audio_osx_sink.cc \ - audio_osx_source.cc - -libgnuradio_audio_osx_la_LIBADD = \ - $(GNURADIO_CORE_LA) - -libgnuradio_audio_osx_la_LDFLAGS = \ - -framework AudioUnit \ - -framework CoreAudio \ - -framework AudioToolbox \ - $(NO_UNDEFINED) \ - $(LTVERSIONFLAGS) - -################################### -# SWIG interfaces and libraries - -TOP_SWIG_IFILES = \ - audio_osx.i - -# Install so that they end up available as: -# import gnuradio.audio_osx -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_osx_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_osx_la_swig_libadd = \ - libgnuradio-audio-osx.la - - -if PYTHON -TESTS += run_tests -endif
\ No newline at end of file diff --git a/gr-audio-osx/src/Makefile.swig.gen b/gr-audio-osx/src/Makefile.swig.gen deleted file mode 100644 index 532433083..000000000 --- a/gr-audio-osx/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 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. -# - -# Makefile.swig.gen for audio_osx.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_osx -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_osx -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_osx_pythondir_category ?= gnuradio/audio_osx -audio_osx_pylibdir_category ?= $(audio_osx_pythondir_category) -audio_osx_pythondir = $(pythondir)/$(audio_osx_pythondir_category) -audio_osx_pylibdir = $(pyexecdir)/$(audio_osx_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_osx_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_osx -# FIXME: determince whether these should be installed with gnuradio. -audio_osx_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_osx_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_osx_swiginclude_HEADERS = \ - audio_osx.i \ - $(audio_osx_swiginclude_headers) - -if PYTHON -audio_osx_pylib_LTLIBRARIES = \ - _audio_osx.la - -_audio_osx_la_SOURCES = \ - python/audio_osx.cc \ - $(audio_osx_la_swig_sources) - -audio_osx_python_PYTHON = \ - audio_osx.py \ - $(audio_osx_python) - -_audio_osx_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_osx_la_swig_libadd) - -_audio_osx_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_osx_la_swig_ldflags) - -_audio_osx_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_osx_la_swig_cxxflags) - -python/audio_osx.cc: audio_osx.py -audio_osx.py: audio_osx.i - -# Include the python dependencies for this file --include python/audio_osx.d - -endif # end of if python - -if GUILE - -audio_osx_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_osx.la -libguile_gnuradio_audio_osx_la_SOURCES = \ - guile/audio_osx.cc \ - $(audio_osx_la_swig_sources) -nobase_audio_osx_scm_DATA = \ - gnuradio/audio_osx.scm \ - gnuradio/audio_osx-primitive.scm -libguile_gnuradio_audio_osx_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_osx_la_swig_libadd) -libguile_gnuradio_audio_osx_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_osx_la_swig_ldflags) -libguile_gnuradio_audio_osx_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_osx_la_swig_cxxflags) - -guile/audio_osx.cc: gnuradio/audio_osx.scm -gnuradio/audio_osx.scm: audio_osx.i -gnuradio/audio_osx-primitive.scm: gnuradio/audio_osx.scm - -# Include the guile dependencies for this file --include guile/audio_osx.d - -endif # end of GUILE - - diff --git a/gr-audio-osx/src/audio_osx.i b/gr-audio-osx/src/audio_osx.i deleted file mode 100644 index a51e9bae0..000000000 --- a/gr-audio-osx/src/audio_osx.i +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 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. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_osx_sink.h" -#include "audio_osx_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_osx,sink) - -audio_osx_sink_sptr -audio_osx_make_sink (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1 - ) throw (std::runtime_error); - -class audio_osx_sink : public gr_sync_block { - protected: - audio_osx_sink (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1); - - public: - ~audio_osx_sink (); - - bool start (); - bool stop (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_osx,source) - -audio_osx_source_sptr -audio_osx_make_source (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1 - ) throw (std::runtime_error); - -class audio_osx_source : public gr_sync_block { - protected: - audio_osx_source (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1); - - public: - ~audio_osx_source (); - - bool start (); - bool stop (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_osx" "scm_init_gnuradio_audio_osx_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-osx/src/circular_buffer.h b/gr-audio-osx/src/circular_buffer.h deleted file mode 100644 index 48758bf87..000000000 --- a/gr-audio-osx/src/circular_buffer.h +++ /dev/null @@ -1,315 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009,2010 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 _CIRCULAR_BUFFER_H_ -#define _CIRCULAR_BUFFER_H_ - -#include <gruel/thread.h> -#include <iostream> -#include <stdexcept> - -#ifndef DO_DEBUG -#define DO_DEBUG 0 -#endif - -#if DO_DEBUG -#define DEBUG(X) do{X} while(0); -#else -#define DEBUG(X) do{} while(0); -#endif - -template <class T> -class circular_buffer -{ -private: -// the buffer to use - T* d_buffer; - -// the following are in Items (type T) - size_t d_bufLen_I, d_readNdx_I, d_writeNdx_I; - size_t d_n_avail_write_I, d_n_avail_read_I; - -// stuff to control access to class internals - gruel::mutex* d_internal; - gruel::condition_variable* d_readBlock; - gruel::condition_variable* d_writeBlock; - -// booleans to decide how to control reading, writing, and aborting - bool d_doWriteBlock, d_doFullRead, d_doAbort; - - void delete_mutex_cond () { - if (d_internal) { - delete d_internal; - d_internal = NULL; - } - if (d_readBlock) { - delete d_readBlock; - d_readBlock = NULL; - } - if (d_writeBlock) { - delete d_writeBlock; - d_writeBlock = NULL; - } - }; - -public: - circular_buffer (size_t bufLen_I, - bool doWriteBlock = true, bool doFullRead = false) { - if (bufLen_I == 0) - throw std::runtime_error ("circular_buffer(): " - "Number of items to buffer must be > 0.\n"); - d_bufLen_I = bufLen_I; - d_buffer = (T*) new T[d_bufLen_I]; - d_doWriteBlock = doWriteBlock; - d_doFullRead = doFullRead; - d_internal = NULL; - d_readBlock = d_writeBlock = NULL; - reset (); - DEBUG (std::cerr << "c_b(): buf len (items) = " << d_bufLen_ - << ", doWriteBlock = " << (d_doWriteBlock ? "true" : "false") - << ", doFullRead = " << (d_doFullRead ? "true" : "false") - << std::endl); - }; - - ~circular_buffer () { - delete_mutex_cond (); - delete [] d_buffer; - }; - - inline size_t n_avail_write_items () { - gruel::scoped_lock l (*d_internal); - size_t retVal = d_n_avail_write_I; - return (retVal); - }; - - inline size_t n_avail_read_items () { - gruel::scoped_lock l (*d_internal); - size_t retVal = d_n_avail_read_I; - return (retVal); - }; - - inline size_t buffer_length_items () {return (d_bufLen_I);}; - inline bool do_write_block () {return (d_doWriteBlock);}; - inline bool do_full_read () {return (d_doFullRead);}; - - void reset () { - d_doAbort = false; - bzero (d_buffer, d_bufLen_I * sizeof (T)); - d_readNdx_I = d_writeNdx_I = d_n_avail_read_I = 0; - d_n_avail_write_I = d_bufLen_I; - delete_mutex_cond (); - // create a mutex to handle contention of shared resources; - // any routine needed access to shared resources uses lock() - // before doing anything, then unlock() when finished. - d_internal = new gruel::mutex (); - // link the internal mutex to the read and write conditions; - // when wait() is called, the internal mutex will automatically - // be unlock()'ed. Upon return (from a notify_one() to the condition), - // the internal mutex will be lock()'ed. - d_readBlock = new gruel::condition_variable (); - d_writeBlock = new gruel::condition_variable (); - }; - -/* - * enqueue: add the given buffer of item-length to the queue, - * first-in-first-out (FIFO). - * - * inputs: - * buf: a pointer to the buffer holding the data - * - * bufLen_I: the buffer length in items (of the instantiated type) - * - * returns: - * -1: on overflow (write is not blocking, and data is being - * written faster than it is being read) - * 0: if nothing to do (0 length buffer) - * 1: if success - * 2: in the process of aborting, do doing nothing - * - * will throw runtime errors if inputs are improper: - * buffer pointer is NULL - * buffer length is larger than the instantiated buffer length - */ - - int enqueue (T* buf, size_t bufLen_I) { - DEBUG (std::cerr << "enqueue: buf = " << (void*) buf - << ", bufLen = " << bufLen_I - << ", #av_wr = " << d_n_avail_write_I - << ", #av_rd = " << d_n_avail_read_I << std::endl); - if (bufLen_I > d_bufLen_I) { - std::cerr << "ERROR: cannot add buffer longer (" - << bufLen_I << ") than instantiated length (" - << d_bufLen_I << ")." << std::endl; - throw std::runtime_error ("circular_buffer::enqueue()"); - } - - if (bufLen_I == 0) - return (0); - if (!buf) - throw std::runtime_error ("circular_buffer::enqueue(): " - "input buffer is NULL.\n"); - gruel::scoped_lock l (*d_internal); - if (d_doAbort) { - return (2); - } - // set the return value to 1: success; change if needed - int retval = 1; - if (bufLen_I > d_n_avail_write_I) { - if (d_doWriteBlock) { - while (bufLen_I > d_n_avail_write_I) { - DEBUG (std::cerr << "enqueue: #len > #a, waiting." << std::endl); - // wait; will automatically unlock() the internal mutex via - // the scoped lock - d_writeBlock->wait (l); - // and auto re-lock() it here. - if (d_doAbort) { - DEBUG (std::cerr << "enqueue: #len > #a, aborting." << std::endl); - return (2); - } - DEBUG (std::cerr << "enqueue: #len > #a, done waiting." << std::endl); - } - } else { - d_n_avail_read_I = d_bufLen_I - bufLen_I; - d_n_avail_write_I = bufLen_I; - DEBUG (std::cerr << "circular_buffer::enqueue: overflow" << std::endl); - retval = -1; - } - } - size_t n_now_I = d_bufLen_I - d_writeNdx_I, n_start_I = 0; - if (n_now_I > bufLen_I) - n_now_I = bufLen_I; - else if (n_now_I < bufLen_I) - n_start_I = bufLen_I - n_now_I; - bcopy (buf, &(d_buffer[d_writeNdx_I]), n_now_I * sizeof (T)); - if (n_start_I) { - bcopy (&(buf[n_now_I]), d_buffer, n_start_I * sizeof (T)); - d_writeNdx_I = n_start_I; - } else - d_writeNdx_I += n_now_I; - d_n_avail_read_I += bufLen_I; - d_n_avail_write_I -= bufLen_I; - d_readBlock->notify_one (); - return (retval); - }; - -/* - * dequeue: removes from the queue the number of items requested, or - * available, into the given buffer on a FIFO basis. - * - * inputs: - * buf: a pointer to the buffer into which to copy the data - * - * bufLen_I: pointer to the number of items to remove in items - * (of the instantiated type) - * - * returns: - * 0: if nothing to do (0 length buffer) - * 1: if success - * 2: in the process of aborting, do doing nothing - * - * will throw runtime errors if inputs are improper: - * buffer pointer is NULL - * buffer length pointer is NULL - * buffer length is larger than the instantiated buffer length - */ - - int dequeue (T* buf, size_t* bufLen_I) { - DEBUG (std::cerr << "dequeue: buf = " << ((void*) buf) - << ", *bufLen = " << (*bufLen_I) - << ", #av_wr = " << d_n_avail_write_I - << ", #av_rd = " << d_n_avail_read_I << std::endl); - if (!bufLen_I) - throw std::runtime_error ("circular_buffer::dequeue(): " - "input bufLen pointer is NULL.\n"); - if (!buf) - throw std::runtime_error ("circular_buffer::dequeue(): " - "input buffer pointer is NULL.\n"); - size_t l_bufLen_I = *bufLen_I; - if (l_bufLen_I == 0) - return (0); - if (l_bufLen_I > d_bufLen_I) { - std::cerr << "ERROR: cannot remove buffer longer (" - << l_bufLen_I << ") than instantiated length (" - << d_bufLen_I << ")." << std::endl; - throw std::runtime_error ("circular_buffer::dequeue()"); - } - - gruel::scoped_lock l (*d_internal); - if (d_doAbort) { - return (2); - } - if (d_doFullRead) { - while (d_n_avail_read_I < l_bufLen_I) { - DEBUG (std::cerr << "dequeue: #a < #len, waiting." << std::endl); - // wait; will automatically unlock() the internal mutex via - // the scoped lock - d_readBlock->wait (l); - // and re-lock() it here. - if (d_doAbort) { - DEBUG (std::cerr << "dequeue: #a < #len, aborting." << std::endl); - return (2); - } - DEBUG (std::cerr << "dequeue: #a < #len, done waiting." << std::endl); - } - } else { - while (d_n_avail_read_I == 0) { - DEBUG (std::cerr << "dequeue: #a == 0, waiting." << std::endl); - // wait; will automatically unlock() the internal mutex via - // the scoped lock - d_readBlock->wait (l); - // and re-lock() it here. - if (d_doAbort) { - DEBUG (std::cerr << "dequeue: #a == 0, aborting." << std::endl); - return (2); - } - DEBUG (std::cerr << "dequeue: #a == 0, done waiting." << std::endl); - } - } - if (l_bufLen_I > d_n_avail_read_I) - l_bufLen_I = d_n_avail_read_I; - size_t n_now_I = d_bufLen_I - d_readNdx_I, n_start_I = 0; - if (n_now_I > l_bufLen_I) - n_now_I = l_bufLen_I; - else if (n_now_I < l_bufLen_I) - n_start_I = l_bufLen_I - n_now_I; - bcopy (&(d_buffer[d_readNdx_I]), buf, n_now_I * sizeof (T)); - if (n_start_I) { - bcopy (d_buffer, &(buf[n_now_I]), n_start_I * sizeof (T)); - d_readNdx_I = n_start_I; - } else - d_readNdx_I += n_now_I; - *bufLen_I = l_bufLen_I; - d_n_avail_read_I -= l_bufLen_I; - d_n_avail_write_I += l_bufLen_I; - d_writeBlock->notify_one (); - return (1); - }; - - void abort () { - gruel::scoped_lock l (*d_internal); - d_doAbort = true; - d_writeBlock->notify_one (); - d_readBlock->notify_one (); - }; -}; - -#endif /* _CIRCULAR_BUFFER_H_ */ diff --git a/gr-audio-osx/src/qa_osx.py b/gr-audio-osx/src/qa_osx.py deleted file mode 100755 index 385aa0269..000000000 --- a/gr-audio-osx/src/qa_osx.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006,2007 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. -# - -from gnuradio import gr, gr_unittest -import audio_osx - -class qa_osx (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have OSX drivers, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.main () diff --git a/gr-audio-osx/src/run_tests.in b/gr-audio-osx/src/run_tests.in deleted file mode 100644 index d88c275e0..000000000 --- a/gr-audio-osx/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-osx \ - @abs_top_builddir@/gr-audio-osx \ - @srcdir@ diff --git a/gr-audio-osx/src/test_audio_loop.py b/gr-audio-osx/src/test_audio_loop.py deleted file mode 100755 index 662631dfb..000000000 --- a/gr-audio-osx/src/test_audio_loop.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006,2007 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. -# - -from gnuradio import gr -from gnuradio import audio -from gnuradio.eng_option import eng_option -from optparse import OptionParser - -class my_graph(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self) - - parser = OptionParser(option_class=eng_option) - parser.add_option("-O", "--audio-output", - type="string", - default="", - help="audio output device name. E.g., hw:0,0 or /dev/dsp") - parser.add_option("-I", "--audio-input", - type="string", - default="", - help="audio input device name. E.g., hw:0,0 or /dev/dsp") - parser.add_option("-r", "--sample-rate", - type="eng_float", - default=48000, - help="set sample rate to RATE (48000)") - (options, args) = parser.parse_args () - if len(args) != 0: - parser.print_help() - raise SystemExit, 1 - - sample_rate = int(options.sample_rate) - src = audio.source (sample_rate, options.audio_output) - dst = audio.sink (sample_rate, options.audio_output) - - max_chan = max (src.output_signature().max_streams(), - dst.output_signature().max_streams()) - - for i in range (max_chan): - self.connect ((src, i), (dst, i)) - -if __name__ == '__main__': - try: - my_graph().run() - except KeyboardInterrupt: - pass diff --git a/gr-audio-portaudio/.gitignore b/gr-audio-portaudio/.gitignore deleted file mode 100644 index 53edad32f..000000000 --- a/gr-audio-portaudio/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 -/stamp-h1.in -/stamp-h2.in diff --git a/gr-audio-portaudio/README b/gr-audio-portaudio/README deleted file mode 100644 index bd6fac643..000000000 --- a/gr-audio-portaudio/README +++ /dev/null @@ -1,99 +0,0 @@ -The instructions below are now obsolete. Please see: - -http://gnuradio.org/trac/wiki/PortAudioInstall - -====== -OBSOLETED - -These instructions are intended for Linux. On other systems you will have to -construct something compatible to build gr-audio-portaudio. - -In order to use portaudio with gnuradio you will need to download and install -a late version of portaudio. Please cd to a directory where the cvs command -below will be allowed to build the portaudio directory tree. - -cvs -d:pserver:anonymous@www.portaudio.com:/home/cvs co -r v19-devel portaudio - -This will make a directory portaudio unless you already have one. It will -check out the Portaudio API version 2 release 1.9. - -In the directory where this README is found, there is a patch file. Hopefully -this patch will not be needed for long. Portaudio is working with us to use -auto*, libtool, etc. The patch is autoconfiscate.patch. - -cd to the portaudio directory and run - -patch -p0 <autoconfiscate.patch - -this will modify the portaudio source tree to use standard tools and prepare -it for use with gnuradio. Now run - -chmod u+x bootstrap - -you may need to edit bootstrap and remove the 2.50 at the end of some of the -commands (on SUSE 10.0 for example). - -./bootstrap - -./configure --help - - -will reveal the options for configure that are available to you. If you do not -understand the options or wish to accept the defaults please just run - -./configure - -If you do not want the includes and libraries install in /usr/local (standard) -then enter the prefix arguments to ./configure. This document will assume you -are doing the standard installation and that will be into /usr/local. - -On Linux if you have the jack tool available from - -http://jackit.sourceforge.net - -the portaudio configure will enable the library to talk to jack. - -Now you are ready to make the portaudio library. - -make; sudo make install;sudo ldconfig (possibly /sbin/ldconfig). - -will make the code and install it into the prefix (/usr/local) selected and -will cache the configuration information for other programs to use for their -configuration options. - -Now you are ready to install gr-audio-portaudio. In the gr-build directory -you may run - -cvs co gr-audio-portaudio - -cd gr-audio-portaudio -../buildit - -will configure, make, and install the portaudio sink and source. - -In gnuradio-examples/python/audio please test by running - -./mono_tone_portaudio.py - - -If this runs you are likely in business but this chooses the default device -(typically /dev/dsp which is being run by alsa under oss emulation and on a -Mac it will choose coreaudio). - -./mono_tone_portaudio.py -O hw:0,0 - -chooses the default alsa device. - -./mono_tone_portaudio.py -O /dev/dsp - -will force the use of OSS and the default oss device. To run with jack, you -will probably enter the following command: - -./mono_tone_portaudio.py -O alsa_pcm - - -In the portaudio directory, you may list the devices visible to portaudio by -searching for and running the command - -pa_devs - diff --git a/gr-audio-portaudio/autoconfiscate.patch b/gr-audio-portaudio/autoconfiscate.patch deleted file mode 100755 index fd7b9c370..000000000 --- a/gr-audio-portaudio/autoconfiscate.patch +++ /dev/null @@ -1,1299 +0,0 @@ -Index: portaudio-2.0.pc.in -=================================================================== -RCS file: /home/cvs/portaudio/Attic/portaudio-2.0.pc.in,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 portaudio-2.0.pc.in ---- portaudio-2.0.pc.in 19 Mar 2006 13:02:36 -0000 1.1.2.1 -+++ portaudio-2.0.pc.in 19 Mar 2006 22:26:01 -0000 -@@ -9,4 +9,4 @@ Requires: - Version: 19 - - Libs: -L${libdir} -lportaudio @LIBS@ --Cflags: -I${includedir} @THREAD_CFLAGS@ -+Cflags: -I${includedir} @PTHREAD_CFLAGS@ -Index: pa_asio/iasiothiscallresolver.cpp -=================================================================== -RCS file: /home/cvs/portaudio/pa_asio/Attic/iasiothiscallresolver.cpp,v -retrieving revision 1.1.2.4 -diff -u -b -B -w -p -r1.1.2.4 iasiothiscallresolver.cpp ---- pa_asio/iasiothiscallresolver.cpp 10 Jul 2004 03:27:41 -0000 1.1.2.4 -+++ pa_asio/iasiothiscallresolver.cpp 19 Mar 2006 22:26:03 -0000 -@@ -152,6 +152,7 @@ - recent versions of the gcc assembler. - */ - -+#include <config.h> - - // We only need IASIOThiscallResolver at all if we are on Win32. For other - // platforms we simply bypass the IASIOThiscallResolver definition to allow us -Index: pa_asio/pa_asio.cpp -=================================================================== -RCS file: /home/cvs/portaudio/pa_asio/pa_asio.cpp,v -retrieving revision 1.7.2.68 -diff -u -b -B -w -p -r1.7.2.68 pa_asio.cpp ---- pa_asio/pa_asio.cpp 5 Dec 2005 04:55:28 -0000 1.7.2.68 -+++ pa_asio/pa_asio.cpp 19 Mar 2006 22:26:14 -0000 -@@ -106,7 +106,7 @@ - must be closed). - */ - -- -+#include <config.h> - - #include <stdio.h> - #include <assert.h> -Index: pa_common/pa_allocation.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_allocation.c,v -retrieving revision 1.1.2.6 -diff -u -b -B -w -p -r1.1.2.6 pa_allocation.c ---- pa_common/pa_allocation.c 20 Dec 2004 12:07:51 -0000 1.1.2.6 -+++ pa_common/pa_allocation.c 19 Mar 2006 22:26:15 -0000 -@@ -35,6 +35,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_allocation.h" - #include "pa_util.h" - -Index: pa_common/pa_converters.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_converters.c,v -retrieving revision 1.1.2.27 -diff -u -b -B -w -p -r1.1.2.27 pa_converters.c ---- pa_common/pa_converters.c 2 Nov 2005 12:14:07 -0000 1.1.2.27 -+++ pa_common/pa_converters.c 19 Mar 2006 22:26:23 -0000 -@@ -49,6 +49,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_converters.h" - #include "pa_dither.h" - #include "pa_endianness.h" -Index: pa_common/pa_cpuload.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_cpuload.c,v -retrieving revision 1.1.2.14 -diff -u -b -B -w -p -r1.1.2.14 pa_cpuload.c ---- pa_common/pa_cpuload.c 8 Jan 2004 22:01:12 -0000 1.1.2.14 -+++ pa_common/pa_cpuload.c 19 Mar 2006 22:26:24 -0000 -@@ -41,6 +41,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_cpuload.h" - - #include <assert.h> -Index: pa_common/pa_dither.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_dither.c,v -retrieving revision 1.1.2.6 -diff -u -b -B -w -p -r1.1.2.6 pa_dither.c ---- pa_common/pa_dither.c 28 May 2005 22:49:02 -0000 1.1.2.6 -+++ pa_common/pa_dither.c 19 Mar 2006 22:26:24 -0000 -@@ -34,6 +34,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_dither.h" - #include "pa_types.h" - -Index: pa_common/pa_front.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_front.c,v -retrieving revision 1.1.2.52 -diff -u -b -B -w -p -r1.1.2.52 pa_front.c ---- pa_common/pa_front.c 7 Dec 2005 20:10:34 -0000 1.1.2.52 -+++ pa_common/pa_front.c 19 Mar 2006 22:26:30 -0000 -@@ -89,6 +89,8 @@ enquire about status on the PortAudio ma - */ - - -+#include <config.h> -+ - #include <stdio.h> - #include <stdarg.h> - #include <memory.h> -Index: pa_common/pa_process.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_process.c,v -retrieving revision 1.1.2.51 -diff -u -b -B -w -p -r1.1.2.51 pa_process.c ---- pa_common/pa_process.c 27 Oct 2005 23:28:48 -0000 1.1.2.51 -+++ pa_common/pa_process.c 19 Mar 2006 22:26:35 -0000 -@@ -72,6 +72,8 @@ - */ - - -+#include <config.h> -+ - #include <assert.h> - #include <string.h> /* memset() */ - -Index: pa_common/pa_skeleton.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_skeleton.c,v -retrieving revision 1.1.2.39 -diff -u -b -B -w -p -r1.1.2.39 pa_skeleton.c ---- pa_common/pa_skeleton.c 26 Nov 2003 14:56:09 -0000 1.1.2.39 -+++ pa_common/pa_skeleton.c 19 Mar 2006 22:26:38 -0000 -@@ -40,6 +40,8 @@ - */ - - -+#include <config.h> -+ - #include <string.h> /* strlen() */ - - #include "pa_util.h" -Index: pa_common/pa_stream.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_stream.c,v -retrieving revision 1.1.2.12 -diff -u -b -B -w -p -r1.1.2.12 pa_stream.c ---- pa_common/pa_stream.c 20 Sep 2003 21:31:00 -0000 1.1.2.12 -+++ pa_common/pa_stream.c 19 Mar 2006 22:26:39 -0000 -@@ -36,6 +36,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_stream.h" - - -Index: pa_common/pa_trace.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/pa_trace.c,v -retrieving revision 1.1.1.1.2.4 -diff -u -b -B -w -p -r1.1.1.1.2.4 pa_trace.c ---- pa_common/pa_trace.c 2 Nov 2005 12:06:44 -0000 1.1.1.1.2.4 -+++ pa_common/pa_trace.c 19 Mar 2006 22:26:39 -0000 -@@ -35,6 +35,8 @@ - */ - - -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -Index: pa_jack/pa_jack.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_jack/Attic/pa_jack.c,v -retrieving revision 1.1.2.20 -diff -u -b -B -w -p -r1.1.2.20 pa_jack.c ---- pa_jack/pa_jack.c 2 Oct 2005 22:02:26 -0000 1.1.2.20 -+++ pa_jack/pa_jack.c 19 Mar 2006 22:26:46 -0000 -@@ -35,6 +35,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include <config.h> -+ - #include <string.h> - #include <regex.h> - #include <stdlib.h> -@@ -56,7 +58,7 @@ - #include "pa_process.h" - #include "pa_allocation.h" - #include "pa_cpuload.h" --#include "../pablio/ringbuffer.c" -+#include "pablio/ringbuffer.c" - - static int aErr_; - static PaError paErr_; /* For use with ENSURE_PA */ -Index: pa_linux_alsa/pa_linux_alsa.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_linux_alsa/Attic/pa_linux_alsa.c,v -retrieving revision 1.1.2.90 -diff -u -b -B -w -p -r1.1.2.90 pa_linux_alsa.c ---- pa_linux_alsa/pa_linux_alsa.c 19 Mar 2006 12:28:44 -0000 1.1.2.90 -+++ pa_linux_alsa/pa_linux_alsa.c 19 Mar 2006 22:27:00 -0000 -@@ -34,6 +34,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include <config.h> -+ - #define ALSA_PCM_NEW_HW_PARAMS_API - #define ALSA_PCM_NEW_SW_PARAMS_API - #include <alsa/asoundlib.h> -Index: pa_mac/pa_mac_hostapis.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac/Attic/pa_mac_hostapis.c,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 pa_mac_hostapis.c ---- pa_mac/pa_mac_hostapis.c 27 May 2004 22:39:58 -0000 1.1.2.1 -+++ pa_mac/pa_mac_hostapis.c 19 Mar 2006 22:27:00 -0000 -@@ -33,6 +33,7 @@ - Mac OS host API initialization function table. - */ - -+#include <config.h> - - #include "pa_hostapi.h" - -Index: pa_mac_core/pa_mac_core.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_core/pa_mac_core.c,v -retrieving revision 1.8.2.11 -diff -u -b -B -w -p -r1.8.2.11 pa_mac_core.c ---- pa_mac_core/pa_mac_core.c 27 Feb 2006 14:25:50 -0000 1.8.2.11 -+++ pa_mac_core/pa_mac_core.c 19 Mar 2006 22:27:08 -0000 -@@ -45,6 +45,8 @@ - @brief AUHAL implementation of PortAudio - */ - -+#include <config.h> -+ - #include <string.h> /* strlen(), memcmp() etc. */ - - #include <AudioUnit/AudioUnit.h> -Index: pa_mac_core/pa_mac_core_old.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_core/Attic/pa_mac_core_old.c,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 pa_mac_core_old.c ---- pa_mac_core/pa_mac_core_old.c 24 Dec 2005 01:22:52 -0000 1.1.2.1 -+++ pa_mac_core/pa_mac_core_old.c 19 Mar 2006 22:27:14 -0000 -@@ -34,6 +34,8 @@ - * - */ - -+#include <config.h> -+ - #include <CoreAudio/CoreAudio.h> - #include <AudioToolbox/AudioToolbox.h> - #include <stdio.h> -Index: pa_mac_core/pa_mac_core_utilities.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_core/Attic/pa_mac_core_utilities.c,v -retrieving revision 1.1.2.2 -diff -u -b -B -w -p -r1.1.2.2 pa_mac_core_utilities.c ---- pa_mac_core/pa_mac_core_utilities.c 9 Dec 2005 19:43:14 -0000 1.1.2.2 -+++ pa_mac_core/pa_mac_core_utilities.c 19 Mar 2006 22:27:14 -0000 -@@ -10,6 +10,8 @@ - * by Bjorn Roche. - */ - -+#include <config.h> -+ - /* - * Translates MacOS generated errors into PaErrors - */ -Index: pa_mac_sm/pa_mac_sm.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_sm/Attic/pa_mac_sm.c,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 pa_mac_sm.c ---- pa_mac_sm/pa_mac_sm.c 7 Jun 2002 21:20:48 -0000 1.1.2.1 -+++ pa_mac_sm/pa_mac_sm.c 19 Mar 2006 22:27:21 -0000 -@@ -76,6 +76,8 @@ O- Add support for native sample data fo - O- Review buffer sizing. Should it be based on result of siDeviceBufferInfo query? - O- Determine default devices somehow. - */ -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -Index: pa_sgi/pa_sgi.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_sgi/pa_sgi.c,v -retrieving revision 1.2.2.20 -diff -u -b -B -w -p -r1.2.2.20 pa_sgi.c ---- pa_sgi/pa_sgi.c 3 Jan 2004 19:20:09 -0000 1.2.2.20 -+++ pa_sgi/pa_sgi.c 19 Mar 2006 22:27:27 -0000 -@@ -123,6 +123,8 @@ - a outputs stereo. One can observe this in SGI's 'Audio Queue Monitor'. - */ - -+#include <config.h> -+ - #include <string.h> /* For strlen() but also for strerror()! */ - #include <stdio.h> /* printf() */ - #include <math.h> /* fabs() */ -Index: pa_unix/pa_unix_hostapis.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix/Attic/pa_unix_hostapis.c,v -retrieving revision 1.1.2.5 -diff -u -b -B -w -p -r1.1.2.5 pa_unix_hostapis.c ---- pa_unix/pa_unix_hostapis.c 2 Oct 2003 12:35:46 -0000 1.1.2.5 -+++ pa_unix/pa_unix_hostapis.c 19 Mar 2006 22:27:28 -0000 -@@ -30,6 +30,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_hostapi.h" - - PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); -Index: pa_unix/pa_unix_util.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix/Attic/pa_unix_util.c,v -retrieving revision 1.1.2.8 -diff -u -b -B -w -p -r1.1.2.8 pa_unix_util.c ---- pa_unix/pa_unix_util.c 20 Nov 2005 13:46:13 -0000 1.1.2.8 -+++ pa_unix/pa_unix_util.c 19 Mar 2006 22:27:28 -0000 -@@ -31,6 +31,8 @@ - */ - - -+#include <config.h> -+ - #include <pthread.h> - #include <unistd.h> - #include <stdlib.h> -Index: pa_unix_oss/pa_unix_oss.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix_oss/pa_unix_oss.c,v -retrieving revision 1.6.2.27 -diff -u -b -B -w -p -r1.6.2.27 pa_unix_oss.c ---- pa_unix_oss/pa_unix_oss.c 21 Feb 2006 19:13:56 -0000 1.6.2.27 -+++ pa_unix_oss/pa_unix_oss.c 19 Mar 2006 22:27:35 -0000 -@@ -35,6 +35,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include <config.h> -+ - #include <stdio.h> - #include <string.h> - #include <math.h> -@@ -42,7 +44,6 @@ - #include <sys/ioctl.h> - #include <unistd.h> - #include <pthread.h> --#include <alloca.h> - #include <malloc.h> - #include <assert.h> - #include <errno.h> -@@ -52,14 +53,21 @@ - #include <limits.h> - #include <semaphore.h> - --#ifdef __FreeBSD__ -+#ifdef HAVE_SYS_SOUNDCARD_H - # include <sys/soundcard.h> -+#elif HAVE_LINUX_SOUNDCARD_H -+# include <linux/soundcard.h> -+#elif HAVE_SOUNDCARD_H -+# include <soundcard.h> -+#else -+# include <machine/soundcard.h> /* JH20010905 */ -+#endif -+ -+#ifdef __FreeBSD__ - # define DEVICE_NAME_BASE "/dev/dsp" - #elif defined __linux__ --# include <linux/soundcard.h> - # define DEVICE_NAME_BASE "/dev/dsp" - #else --# include <machine/soundcard.h> /* JH20010905 */ - # define DEVICE_NAME_BASE "/dev/audio" - #endif - -@@ -1913,7 +1921,12 @@ static signed long GetStreamWriteAvailab - PaOssStream *stream = (PaOssStream*)s; - int delay = 0; - -+/* -+ * FIXME: SNDCTL_DSP_GETODELAY does not exist on NetBSD -+ */ -+#ifdef SNDCTL_DSP_GETODELAY - if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 ) -+#endif - return paUnanticipatedHostError; - - return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback ); -Index: pa_unix_oss/recplay.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix_oss/recplay.c,v -retrieving revision 1.1.1.1 -diff -u -b -B -w -p -r1.1.1.1 recplay.c ---- pa_unix_oss/recplay.c 22 Jan 2002 00:52:44 -0000 1.1.1.1 -+++ pa_unix_oss/recplay.c 19 Mar 2006 22:27:35 -0000 -@@ -4,6 +4,8 @@ - * Minimal record and playback test. - * - */ -+#include <config.h> -+ - #include <stdio.h> - #include <unistd.h> - #include <stdlib.h> -Index: pa_win/pa_win_hostapis.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win/Attic/pa_win_hostapis.c,v -retrieving revision 1.1.2.10 -diff -u -b -B -w -p -r1.1.2.10 pa_win_hostapis.c ---- pa_win/pa_win_hostapis.c 8 Sep 2004 17:31:37 -0000 1.1.2.10 -+++ pa_win/pa_win_hostapis.c 19 Mar 2006 22:27:36 -0000 -@@ -36,6 +36,7 @@ - the Unix version does, we should consider being consistent. - */ - -+#include <config.h> - - #include "pa_hostapi.h" - -Index: pa_win/pa_win_util.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win/Attic/pa_win_util.c,v -retrieving revision 1.1.2.7 -diff -u -b -B -w -p -r1.1.2.7 pa_win_util.c ---- pa_win/pa_win_util.c 15 Sep 2003 18:30:26 -0000 1.1.2.7 -+++ pa_win/pa_win_util.c 19 Mar 2006 22:27:36 -0000 -@@ -37,6 +37,9 @@ - bug. (see msdn kb Q274323). - */ - -+#include <config.h> -+ -+ - #include <windows.h> - #include <mmsystem.h> /* for timeGetTime() */ - -Index: pa_win/pa_x86_plain_converters.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win/Attic/pa_x86_plain_converters.c,v -retrieving revision 1.1.2.2 -diff -u -b -B -w -p -r1.1.2.2 pa_x86_plain_converters.c ---- pa_win/pa_x86_plain_converters.c 28 Feb 2003 01:49:59 -0000 1.1.2.2 -+++ pa_win/pa_x86_plain_converters.c 19 Mar 2006 22:27:40 -0000 -@@ -1,3 +1,5 @@ -+#include <config.h> -+ - #include "pa_x86_plain_converters.h" - - #include "pa_converters.h" -Index: pa_win_ds/dsound_wrapper.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_ds/dsound_wrapper.c,v -retrieving revision 1.1.1.1.2.11 -diff -u -b -B -w -p -r1.1.1.1.2.11 dsound_wrapper.c ---- pa_win_ds/dsound_wrapper.c 7 Sep 2003 13:04:53 -0000 1.1.1.1.2.11 -+++ pa_win_ds/dsound_wrapper.c 19 Mar 2006 22:27:43 -0000 -@@ -33,6 +33,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <math.h> -Index: pa_win_ds/pa_win_ds.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_ds/Attic/pa_win_ds.c,v -retrieving revision 1.1.2.51 -diff -u -b -B -w -p -r1.1.2.51 pa_win_ds.c ---- pa_win_ds/pa_win_ds.c 26 Jan 2006 01:13:18 -0000 1.1.2.51 -+++ pa_win_ds/pa_win_ds.c 19 Mar 2006 22:27:49 -0000 -@@ -58,6 +58,8 @@ - O- fix "patest_stop.c" - */ - -+#include <config.h> -+ - #include <stdio.h> - #include <string.h> /* strlen() */ - -Index: pa_win_wdmks/pa_win_wdmks.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_wdmks/Attic/pa_win_wdmks.c,v -retrieving revision 1.1.2.4 -diff -u -b -B -w -p -r1.1.2.4 pa_win_wdmks.c ---- pa_win_wdmks/pa_win_wdmks.c 19 Nov 2005 10:14:01 -0000 1.1.2.4 -+++ pa_win_wdmks/pa_win_wdmks.c 19 Mar 2006 22:28:00 -0000 -@@ -42,6 +42,8 @@ - of a device for the duration of active stream using those devices - */ - -+#include <config.h> -+ - #include <stdio.h> - - /* Debugging/tracing support */ -Index: pa_win_wmme/pa_win_wmme.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_wmme/pa_win_wmme.c,v -retrieving revision 1.6.2.88 -diff -u -b -B -w -p -r1.6.2.88 pa_win_wmme.c ---- pa_win_wmme/pa_win_wmme.c 16 Feb 2006 01:56:45 -0000 1.6.2.88 -+++ pa_win_wmme/pa_win_wmme.c 19 Mar 2006 22:28:14 -0000 -@@ -100,6 +100,8 @@ Non-critical stuff for the future: - Events (when necessary) inside the ReadStream() and WriteStream() functions. - */ - -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <math.h> ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ Makefile.am 2006-03-19 22:49:42.000000000 +0100 -@@ -0,0 +1,215 @@ -+# -+# PortAudio V19 Makefile.am -+# -+# Stéphane Fillod -+# -+ -+INCLUDES = -I$(top_srcdir)/pa_common -+ -+COMMON_SRC = \ -+ pa_common/pa_allocation.c \ -+ pa_common/pa_converters.c \ -+ pa_common/pa_cpuload.c \ -+ pa_common/pa_dither.c \ -+ pa_common/pa_front.c \ -+ pa_common/pa_process.c \ -+ pa_common/pa_skeleton.c \ -+ pa_common/pa_stream.c \ -+ pa_common/pa_trace.c -+ -+libportaudio_coreaudio_la_SOURCES = \ -+ pa_mac/pa_mac_hostapis.c \ -+ pa_mac_core/pa_mac_core.c -+ -+libportaudio_mac_asio_la_SOURCES = \ -+ pa_asio/iasiothiscallresolver.cpp -+libportaudio_mac_asio_la_LIBADD = @ASIO_OBJS@ -+ -+libportaudio_dsound_la_SOURCES = \ -+ pa_win_ds/pa_win_ds.c \ -+ pa_win_ds/dsound_wrapper.c \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c -+ -+libportaudio_win_asio_la_SOURCES = \ -+ pa_asio/pa_asio.cpp \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c \ -+ pa_asio/iasiothiscallresolver.cpp -+libportaudio_win_asio_la_LIBADD = @ASIO_OBJS@ -+ -+libportaudio_wdmks_la_SOURCES = \ -+ pa_win_wdmks/pa_win_wdmks.c \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c -+ -+libportaudio_wmme_la_SOURCES = \ -+ pa_win_wmme/pa_win_wmme.c \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c -+ -+libportaudio_sgi_la_SOURCES = \ -+ pa_sgi/pa_sgi.c -+ -+libportaudio_alsa_la_SOURCES = \ -+ pa_linux_alsa/pa_linux_alsa.c -+ -+libportaudio_jack_la_SOURCES = \ -+ pa_jack/pa_jack.c -+ -+libportaudio_oss_la_SOURCES = \ -+ pa_unix_oss/pa_unix_oss.c -+ -+libportaudio_unix_la_SOURCES = \ -+ pa_unix/pa_unix_hostapis.c \ -+ pa_unix/pa_unix_util.c -+ -+EXTRA_LTLIBRARIES = \ -+ libportaudio-coreaudio.la \ -+ libportaudio-mac-asio.la \ -+ libportaudio-dsound.la \ -+ libportaudio-win-asio.la \ -+ libportaudio-wdmks.la \ -+ libportaudio-wmme.la \ -+ libportaudio-sgi.la \ -+ libportaudio-alsa.la \ -+ libportaudio-jack.la \ -+ libportaudio-oss.la \ -+ libportaudio-unix.la -+ -+noinst_LTLIBRARIES = @PA_LIBADD@ -+lib_LTLIBRARIES = libportaudio.la -+ -+ -+libportaudio_la_SOURCES = \ -+ $(COMMON_SRC) -+ -+# -no-undefined is required by Win32 and MacOSX, should be harmless otherwise -+libportaudio_la_LDFLAGS = $(WINLDFLAGS) -no-undefined -version-info @PA_ABI@:@PA_REV@:@PA_AGE@ -+libportaudio_la_CFLAGS = $(AM_CFLAGS) -+libportaudio_la_LIBADD = @PA_LIBADD@ -lm -+libportaudio_la_DEPENDENCIES = @PA_LIBADD@ -+ -+ -+noinst_HEADERS = \ -+ pa_asio/iasiothiscallresolver.h \ -+ pa_asio/pa_asio.h \ -+ pa_beos/PlaybackNode.h \ -+ pablio/pablio.h \ -+ pablio/ringbuffer.h \ -+ pa_common/pa_allocation.h \ -+ pa_common/pa_converters.h \ -+ pa_common/pa_cpuload.h \ -+ pa_common/pa_dither.h \ -+ pa_common/pa_endianness.h \ -+ pa_common/pa_hostapi.h \ -+ pa_common/pa_process.h \ -+ pa_common/pa_stream.h \ -+ pa_common/pa_trace.h \ -+ pa_common/pa_types.h \ -+ pa_common/pa_util.h \ -+ pa_dll_switch/PaDllEntry.h \ -+ pa_dll_switch/portaudio.h \ -+ pa_linux_alsa/pa_linux_alsa.h \ -+ pa_mac_core/pa_mac_core.h \ -+ pa_unix/pa_unix_util.h \ -+ pa_win_ds/dsound_wrapper.h \ -+ pa_win/pa_x86_plain_converters.h \ -+ pa_win_wmme/pa_win_wmme.h -+ -+include_HEADERS = \ -+ pa_common/portaudio.h -+ -+ -+TESTS = \ -+ pa_tests/paqa_errs \ -+ pa_tests/patest1 \ -+ pa_tests/patest_buffer \ -+ pa_tests/patest_callbackstop \ -+ pa_tests/patest_clip \ -+ pa_tests/patest_dither \ -+ pa_tests/patest_hang \ -+ pa_tests/patest_in_overflow \ -+ pa_tests/patest_latency \ -+ pa_tests/patest_leftright \ -+ pa_tests/patest_longsine \ -+ pa_tests/patest_many \ -+ pa_tests/patest_maxsines \ -+ pa_tests/patest_multi_sine \ -+ pa_tests/patest_out_underflow \ -+ pa_tests/patest_pink \ -+ pa_tests/patest_prime \ -+ pa_tests/patest_read_record \ -+ pa_tests/patest_record \ -+ pa_tests/patest_ringmix \ -+ pa_tests/patest_saw \ -+ pa_tests/patest_sine8 \ -+ pa_tests/patest_sine \ -+ pa_tests/patest_sine_formats \ -+ pa_tests/patest_sine_time \ -+ pa_tests/patest_start_stop \ -+ pa_tests/patest_stop \ -+ pa_tests/patest_sync \ -+ pa_tests/patest_toomanysines \ -+ pa_tests/patest_underflow \ -+ pa_tests/patest_wire \ -+ pa_tests/patest_write_sine \ -+ pa_tests/pa_devs \ -+ pa_tests/pa_fuzz \ -+ pa_tests/pa_minlat \ -+ pa_tests/paqa_devs -+ -+check_PROGRAMS = $(TESTS) -+ -+LDADD = libportaudio.la -+ -+# Most of these don't compile yet. Put them in TESTS, above, if -+# you want to try to compile them... -+ALL_TESTS = \ -+ pa_tests/debug_convert \ -+ pa_tests/debug_dither_calc \ -+ pa_tests/debug_dual \ -+ pa_tests/debug_multi_in \ -+ pa_tests/debug_multi_out \ -+ pa_tests/debug_record \ -+ pa_tests/debug_record_reuse \ -+ pa_tests/debug_sine_amp \ -+ pa_tests/debug_sine \ -+ pa_tests/debug_sine_formats \ -+ pa_tests/debug_srate \ -+ pa_tests/debug_test1 \ -+ $(TESTS) -+ -+pkgconfigdir = $(libdir)/pkgconfig -+pkgconfig_DATA = portaudio-2.0.pc -+ -+ -+SUBDIRS= -+DIST_SUBDIRS= -+ -+ACLOCAL_AMFLAGS = -I config -+ -+doc: config.doxy -+ doxygen config.doxy -+ -+# pa_asio pa_beos pablio pa_common pa_dll_switch pa_jack pa_linux_alsa pa_mac pa_mac_core pa_mac_sm pa_sgi pa_tests pa_unix pa_unix_oss pa_win pa_win_ds pa_win_wdmks pa_win_wmme -+ -+PABLIO = \ -+ pablio/pablio.def \ -+ pablio/README.txt \ -+ pablio/ringbuffer.h \ -+ pablio/test_rw_echo.c \ -+ pablio/test_w_saw.c \ -+ pablio/pablio.c \ -+ pablio/pablio.h \ -+ pablio/ringbuffer.c \ -+ pablio/test_rw.c \ -+ pablio/test_w_saw8.c -+ -+EXTRA_DIST = \ -+ $(PABLIO) \ -+ config.doxy \ -+ LICENSE.txt \ -+ README.txt \ -+ portaudio-2.0.pc.in \ -+ V19-devel-readme.txt ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ configure.ac 2006-03-19 22:49:13.000000000 +0100 -@@ -0,0 +1,278 @@ -+dnl -+dnl portaudio V19 configure.ac script -+dnl -+dnl Stephane Fillod, Dominic Mazzoni, Arve Knudsen -+dnl -+ -+dnl Require autoconf >= 2.57 -+AC_PREREQ(2.57) -+ -+dnl Init autoconf and make sure configure is being called -+dnl from the right directory -+AC_INIT([portaudio], [2.0cvs], [portaudio@techweb.rfa.org]) -+AC_CONFIG_SRCDIR([pa_common/portaudio.h]) -+AC_CONFIG_HEADERS(config.h) -+AC_CANONICAL_TARGET([]) -+ -+dnl Automake Initialisation. -+AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -) -+AM_MAINTAINER_MODE -+ -+dnl Portaudio library interface version, see libtool(info), esp. -+dnl node 6.3 "Updating version info" -+PA_ABI=19 -+PA_REV=0 -+PA_AGE=0 -+AC_SUBST(PA_ABI) -+AC_SUBST(PA_REV) -+AC_SUBST(PA_AGE) -+ -+ -+dnl Checks for programs. -+ -+AC_PROG_CC -+AC_PROG_CXX -+AC_PROG_RANLIB -+AC_PROG_INSTALL -+AC_PROG_MAKE_SET -+ -+AC_AIX -+AC_ISC_POSIX -+AC_MINIX -+AM_PROG_CC_STDC -+AC_PROG_GCC_TRADITIONAL -+AC_C_CONST -+AC_C_INLINE -+ -+dnl Check for Mingw support -+#GR_PWIN32 -+ -+dnl libtool Initialisation -+AC_LIBTOOL_WIN32_DLL -+AC_PROG_LIBTOOL -+ -+ACX_PTHREAD -+ -+dnl This must be one of the first tests we do or it will fail... -+AC_C_BIGENDIAN -+ -+dnl checks for various host APIs and arguments to configure that -+dnl turn them on or off -+ -+AC_CHECK_LIB(asound, snd_pcm_open, [have_alsa=yes], [have_alsa=no]) -+ -+ -+PKG_CHECK_MODULES(JACK, jack, [have_jack=yes], [have_jack=no]) -+PKG_CHECK_LIB(jack_client_new, [$JACK_LIBS], [$JACK_CFLAGS], [have_jack=yes], [have_jack=no]) -+ -+AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h soundcard.h machine/soundcard.h]) -+AC_CHECK_HEADERS(sys/ioctl.h, [have_oss=yes], [have_oss=no]) -+ -+dnl sizeof checks: we will need a 16-bit and a 32-bit type -+ -+AC_CHECK_SIZEOF(short) -+AC_CHECK_SIZEOF(int) -+AC_CHECK_SIZEOF(long) -+ -+dnl Specify options -+ -+AC_ARG_WITH(alsa, -+ [ --with-alsa (default=yes)], -+ [with_alsa=$withval], [with_alsa=$have_alsa]) -+ -+AC_ARG_WITH(jack, -+ [ --with-jack (default=yes)], -+ [with_jack=$withval], [with_jack=$have_jack]) -+ -+AC_ARG_WITH(oss, -+ [ --with-oss (default=yes)], -+ [with_oss=$withval], [with_oss=$have_oss]) -+ -+AC_ARG_WITH(winapi, -+ [ --with-winapi ((wmme/directx/asio) default=wmme)], -+ [with_winapi=$withval], [with_winapi="wmme"]) -+ -+dnl Mac API added for ASIO, can have other api's listed -+AC_ARG_WITH(macapi, -+ [ --with-macapi ((asio/core/sm) default=core)], -+ [with_macapi=$withval], [with_macapi="core"]) -+ -+AC_ARG_WITH(asiodir, -+ [ --with-asiodir (default=/usr/local/asiosdk2)], -+ [with_asiodir=$withval], [with_asiodir="/usr/local/asiosdk2"]) -+ -+AC_ARG_WITH(dxdir, -+ [ --with-dxdir (default=/usr/local/dx7sdk)], -+ [with_dxdir=$withval], [with_dxdir="/usr/local/dx7sdk"]) -+ -+AC_ARG_ENABLE(debug-output, -+ [ --enable-debug-output], -+ [if test x$enableval != xno ; then -+ AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) -+ fi -+ ]) -+ -+dnl BSD configuration -+AC_HAVE_LIBRARY(ossaudio) -+ -+dnl Mac OS X configuration -+ -+AC_CHECK_LIB(CoreAudio, OpenAComponent, -+ [ -+ have_coreaudio=yes -+ PA_LIBADD="$PA_LIBADD libportaudio-coreaudio.la" -+ AC_DEFINE([PA_USE_COREAUDIO], [], [Define to use Mac OS X CoreAudio]) -+ #LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon" -+ LIBS="-lCoreAudio -lAudioToolbox -lAudioUnit -lCarbon" -+ ], have_coreaudio=no) -+ -+ASIO_CFLAGS="" -+ASIO_OBJS="" -+ -+if [[ $with_asiodir ]] ; then -+ ASIODIR="$with_asiodir" -+fi -+ -+if [[ $with_macapi = "asio" ]] ; then -+ echo "ASIODIR: $ASIODIR" -+ ASIO_CFLAGS="-Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common" -+ ASIO_OBJS=$ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/mac/asioshlib.o -+ PA_LIBADD="$PA_LIBADD libportaudio-mac-asio.la" -+fi -+ -+if [[ $with_winapi = "asio" ]] ; then -+ echo "ASIODIR: $ASIODIR" -+ ASIO_CFLAGS="-ffast-math -fomit-frame-pointer -Ipa_asio -I$ASIDIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS" -+ ASIO_OBJS=$ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o -+ LIBS="$LIBS -lwinmm -lole32 -luuid" -+ PA_LIBADD="$PA_LIBADD libportaudio-win-asio.la" -+fi -+ -+ -+dnl MingW/Win configuration -+ -+AC_TRY_LINK_LIB(dsound, [DSW_InitOutputBuffer(0,0,0,0);], [ -+ #include <windows.h> -+ #include <DSound.h> -+ ], [-I$DXDIR/include], -+ [ -+ have_directx=yes -+ DXDIR="$with_dxdir" -+ echo "DXDIR: $DXDIR" -+ # LDFLAGS -L./dx7sdk/lib ? -+ LIBS="-lwinmm -ldsound -lole32" -+ CFLAGS="$CFLAGS -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS" -+ PA_LIBADD="$PA_LIBADD libportaudio-dsound.la" -+ ], have_directx=no) -+ -+AC_TRY_LINK_LIB(kernel32, [DeviceIoControl(0,0,0,0,0,0,0,0);],[ -+ #include <windows.h> -+ #include <winbase.h> -+ #include <ks.h> -+ ], [-I$DXDIR/include], -+ [ -+ have_wdmks=yes -+ DXDIR="$with_dxdir" -+ echo "DXDIR: $DXDIR" -+ # LDFLAGS -L./dx7sdk/lib ? -+ LIBS="-lwinmm -luuid -lsetupapi -lole32" -+ CFLAGS="$CFLAGS -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO" -+ PA_LIBADD="$PA_LIBADD libportaudio-wdmks.la" -+ ], have_wdmks=no) -+ -+# WMME default ? -+AC_TRY_LINK_LIB(winmm, [waveOutOpen(0,0,0,0,0,0);],[ -+ #include <windows.h> -+ #include <mmsystem.h> -+ ], [], -+ [ -+ have_wmme=yes -+ LIBS="-lwinmm -lole32 -luuid" -+ CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS" -+ PA_LIBADD="$PA_LIBADD libportaudio-wmme.la" -+ ], have_wmme=no) -+ -+ -+dnl Unix configuration -+ -+dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003). -+dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST). -+dnl -+ -+AC_CHECK_LIB(audio, alOpenPort, [have_AL=1], [have_AL=0]) -+AC_CHECK_LIB(dmedia, dmGetUST, [have_dmedia=1], [have_dmedia=0]) -+ -+ -+if [[ $have_AL = "yes" ] && [ $have_dmedia = "yes" ]] ; then -+ dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c -+ dnl which selects the appropriate PaXXX_Initialize() function. -+ dnl -+ -+ LIBS="-ldmedia -laudio" -+ AC_DEFINE([PA_USE_SGI], [], [Define to use special SGI system support]) -+ PA_LIBADD="$PA_LIBADD libportaudio-sgi.la" -+ -+ # TODO: -+ #AC_MSG_ERROR([IRIX audio library not found!]) -+ #AC_MSG_ERROR([IRIX digital media library not found!]) -+fi -+ -+ -+if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then -+ LIBS="$LIBS -lasound" -+ AC_DEFINE([PA_USE_ALSA], [], [Define to use ALSA]) -+ PA_LIBADD="$PA_LIBADD libportaudio-alsa.la" -+fi -+ -+if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then -+ LIBS="$LIBS $JACK_LIBS" -+ CFLAGS="$CFLAGS $JACK_CFLAGS" -+ AC_DEFINE([PA_USE_JACK], [], [Define to use JACK]) -+ PA_LIBADD="$PA_LIBADD libportaudio-jack.la" -+fi -+ -+if [[ $with_oss != "no" ]] ; then -+ AC_DEFINE([PA_USE_OSS], [], [Define to use Open Sound System]) -+ PA_LIBADD="$PA_LIBADD libportaudio-oss.la" -+fi -+ -+dnl SGI books say -lpthread should be the last of the libs mentioned. -+if [[ $acx_pthread_ok = "yes" ]] ; then -+ LIBS="$LIBS $PTHREAD_LIBS" -+ PA_LIBADD="$PA_LIBADD libportaudio-unix.la" -+else -+ if [[ $with_winapi != "wmme" -a $with_winapi != "directx" -a $with_winapi != "asio" ]] ; then -+ AC_MSG_ERROR([libpthread not found!]) -+ fi -+fi -+ -+ -+if [[ $with_macapi = "asio" ] || [ $with_winapi = "asio" ]] ; then -+ echo "ASIODIR: $ASIODIR" -+ -+ CFLAGS="$CFLAGS $ASIO_CFLAGS" -+fi -+ -+if [[ $ac_cv_c_bigendian = "yes" ]] ; then -+ CFLAGS="$CFLAGS -DPA_BIG_ENDIAN" -+else -+ CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN" -+fi -+ -+ -+CXXFLAGS="$CXXFLAGS" -+ -+#CFLAGS="-g -O2 -Wall -pedantic -pipe" -+ -+CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ -+ -+dnl extra variables -+AC_SUBST(PA_LIBADD) -+AC_SUBST(ASIO_OBJS) -+AC_SUBST(PTHREAD_CFLAGS) -+AC_SUBST(CXXFLAGS) -+AC_SUBST(NASM) -+AC_SUBST(NASMOPT) -+ -+AC_OUTPUT([Makefile portaudio-2.0.pc]) ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ config/acx_pthread.m4 2006-03-17 15:41:05.000000000 +0100 -@@ -0,0 +1,190 @@ -+dnl Available from the GNU Autoconf Macro Archive at: -+dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html -+dnl -+AC_DEFUN([ACX_PTHREAD], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_LANG_SAVE -+AC_LANG_C -+acx_pthread_ok=no -+ -+# We used to check for pthread.h first, but this fails if pthread.h -+# requires special compiler flags (e.g. on True64 or Sequent). -+# It gets checked for in the link test anyway. -+ -+# First of all, check if the user has set any of the PTHREAD_LIBS, -+# etcetera environment variables, and if threads linking works using -+# them: -+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ save_LIBS="$LIBS" -+ LIBS="$PTHREAD_LIBS $LIBS" -+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) -+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) -+ AC_MSG_RESULT($acx_pthread_ok) -+ if test x"$acx_pthread_ok" = xno; then -+ PTHREAD_LIBS="" -+ PTHREAD_CFLAGS="" -+ fi -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+fi -+ -+# We must check for the threads library under a number of different -+# names; the ordering is very important because some systems -+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -+# libraries is broken (non-POSIX). -+ -+# Create a list of thread flags to try. Items starting with a "-" are -+# C compiler flags, and other items are library names, except for "none" -+# which indicates that we try without any flags at all. -+ -+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" -+ -+# The ordering *is* (sometimes) important. Some notes on the -+# individual items follow: -+ -+# pthreads: AIX (must check this before -lpthread) -+# none: in case threads are in libc; should be tried before -Kthread and -+# other compiler flags to prevent continual compiler warnings -+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -+# -pthreads: Solaris/gcc -+# -mthreads: Mingw32/gcc, Lynx/gcc -+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -+# doesn't hurt to check since this sometimes defines pthreads too; -+# also defines -D_REENTRANT) -+# pthread: Linux, etcetera -+# --thread-safe: KAI C++ -+ -+case "${host_cpu}-${host_os}" in -+ *solaris*) -+ -+ # On Solaris (at least, for some versions), libc contains stubbed -+ # (non-functional) versions of the pthreads routines, so link-based -+ # tests will erroneously succeed. (We need to link with -pthread or -+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather -+ # a function called by this macro, so we could check for that, but -+ # who knows whether they'll stub that too in a future libc.) So, -+ # we'll just look for -pthreads and -lpthread first: -+ -+ acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" -+ ;; -+esac -+ -+if test x"$acx_pthread_ok" = xno; then -+for flag in $acx_pthread_flags; do -+ -+ case $flag in -+ none) -+ AC_MSG_CHECKING([whether pthreads work without any flags]) -+ ;; -+ -+ -*) -+ AC_MSG_CHECKING([whether pthreads work with $flag]) -+ PTHREAD_CFLAGS="$flag" -+ ;; -+ -+ *) -+ AC_MSG_CHECKING([for the pthreads library -l$flag]) -+ PTHREAD_LIBS="-l$flag" -+ ;; -+ esac -+ -+ save_LIBS="$LIBS" -+ save_CFLAGS="$CFLAGS" -+ LIBS="$PTHREAD_LIBS $LIBS" -+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ -+ # Check for various functions. We must include pthread.h, -+ # since some functions may be macros. (On the Sequent, we -+ # need a special flag -Kthread to make this header compile.) -+ # We check for pthread_join because it is in -lpthread on IRIX -+ # while pthread_create is in libc. We check for pthread_attr_init -+ # due to DEC craziness with -lpthreads. We check for -+ # pthread_cleanup_push because it is one of the few pthread -+ # functions on Solaris that doesn't have a non-functional libc stub. -+ # We try pthread_create on general principles. -+ AC_TRY_LINK([#include <pthread.h>], -+ [pthread_t th; pthread_join(th, 0); -+ pthread_attr_init(0); pthread_cleanup_push(0, 0); -+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], -+ [acx_pthread_ok=yes]) -+ -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+ AC_MSG_RESULT($acx_pthread_ok) -+ if test "x$acx_pthread_ok" = xyes; then -+ break; -+ fi -+ -+ PTHREAD_LIBS="" -+ PTHREAD_CFLAGS="" -+done -+fi -+ -+# Various other checks: -+if test "x$acx_pthread_ok" = xyes; then -+ save_LIBS="$LIBS" -+ LIBS="$PTHREAD_LIBS $LIBS" -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ -+ # Detect AIX lossage: threads are created detached by default -+ # and the JOINABLE attribute has a nonstandard name (UNDETACHED). -+ AC_MSG_CHECKING([for joinable pthread attribute]) -+ AC_TRY_LINK([#include <pthread.h>], -+ [int attr=PTHREAD_CREATE_JOINABLE;], -+ ok=PTHREAD_CREATE_JOINABLE, ok=unknown) -+ if test x"$ok" = xunknown; then -+ AC_TRY_LINK([#include <pthread.h>], -+ [int attr=PTHREAD_CREATE_UNDETACHED;], -+ ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) -+ fi -+ if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then -+ AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, -+ [Define to the necessary symbol if this constant -+ uses a non-standard name on your system.]) -+ fi -+ AC_MSG_RESULT(${ok}) -+ if test x"$ok" = xunknown; then -+ AC_MSG_WARN([we do not know how to create joinable pthreads]) -+ fi -+ -+ AC_MSG_CHECKING([if more special flags are required for pthreads]) -+ flag=no -+ case "${host_cpu}-${host_os}" in -+ *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; -+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; -+ esac -+ AC_MSG_RESULT(${flag}) -+ if test "x$flag" != xno; then -+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" -+ fi -+ -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+ # More AIX lossage: must compile with cc_r -+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) -+else -+ PTHREAD_CC="$CC" -+fi -+ -+AC_SUBST(PTHREAD_LIBS) -+AC_SUBST(PTHREAD_CFLAGS) -+AC_SUBST(PTHREAD_CC) -+ -+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -+if test x"$acx_pthread_ok" = xyes; then -+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) -+ : -+else -+ acx_pthread_ok=no -+ $2 -+fi -+AC_LANG_RESTORE -+])dnl ACX_PTHREAD ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ config/pkg_check.m4 2006-03-17 22:12:37.000000000 +0100 -@@ -0,0 +1,49 @@ -+ -+AC_DEFUN([PKG_CHECK_LIB], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_LANG_SAVE -+AC_LANG_C -+ -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $3" -+ save_LIBS="$LIBS" -+ LIBS="$2 $LIBS" -+ AC_MSG_CHECKING([for $1 in LIBS=$2 with CFLAGS=$3]) -+ AC_TRY_LINK_FUNC([$1], pkg_check_try_link=yes, pkg_check_try_link=no) -+ AC_MSG_RESULT($pkg_check_try_link) -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -+if test x"$pkg_check_try_link" = xyes; then -+ $4 -+else -+ $5 -+fi -+AC_LANG_RESTORE -+])dnl PKG_CHECK_LIB -+ -+ -+AC_DEFUN([AC_TRY_LINK_LIB], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_LANG_SAVE -+AC_LANG_C -+ -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $4" -+ save_LIBS="$LIBS" -+ LIBS="-l$1 $LIBS" -+ AC_MSG_CHECKING([for $2 in $1]) -+ AC_TRY_LINK([$3], [$2], ac_try_link_lib=yes, ac_try_link_lib=no) -+ AC_MSG_RESULT($ac_try_link_lib) -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -+if test x"$ac_try_link_lib" = xyes; then -+ $5 -+else -+ $6 -+fi -+AC_LANG_RESTORE -+])dnl AC_TRY_LINK_LIB ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ bootstrap 2006-03-19 23:33:58.000000000 +0100 -@@ -0,0 +1,9 @@ -+#!/bin/sh -+ -+rm -rf config.cache autom4te*.cache -+ -+aclocal-1.9 -I config -+autoconf2.50 -+autoheader2.50 -+libtoolize --automake -+automake-1.9 --add-missing --foreign diff --git a/gr-audio-portaudio/gnuradio-audio-portaudio.pc.in b/gr-audio-portaudio/gnuradio-audio-portaudio.pc.in deleted file mode 100644 index 086195965..000000000 --- a/gr-audio-portaudio/gnuradio-audio-portaudio.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-audio-portaudio -Description: The GNU Radio block for the PORTAUDIO sound system -Requires: gnuradio-core -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-portaudio -Cflags: -I${includedir} diff --git a/gr-audio-portaudio/src/.gitignore b/gr-audio-portaudio/src/.gitignore deleted file mode 100644 index f05e85127..000000000 --- a/gr-audio-portaudio/src/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo -/usrp.py -/usrp.cc -/audio_oss.cc -/audio_oss.py -/audio_portaudio.py -/audio_portaudio.cc -/run_tests -/gnuradio -/guile -/python diff --git a/gr-audio-portaudio/src/Makefile.am b/gr-audio-portaudio/src/Makefile.am deleted file mode 100644 index f8d42792b..000000000 --- a/gr-audio-portaudio/src/Makefile.am +++ /dev/null @@ -1,77 +0,0 @@ -# -# Copyright 2004,2008,2009,2010 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. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ - $(PORTAUDIO_CFLAGS) $(WITH_INCLUDES) - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_portaudio_sink.h \ - audio_portaudio_source.h - -noinst_HEADERS = \ - gri_portaudio.h - -noinst_PYTHON = \ - qa_portaudio.py - -lib_LTLIBRARIES = libgnuradio-audio-portaudio.la - -libgnuradio_audio_portaudio_la_SOURCES = \ - audio_portaudio_sink.cc \ - audio_portaudio_source.cc \ - gri_portaudio.cc - -libgnuradio_audio_portaudio_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(PORTAUDIO_LIBS) - -libgnuradio_audio_portaudio_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - - -################################### -# SWIG interfaces and libraries - -TOP_SWIG_IFILES = \ - audio_portaudio.i - -# Install so that they end up available as: -# import gnuradio.audio_portaudio -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_portaudio_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_portaudio_la_swig_libadd = \ - libgnuradio-audio-portaudio.la - - -if PYTHON -TESTS += run_tests -endif
\ No newline at end of file diff --git a/gr-audio-portaudio/src/Makefile.swig.gen b/gr-audio-portaudio/src/Makefile.swig.gen deleted file mode 100644 index 32c2e54e1..000000000 --- a/gr-audio-portaudio/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 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. -# - -# Makefile.swig.gen for audio_portaudio.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_portaudio -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_portaudio -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_portaudio_pythondir_category ?= gnuradio/audio_portaudio -audio_portaudio_pylibdir_category ?= $(audio_portaudio_pythondir_category) -audio_portaudio_pythondir = $(pythondir)/$(audio_portaudio_pythondir_category) -audio_portaudio_pylibdir = $(pyexecdir)/$(audio_portaudio_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_portaudio_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_portaudio -# FIXME: determince whether these should be installed with gnuradio. -audio_portaudio_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_portaudio_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_portaudio_swiginclude_HEADERS = \ - audio_portaudio.i \ - $(audio_portaudio_swiginclude_headers) - -if PYTHON -audio_portaudio_pylib_LTLIBRARIES = \ - _audio_portaudio.la - -_audio_portaudio_la_SOURCES = \ - python/audio_portaudio.cc \ - $(audio_portaudio_la_swig_sources) - -audio_portaudio_python_PYTHON = \ - audio_portaudio.py \ - $(audio_portaudio_python) - -_audio_portaudio_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_portaudio_la_swig_libadd) - -_audio_portaudio_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_portaudio_la_swig_ldflags) - -_audio_portaudio_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_portaudio_la_swig_cxxflags) - -python/audio_portaudio.cc: audio_portaudio.py -audio_portaudio.py: audio_portaudio.i - -# Include the python dependencies for this file --include python/audio_portaudio.d - -endif # end of if python - -if GUILE - -audio_portaudio_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_portaudio.la -libguile_gnuradio_audio_portaudio_la_SOURCES = \ - guile/audio_portaudio.cc \ - $(audio_portaudio_la_swig_sources) -nobase_audio_portaudio_scm_DATA = \ - gnuradio/audio_portaudio.scm \ - gnuradio/audio_portaudio-primitive.scm -libguile_gnuradio_audio_portaudio_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_portaudio_la_swig_libadd) -libguile_gnuradio_audio_portaudio_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_portaudio_la_swig_ldflags) -libguile_gnuradio_audio_portaudio_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_portaudio_la_swig_cxxflags) - -guile/audio_portaudio.cc: gnuradio/audio_portaudio.scm -gnuradio/audio_portaudio.scm: audio_portaudio.i -gnuradio/audio_portaudio-primitive.scm: gnuradio/audio_portaudio.scm - -# Include the guile dependencies for this file --include guile/audio_portaudio.d - -endif # end of GUILE - - diff --git a/gr-audio-portaudio/src/audio_portaudio.i b/gr-audio-portaudio/src/audio_portaudio.i deleted file mode 100644 index 612b0afff..000000000 --- a/gr-audio-portaudio/src/audio_portaudio.i +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 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. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_portaudio_sink.h" -#include "audio_portaudio_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_portaudio,source) - -audio_portaudio_source_sptr -audio_portaudio_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_portaudio_source : public gr_sync_block { - - protected: - audio_portaudio_source (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_portaudio_source (); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_portaudio,sink) - -audio_portaudio_sink_sptr -audio_portaudio_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_portaudio_sink : public gr_sync_block { - - protected: - audio_portaudio_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_portaudio_sink (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_portaudio" "scm_init_gnuradio_audio_portaudio_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-portaudio/src/qa_portaudio.py b/gr-audio-portaudio/src/qa_portaudio.py deleted file mode 100755 index 20731f38d..000000000 --- a/gr-audio-portaudio/src/qa_portaudio.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2010 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. -# - -from gnuradio import gr, gr_unittest -import audio_portaudio - -class test_audio_portaudio (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have PORTAUDIO drivers, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.run(test_audio_portaudio, "test_audio_portaudio.xml") diff --git a/gr-audio-portaudio/src/run_tests.in b/gr-audio-portaudio/src/run_tests.in deleted file mode 100644 index 0b483dbcf..000000000 --- a/gr-audio-portaudio/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-portaudio \ - @abs_top_builddir@/gr-audio-portaudio \ - @srcdir@ diff --git a/gr-audio-windows/.gitignore b/gr-audio-windows/.gitignore deleted file mode 100644 index 53edad32f..000000000 --- a/gr-audio-windows/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 -/stamp-h1.in -/stamp-h2.in diff --git a/gr-audio-windows/README b/gr-audio-windows/README deleted file mode 100644 index 4564c7c7b..000000000 --- a/gr-audio-windows/README +++ /dev/null @@ -1,66 +0,0 @@ - -# Copyright 2001,2005 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. - -gr-audio-windows will add an audio-sink to gnuradio for windows - -Requirements for building: -make sure you have the following installed: -mingw -libtool (recent version ,built yourself, (if needed remove old libtool macros from /usr/share/aclocal)) -msys -python2.4 (just install the prebuild binary for windows) -boost (built yourself, maybe just unpacking the source somewhere will do, we only use header files) -cppunit (built yourself) -gnuradio-core (built with mingw) - -Building: -sources from cvs: -edit bootstrap to your needs (see below for example) -./bootstrap -./configure /configure --with-cppunit-prefix=/whereiscppunit --with-boost-include-dir=/c/whereisboost PYTHON=/c/Python24/python am_cv_python_pythondir=/c/Python24/Lib/site-packages am_cv_python_pyexecdir=/c/Python24/Lib/site-packages -make -make check -make install - - -If you have multiple versions of aclocal then edit bootstrap and change aclocal and automake to the latest version - -You really need a recent libtool to get this built on mingw. -If you build it with default options it will be placed in /usr/local, but the default libtool will still be in /usr. -This will result in old m4 macros will be used by aclocal. -So if you have a more recent libtool installed in /usr/local add -I /usr/local/share/aclocal to the aclocal commandline in bootstrap. -(And add any other directories with the most recent m4 macros) -You could also uninstall (delete) the old libtool macros in /usr/share/aclocal - -bootstrap example: - -!/bin/sh -rm -fr config.cache autom4te*.cache -aclocal-1.8 -I /usr/local/share/aclocal -I config -autoconf -autoheader -libtoolize --automake -automake-1.8 --add-missing - - -configuration example: -./configure --with-cppunit-prefix=/usr/local --with-boost-include-dir=/d/boost_1_32_0/include/boost-1_32 PYTHON=/d/Python24/python am_cv_python_pythondir=/d/Python24/Lib/site-packages am_cv_python_pyexecdir=/d/Python24/Lib/site-packages - -Martin Dvh, juli 2005 diff --git a/gr-audio-windows/src/.gitignore b/gr-audio-windows/src/.gitignore deleted file mode 100644 index 7f6631569..000000000 --- a/gr-audio-windows/src/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 -/stamp-h1.in -/stamp-h2.in -/run_tests -/audio_windows.cc -/audio_windows.py -/gnuradio -/guile -/python diff --git a/gr-audio-windows/src/Makefile.am b/gr-audio-windows/src/Makefile.am deleted file mode 100644 index 1d7b253ec..000000000 --- a/gr-audio-windows/src/Makefile.am +++ /dev/null @@ -1,72 +0,0 @@ -# -# Copyright 2004,2005,2008,2009 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. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -DISTCLEANFILES += run_tests -EXTRA_DIST += run_tests.in - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -noinst_PYTHON = qa_audio_windows.py - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_windows_sink.h \ - audio_windows_source.h - -lib_LTLIBRARIES = libgnuradio-audio-windows.la - -libgnuradio_audio_windows_la_SOURCES = \ - audio_windows_sink.cc \ - audio_windows_source.cc - -libgnuradio_audio_windows_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(WINAUDIO_LIBS) - -libgnuradio_audio_windows_la_LDFLAGS = \ - $(LIBGNURADIO_CORE_EXTRA_LDFLAGS) \ - $(NO_UNDEFINED) \ - $(LTVERSIONFLAGS) - -################################### -# SWIG interface and library - -TOP_SWIG_IFILES = \ - audio_windows.i - -# Install so that they end up available as: -# import gnuradio.audio_windows -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_windows_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_windows_la_swig_libadd = \ - libgnuradio-audio-windows.la - -if PYTHON -TESTS += run_tests -endif diff --git a/gr-audio-windows/src/Makefile.swig.gen b/gr-audio-windows/src/Makefile.swig.gen deleted file mode 100644 index cc21f30bc..000000000 --- a/gr-audio-windows/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 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. -# - -# Makefile.swig.gen for audio_windows.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_windows -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_windows -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_windows_pythondir_category ?= gnuradio/audio_windows -audio_windows_pylibdir_category ?= $(audio_windows_pythondir_category) -audio_windows_pythondir = $(pythondir)/$(audio_windows_pythondir_category) -audio_windows_pylibdir = $(pyexecdir)/$(audio_windows_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_windows_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_windows -# FIXME: determince whether these should be installed with gnuradio. -audio_windows_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_windows_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_windows_swiginclude_HEADERS = \ - audio_windows.i \ - $(audio_windows_swiginclude_headers) - -if PYTHON -audio_windows_pylib_LTLIBRARIES = \ - _audio_windows.la - -_audio_windows_la_SOURCES = \ - python/audio_windows.cc \ - $(audio_windows_la_swig_sources) - -audio_windows_python_PYTHON = \ - audio_windows.py \ - $(audio_windows_python) - -_audio_windows_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_windows_la_swig_libadd) - -_audio_windows_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_windows_la_swig_ldflags) - -_audio_windows_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_windows_la_swig_cxxflags) - -python/audio_windows.cc: audio_windows.py -audio_windows.py: audio_windows.i - -# Include the python dependencies for this file --include python/audio_windows.d - -endif # end of if python - -if GUILE - -audio_windows_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_windows.la -libguile_gnuradio_audio_windows_la_SOURCES = \ - guile/audio_windows.cc \ - $(audio_windows_la_swig_sources) -nobase_audio_windows_scm_DATA = \ - gnuradio/audio_windows.scm \ - gnuradio/audio_windows-primitive.scm -libguile_gnuradio_audio_windows_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_windows_la_swig_libadd) -libguile_gnuradio_audio_windows_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_windows_la_swig_ldflags) -libguile_gnuradio_audio_windows_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_windows_la_swig_cxxflags) - -guile/audio_windows.cc: gnuradio/audio_windows.scm -gnuradio/audio_windows.scm: audio_windows.i -gnuradio/audio_windows-primitive.scm: gnuradio/audio_windows.scm - -# Include the guile dependencies for this file --include guile/audio_windows.d - -endif # end of GUILE - - diff --git a/gr-audio-windows/src/audio_windows.i b/gr-audio-windows/src/audio_windows.i deleted file mode 100644 index c154eacd6..000000000 --- a/gr-audio-windows/src/audio_windows.i +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 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. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_windows_sink.h" -#include "audio_windows_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_windows,sink) - -audio_windows_sink_sptr -audio_windows_make_sink (int sampling_freq, - const std::string dev = "" - ) throw (std::runtime_error); - - -class audio_windows_sink : public gr_sync_block { - protected: - audio_windows_sink (int sampling_freq, const std::string device_name = ""); - - public: - ~audio_windows_sink (); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_windows,source) - -audio_windows_source_sptr -audio_windows_make_source (int sampling_freq, - const std::string dev = "" - ) throw (std::runtime_error); - -class audio_windows_source : public gr_sync_block { - protected: - audio_windows_source (int sampling_freq, const std::string device_name = ""); - - public: - ~audio_windows_source (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_windows" "scm_init_gnuradio_audio_windows_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-windows/src/qa_audio_windows.py b/gr-audio-windows/src/qa_audio_windows.py deleted file mode 100755 index 0d14535a6..000000000 --- a/gr-audio-windows/src/qa_audio_windows.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007 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. -# - -from gnuradio import gr, gr_unittest -import audio_windows - -class qa_oss (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have audio drivers, soundcard, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.main () diff --git a/gr-audio-windows/src/run_tests.in b/gr-audio-windows/src/run_tests.in deleted file mode 100755 index f7de663ba..000000000 --- a/gr-audio-windows/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-windows \ - @abs_top_builddir@/gr-audio-windows \ - @srcdir@ diff --git a/gr-audio/.gitignore b/gr-audio/.gitignore new file mode 100644 index 000000000..a37fc0c1a --- /dev/null +++ b/gr-audio/.gitignore @@ -0,0 +1,3 @@ +/Makefile +/Makefile.in +/*.pc diff --git a/gr-audio-oss/Makefile.am b/gr-audio/Makefile.am index c55d3ecb7..bb0d05d07 100644 --- a/gr-audio-oss/Makefile.am +++ b/gr-audio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2006 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,14 +17,15 @@ # 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. -# +# include $(top_srcdir)/Makefile.common -SUBDIRS = src +SUBDIRS = include lib -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-oss.pc +if PYTHON +SUBDIRS += grc swig +endif -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-oss.conf +pkgconfigdir = $(libdir)/pkgconfig +dist_pkgconfig_DATA = gnuradio-audio.pc diff --git a/gr-audio/README b/gr-audio/README new file mode 100644 index 000000000..ae929a94a --- /dev/null +++ b/gr-audio/README @@ -0,0 +1,11 @@ +The gnuradio audio component provides an audio_source and audio_sink block. +The audio blocks stream floating point samples to and from audio hardware. + +The gr-audio will be built automatically when gnuradio-core is enabled. +Support for underlying audio architectures depends on OS and installed libraries. +At the time of writing, gr-audio supports oss, alsa, jack, portaudio, audiounit, and winmm. + +At runtime, gr-audio will automatically select from the available architectures. +The user can override the selection via configuration file by setting "audio_module" +to one of the following strings: oss, alsa, jack, portaudio, osx, or windows. +See gr-audio.conf for an example. diff --git a/gr-audio-oss/gnuradio-audio-oss.pc.in b/gr-audio/gnuradio-audio.pc.in index 4a215bdab..1cd6d4051 100644 --- a/gr-audio-oss/gnuradio-audio-oss.pc.in +++ b/gr-audio/gnuradio-audio.pc.in @@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: gnuradio-audio-oss -Description: The GNU Radio block for the OSS sound system +Name: gnuradio-audio +Description: The GNU Radio block for all supported audio sound systems Requires: gnuradio-core Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-oss +Libs: -L${libdir} -lgnuradio-audio Cflags: -I${includedir} diff --git a/gr-audio/grc/.gitignore b/gr-audio/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-jack/Makefile.am b/gr-audio/grc/Makefile.am index cdc1433db..36d9daa7a 100644 --- a/gr-audio-jack/Makefile.am +++ b/gr-audio/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2009 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,10 +21,9 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = src +grcblocksdir = $(grc_blocksdir) -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-jack.pc +dist_grcblocks_DATA = \ + audio_source.xml \ + audio_sink.xml -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-jack.conf diff --git a/grc/blocks/audio_sink.xml b/gr-audio/grc/audio_sink.xml index 75d583470..26e199d61 100644 --- a/grc/blocks/audio_sink.xml +++ b/gr-audio/grc/audio_sink.xml @@ -7,12 +7,13 @@ <block> <name>Audio Sink</name> <key>audio_sink</key> + <category>Sinks</category> <import>from gnuradio import audio</import> <make>audio.sink($samp_rate, $device_name, $ok_to_block)</make> <param> <name>Sample Rate</name> <key>samp_rate</key> - <value>32000</value> + <value>samp_rate</value> <type>int</type> <option> <name>16KHz</name> diff --git a/grc/blocks/audio_source.xml b/gr-audio/grc/audio_source.xml index 1f5d1033e..59b375244 100644 --- a/grc/blocks/audio_source.xml +++ b/gr-audio/grc/audio_source.xml @@ -7,12 +7,13 @@ <block> <name>Audio Source</name> <key>audio_source</key> + <category>Sources</category> <import>from gnuradio import audio</import> <make>audio.source($samp_rate, $device_name, $ok_to_block)</make> <param> <name>Sample Rate</name> <key>samp_rate</key> - <value>32000</value> + <value>samp_rate</value> <type>int</type> <option> <name>16KHz</name> diff --git a/gr-audio/include/.gitignore b/gr-audio/include/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/include/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-osx/Makefile.am b/gr-audio/include/Makefile.am index 84a4c69b3..a4db27d08 100644 --- a/gr-audio-osx/Makefile.am +++ b/gr-audio/include/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2006,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,9 +17,11 @@ # 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. -# +# include $(top_srcdir)/Makefile.common -EXTRA_DIST += README_OSX -SUBDIRS = src +grinclude_HEADERS = \ + gr_audio_api.h \ + gr_audio_source.h \ + gr_audio_sink.h diff --git a/gnuradio-examples/c++/dial_tone/dial_tone.h b/gr-audio/include/gr_audio_api.h index c645439bb..b21819bab 100644 --- a/gnuradio-examples/c++/dial_tone/dial_tone.h +++ b/gr-audio/include/gr_audio_api.h @@ -1,5 +1,5 @@ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,15 +19,13 @@ * Boston, MA 02110-1301, USA. */ -#include <gr_top_block.h> +#ifndef INCLUDED_GR_AUDIO_API_H +#define INCLUDED_GR_AUDIO_API_H -class dial_tone; -typedef boost::shared_ptr<dial_tone> dial_tone_sptr; -dial_tone_sptr make_dial_tone(); +#ifdef gnuradio_audio_EXPORTS +# define GR_AUDIO_API //FIXME needs attributes defines +#else +# define GR_AUDIO_API //FIXME needs attributes defines +#endif -class dial_tone : public gr_top_block -{ -private: - dial_tone(); - friend dial_tone_sptr make_dial_tone(); -}; +#endif /* INCLUDED_GR_AUDIO_API_H */ diff --git a/gnuradio-examples/c++/dial_tone/main.cc b/gr-audio/include/gr_audio_sink.h index a09bd8288..c76ec6550 100644 --- a/gnuradio-examples/c++/dial_tone/main.cc +++ b/gr-audio/include/gr_audio_sink.h @@ -1,5 +1,5 @@ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,17 +19,28 @@ * Boston, MA 02110-1301, USA. */ -// GNU Radio C++ application -// -// Instantiate a top block -// Instantiate a runtime, passing it the top block -// Tell the runtime to go... +#ifndef INCLUDED_GR_AUDIO_SINK_H +#define INCLUDED_GR_AUDIO_SINK_H -#include <dial_tone.h> +#include <gr_audio_api.h> +#include <gr_sync_block.h> -int main() -{ - dial_tone_sptr top_block = make_dial_tone(); - top_block->run(); - return 0; -} +class GR_AUDIO_API audio_sink : public gr_sync_block{ +public: + typedef boost::shared_ptr<audio_sink> sptr; + + audio_sink( + const std::string &name, + gr_io_signature_sptr insig, + gr_io_signature_sptr outsig + ); + +}; + +GR_AUDIO_API audio_sink::sptr audio_make_sink( + int sampling_rate, + const std::string device_name = "", + bool ok_to_block = true +); + +#endif /* INCLUDED_GR_AUDIO_SINK_H */ diff --git a/gnuradio-examples/c++/dial_tone/dial_tone.cc b/gr-audio/include/gr_audio_source.h index 9a2772a18..ed3c31c10 100644 --- a/gnuradio-examples/c++/dial_tone/dial_tone.cc +++ b/gr-audio/include/gr_audio_source.h @@ -1,5 +1,5 @@ /* - * Copyright 2006,2008 Free Software Foundation, Inc. + * Copyright 2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,25 +19,28 @@ * Boston, MA 02110-1301, USA. */ -#include <dial_tone.h> -#include <gr_io_signature.h> -#include <gr_sig_source_f.h> -#include <audio_alsa_sink.h> +#ifndef INCLUDED_GR_AUDIO_SOURCE_H +#define INCLUDED_GR_AUDIO_SOURCE_H -// Shared pointer constructor -dial_tone_sptr make_dial_tone() -{ - return gnuradio::get_initial_sptr(new dial_tone()); -} +#include <gr_audio_api.h> +#include <gr_sync_block.h> -// Hierarchical block constructor, with no inputs or outputs -dial_tone::dial_tone() : - gr_top_block("dial_tone") -{ - gr_sig_source_f_sptr src0 = gr_make_sig_source_f(48000, GR_SIN_WAVE, 350, 0.1); - gr_sig_source_f_sptr src1 = gr_make_sig_source_f(48000, GR_SIN_WAVE, 440, 0.1); - audio_alsa_sink_sptr sink = audio_alsa_make_sink(48000); +class GR_AUDIO_API audio_source : public gr_sync_block{ +public: + typedef boost::shared_ptr<audio_source> sptr; - connect(src0, 0, sink, 0); - connect(src1, 0, sink, 1); -} + audio_source( + const std::string &name, + gr_io_signature_sptr insig, + gr_io_signature_sptr outsig + ); + +}; + +GR_AUDIO_API audio_source::sptr audio_make_source( + int sampling_rate, + const std::string device_name = "", + bool ok_to_block = true +); + +#endif /* INCLUDED_GR_AUDIO_SOURCE_H */ diff --git a/gr-audio/lib/.gitignore b/gr-audio/lib/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/lib/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio/lib/Makefile.am b/gr-audio/lib/Makefile.am new file mode 100644 index 000000000..42a2b867b --- /dev/null +++ b/gr-audio/lib/Makefile.am @@ -0,0 +1,179 @@ +# +# 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. +# + +include $(top_srcdir)/Makefile.common + +AM_CPPFLAGS = \ + $(STD_DEFINES_AND_INCLUDES) \ + $(WITH_INCLUDES) \ + -I$(abs_top_srcdir)/gr-audio/include \ + -Dgnuradio_audio_EXPORTS + +lib_LTLIBRARIES = libgnuradio-audio.la + +libgnuradio_audio_la_SOURCES = \ + gr_audio_registry.cc + +libgnuradio_audio_la_LIBADD = \ + $(GNURADIO_CORE_LA) + +libgnuradio_audio_la_LDFLAGS = $(LTVERSIONFLAGS) + +noinst_HEADERS = gr_audio_registry.h + +etcdir = $(gr_prefsdir) +dist_etc_DATA = gr-audio.conf + +######################################################################## +## ALSA Support +######################################################################## +if GR_AUDIO_ALSA_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/alsa \ + $(ALSA_CPPFLAGS) + +libgnuradio_audio_la_LIBADD += $(ALSA_LIBS) + +libgnuradio_audio_la_SOURCES += \ + alsa/gri_alsa.cc \ + alsa/audio_alsa_source.cc \ + alsa/audio_alsa_sink.cc + +noinst_HEADERS += \ + alsa/gri_alsa.h \ + alsa/audio_alsa_source.h \ + alsa/audio_alsa_sink.h + +dist_etc_DATA += alsa/gr-audio-alsa.conf + +endif + +######################################################################## +## OSS Support +######################################################################## +if GR_AUDIO_OSS_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/oss + +libgnuradio_audio_la_LIBADD += $(OSS_LIBS) + +libgnuradio_audio_la_SOURCES += \ + oss/audio_oss_source.cc \ + oss/audio_oss_sink.cc + +noinst_HEADERS += \ + oss/audio_oss_source.h \ + oss/audio_oss_sink.h + +dist_etc_DATA += oss/gr-audio-oss.conf + +endif + +######################################################################## +## Jack Support +######################################################################## +if GR_AUDIO_JACK_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/jack \ + $(JACK_CPPFLAGS) + +libgnuradio_audio_la_LIBADD += $(JACK_LIBS) + +libgnuradio_audio_la_SOURCES += \ + jack/gri_jack.cc \ + jack/audio_jack_source.cc \ + jack/audio_jack_sink.cc + +noinst_HEADERS += \ + jack/gri_jack.h \ + jack/audio_jack_source.h \ + jack/audio_jack_sink.h + +dist_etc_DATA += jack/gr-audio-jack.conf + +endif + +######################################################################## +## OSX Support +######################################################################## +if GR_AUDIO_OSX_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/osx + +libgnuradio_audio_la_SOURCES += \ + osx/audio_osx_source.cc \ + osx/audio_osx_sink.cc + +noinst_HEADERS += \ + osx/audio_osx.h \ + osx/audio_osx_source.h \ + osx/audio_osx_sink.h + +endif + +######################################################################## +## PortAudio Support +######################################################################## +if GR_AUDIO_PORTAUDIO_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/portaudio \ + $(PORTAUDIO_CPPFLAGS) + +libgnuradio_audio_la_LIBADD += $(PORTAUDIO_LIBS) + +libgnuradio_audio_la_SOURCES += \ + portaudio/gri_portaudio.cc \ + portaudio/audio_portaudio_source.cc \ + portaudio/audio_portaudio_sink.cc + +noinst_HEADERS += \ + portaudio/gri_portaudio.h \ + portaudio/audio_portaudio_source.h \ + portaudio/audio_portaudio_sink.h + +dist_etc_DATA += portaudio/gr-audio-portaudio.conf + +endif + +######################################################################## +## Windows Support +######################################################################## +if GR_AUDIO_WINDOWS_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/windows + +libgnuradio_audio_la_LIBADD += $(WINAUDIO_LIBS) + +libgnuradio_audio_la_SOURCES += \ + windows/audio_windows_source.cc \ + windows/audio_windows_sink.cc + +noinst_HEADERS += \ + windows/audio_windows_source.h \ + windows/audio_windows_sink.h + +endif diff --git a/gr-audio-alsa/src/audio_alsa_sink.cc b/gr-audio/lib/alsa/audio_alsa_sink.cc index d44a93b3f..0728f421c 100644 --- a/gr-audio-alsa/src/audio_alsa_sink.cc +++ b/gr-audio/lib/alsa/audio_alsa_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_alsa_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -32,6 +33,11 @@ #include <stdexcept> #include <gri_alsa.h> +AUDIO_REGISTER_SINK(REG_PRIO_HIGH, alsa)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_alsa_sink(sampling_rate, device_name, ok_to_block)); +} static bool CHATTY_DEBUG = false; @@ -65,19 +71,10 @@ default_nperiods () // ---------------------------------------------------------------- -audio_alsa_sink_sptr -audio_alsa_make_sink (int sampling_rate, - const std::string dev, - bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_alsa_sink (sampling_rate, dev, - ok_to_block)); -} - audio_alsa_sink::audio_alsa_sink (int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_alsa_sink", + : audio_sink ("audio_alsa_sink", gr_make_io_signature (0, 0, 0), gr_make_io_signature (0, 0, 0)), d_sampling_rate (sampling_rate), diff --git a/gr-audio-alsa/src/audio_alsa_sink.h b/gr-audio/lib/alsa/audio_alsa_sink.h index f3007f60f..23e406d6b 100644 --- a/gr-audio-alsa/src/audio_alsa_sink.h +++ b/gr-audio/lib/alsa/audio_alsa_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,27 +27,11 @@ #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> #include <alsa/asoundlib.h> #include <stdexcept> - -class audio_alsa_sink; -typedef boost::shared_ptr<audio_alsa_sink> audio_alsa_sink_sptr; - -/*! - * \brief make an alsa audio sink. - * - * \param sampling_rate sampling rate in Hz - * \param device_name ALSA pcm device name, e.g., "hw:0,0" - * \param ok_to_block (currently ignored) - */ -audio_alsa_sink_sptr -audio_alsa_make_sink (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - /*! * \brief audio sink using ALSA * @@ -56,11 +40,7 @@ audio_alsa_make_sink (int sampling_rate, * * Input samples must be in the range [-1,1]. */ -class audio_alsa_sink : public gr_sync_block { - friend audio_alsa_sink_sptr - audio_alsa_make_sink (int sampling_rate, const std::string device_name, - bool ok_to_block); - +class audio_alsa_sink : public audio_sink { // typedef for pointer to class work method typedef int (audio_alsa_sink::*work_t)(int noutput_items, gr_vector_const_void_star &input_items, @@ -88,11 +68,10 @@ class audio_alsa_sink : public gr_sync_block { void output_error_msg (const char *msg, int err); void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_alsa_sink (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_alsa_sink (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-alsa/src/audio_alsa_source.cc b/gr-audio/lib/alsa/audio_alsa_source.cc index 7b3d91b9d..e46a7fdd4 100644 --- a/gr-audio-alsa/src/audio_alsa_source.cc +++ b/gr-audio/lib/alsa/audio_alsa_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_alsa_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -32,6 +33,11 @@ #include <stdexcept> #include <gri_alsa.h> +AUDIO_REGISTER_SOURCE(REG_PRIO_HIGH, alsa)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_alsa_source(sampling_rate, device_name, ok_to_block)); +} static bool CHATTY_DEBUG = false; @@ -64,18 +70,10 @@ default_nperiods () // ---------------------------------------------------------------- -audio_alsa_source_sptr -audio_alsa_make_source (int sampling_rate, const std::string dev, - bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_alsa_source (sampling_rate, dev, - ok_to_block)); -} - audio_alsa_source::audio_alsa_source (int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_alsa_source", + : audio_source ("audio_alsa_source", gr_make_io_signature (0, 0, 0), gr_make_io_signature (0, 0, 0)), d_sampling_rate (sampling_rate), diff --git a/gr-audio-alsa/src/audio_alsa_source.h b/gr-audio/lib/alsa/audio_alsa_source.h index db6c45683..e38af3872 100644 --- a/gr-audio-alsa/src/audio_alsa_source.h +++ b/gr-audio/lib/alsa/audio_alsa_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,7 +27,7 @@ #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> #include <alsa/asoundlib.h> #include <stdexcept> @@ -36,18 +36,6 @@ class audio_alsa_source; typedef boost::shared_ptr<audio_alsa_source> audio_alsa_source_sptr; /*! - * \brief Make an ALSA audio source. - * - * \param sampling_rate sampling rate - * \param device_name ALSA pcm device name, e.g., "hw:0,0" - * \param ok_to_block (currently ignored) - */ -audio_alsa_source_sptr -audio_alsa_make_source (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - -/*! * \brief audio source using ALSA * * The source has between 1 and N input streams of floats, where N is @@ -55,12 +43,7 @@ audio_alsa_make_source (int sampling_rate, * * Output samples will be in the range [-1,1]. */ -class audio_alsa_source : public gr_sync_block { - friend audio_alsa_source_sptr - audio_alsa_make_source (int sampling_rate, - const std::string device_name, - bool ok_to_block); - +class audio_alsa_source : public audio_source { // typedef for pointer to class work method typedef int (audio_alsa_source::*work_t)(int noutput_items, gr_vector_const_void_star &input_items, @@ -88,11 +71,10 @@ class audio_alsa_source : public gr_sync_block { void output_error_msg (const char *msg, int err); void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_alsa_source (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_alsa_source (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-alsa/gr-audio-alsa.conf b/gr-audio/lib/alsa/gr-audio-alsa.conf index 5cec63e7a..5cec63e7a 100644 --- a/gr-audio-alsa/gr-audio-alsa.conf +++ b/gr-audio/lib/alsa/gr-audio-alsa.conf diff --git a/gr-audio-alsa/src/gri_alsa.cc b/gr-audio/lib/alsa/gri_alsa.cc index d9fda0f7d..d9fda0f7d 100644 --- a/gr-audio-alsa/src/gri_alsa.cc +++ b/gr-audio/lib/alsa/gri_alsa.cc diff --git a/gr-audio-alsa/src/gri_alsa.h b/gr-audio/lib/alsa/gri_alsa.h index 3d72fd950..3d72fd950 100644 --- a/gr-audio-alsa/src/gri_alsa.h +++ b/gr-audio/lib/alsa/gri_alsa.h diff --git a/gr-audio/lib/gr-audio.conf b/gr-audio/lib/gr-audio.conf new file mode 100644 index 000000000..9a7007656 --- /dev/null +++ b/gr-audio/lib/gr-audio.conf @@ -0,0 +1,7 @@ +# This file contains system wide configuration data for GNU Radio. +# You may override any setting on a per-user basis by editing +# ~/.gnuradio/config.conf + +[audio] + +audio_module = auto diff --git a/gr-audio/lib/gr_audio_registry.cc b/gr-audio/lib/gr_audio_registry.cc new file mode 100644 index 000000000..c47db8289 --- /dev/null +++ b/gr-audio/lib/gr_audio_registry.cc @@ -0,0 +1,153 @@ +/* + * 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. + */ + +#include "gr_audio_registry.h" +#include <boost/foreach.hpp> +#include <gr_prefs.h> +#include <stdexcept> +#include <vector> +#include <iostream> + +/*********************************************************************** + * Create registries + **********************************************************************/ + +struct source_entry_t{ + reg_prio_type prio; + std::string arch; + source_factory_t source; +}; + +static std::vector<source_entry_t> &get_source_registry(void){ + static std::vector<source_entry_t> _registry; + return _registry; +} + +struct sink_entry_t{ + reg_prio_type prio; + std::string arch; + sink_factory_t sink; +}; + +static std::vector<sink_entry_t> &get_sink_registry(void){ + static std::vector<sink_entry_t> _registry; + return _registry; +} + +/*********************************************************************** + * Register functions + **********************************************************************/ +void audio_register_source( + reg_prio_type prio, const std::string &arch, source_factory_t source +){ + source_entry_t entry; + entry.prio = prio; + entry.arch = arch; + entry.source = source; + get_source_registry().push_back(entry); +} + +void audio_register_sink( + reg_prio_type prio, const std::string &arch, sink_factory_t sink +){ + sink_entry_t entry; + entry.prio = prio; + entry.arch = arch; + entry.sink = sink; + get_sink_registry().push_back(entry); +} + +/*********************************************************************** + * Factory functions + **********************************************************************/ +static std::string default_arch_name(void){ + return gr_prefs::singleton()->get_string("audio", "audio_module", "auto"); +} + +static void do_arch_warning(const std::string &arch){ + if (arch == "auto") return; //no warning when arch not specified + std::cerr << "Could not find audio architecture \"" << arch << "\" in registry." << std::endl; + std::cerr << " Defaulting to the first available architecture..." << std::endl; +} + +audio_source::sptr audio_make_source( + int sampling_rate, + const std::string device_name, + bool ok_to_block +){ + if (get_source_registry().empty()){ + throw std::runtime_error("no available audio source factories"); + } + + std::string arch = default_arch_name(); + source_entry_t entry = get_source_registry().front(); + + BOOST_FOREACH(const source_entry_t &e, get_source_registry()){ + if (e.prio > entry.prio) entry = e; //entry is highest prio + if (arch != e.arch) continue; //continue when no match + return e.source(sampling_rate, device_name, ok_to_block); + } + //std::cout << "Audio source arch: " << entry.name << std::endl; + return entry.source(sampling_rate, device_name, ok_to_block); +} + +audio_sink::sptr audio_make_sink( + int sampling_rate, + const std::string device_name, + bool ok_to_block +){ + if (get_sink_registry().empty()){ + throw std::runtime_error("no available audio sink factories"); + } + + std::string arch = default_arch_name(); + sink_entry_t entry = get_sink_registry().front(); + + BOOST_FOREACH(const sink_entry_t &e, get_sink_registry()){ + if (e.prio > entry.prio) entry = e; //entry is highest prio + if (arch != e.arch) continue; //continue when no match + return e.sink(sampling_rate, device_name, ok_to_block); + } + do_arch_warning(arch); + //std::cout << "Audio sink arch: " << entry.name << std::endl; + return entry.sink(sampling_rate, device_name, ok_to_block); +} + +/*********************************************************************** + * Default constructors + **********************************************************************/ +#include <gr_io_signature.h> + +audio_sink::audio_sink( + const std::string &name, + gr_io_signature_sptr insig, + gr_io_signature_sptr outsig +): + gr_sync_block(name, insig, outsig) +{} + +audio_source::audio_source( + const std::string &name, + gr_io_signature_sptr insig, + gr_io_signature_sptr outsig +): + gr_sync_block(name, insig, outsig) +{} diff --git a/gr-audio/lib/gr_audio_registry.h b/gr-audio/lib/gr_audio_registry.h new file mode 100644 index 000000000..ec341e95e --- /dev/null +++ b/gr-audio/lib/gr_audio_registry.h @@ -0,0 +1,55 @@ +/* + * 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_GR_AUDIO_REGISTRY_H +#define INCLUDED_GR_AUDIO_REGISTRY_H + +#include <gr_audio_sink.h> +#include <gr_audio_source.h> +#include <string> + +typedef audio_source::sptr(*source_factory_t)(int, const std::string &, bool); +typedef audio_sink::sptr(*sink_factory_t)(int, const std::string &, bool); + +enum reg_prio_type{ + REG_PRIO_LOW = 100, + REG_PRIO_MED = 200, + REG_PRIO_HIGH = 300 +}; + +void audio_register_source(reg_prio_type prio, const std::string &arch, source_factory_t source); +void audio_register_sink(reg_prio_type prio, const std::string &arch, sink_factory_t sink); + +#define AUDIO_REGISTER_FIXTURE(x) static struct x{x();}x;x::x() + +#define AUDIO_REGISTER_SOURCE(prio, arch) \ + static audio_source::sptr arch##_source_fcn(int, const std::string &, bool); \ + AUDIO_REGISTER_FIXTURE(arch##_source_reg){ \ + audio_register_source(prio, #arch, &arch##_source_fcn); \ + } static audio_source::sptr arch##_source_fcn + +#define AUDIO_REGISTER_SINK(prio, arch) \ + static audio_sink::sptr arch##_sink_fcn(int, const std::string &, bool); \ + AUDIO_REGISTER_FIXTURE(arch##_sink_reg){ \ + audio_register_sink(prio, #arch, &arch##_sink_fcn); \ + } static audio_sink::sptr arch##_sink_fcn + +#endif /* INCLUDED_GR_AUDIO_REGISTRY_H */ diff --git a/gr-audio-jack/src/audio_jack_sink.cc b/gr-audio/lib/jack/audio_jack_sink.cc index f28fddc34..db365a1f8 100644 --- a/gr-audio-jack/src/audio_jack_sink.cc +++ b/gr-audio/lib/jack/audio_jack_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006,2010 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_jack_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -36,6 +37,12 @@ #include <pthread.h> #endif +AUDIO_REGISTER_SINK(REG_PRIO_MED, jack)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_jack_sink(sampling_rate, device_name, ok_to_block)); +} + typedef jack_default_audio_sample_t sample_t; @@ -84,17 +91,10 @@ jack_sink_process (jack_nframes_t nframes, void *arg) // ---------------------------------------------------------------- -audio_jack_sink_sptr -audio_jack_make_sink(int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_jack_sink (sampling_rate, dev, - ok_to_block)); -} - audio_jack_sink::audio_jack_sink (int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_jack_sink", + : audio_sink ("audio_jack_sink", gr_make_io_signature (0, 0, 0), gr_make_io_signature (0, 0, 0)), d_sampling_rate (sampling_rate), diff --git a/gr-audio-jack/src/audio_jack_sink.h b/gr-audio/lib/jack/audio_jack_sink.h index ac74cfc37..a11863ee0 100644 --- a/gr-audio-jack/src/audio_jack_sink.h +++ b/gr-audio/lib/jack/audio_jack_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,27 +22,12 @@ #ifndef INCLUDED_AUDIO_JACK_SINK_H #define INCLUDED_AUDIO_JACK_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> #include <jack/jack.h> #include <jack/ringbuffer.h> #include <stdexcept> -class audio_jack_sink; -typedef boost::shared_ptr<audio_jack_sink> audio_jack_sink_sptr; - -/*! - * \brief make an JACK audio sink. - * - * \param sampling_rate sampling rate in Hz - * \param device_name JACK device name, e.g., "gr_sink" - * \param ok_to_block - */ -audio_jack_sink_sptr -audio_jack_make_sink (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - int jack_sink_process (jack_nframes_t nframes, void *arg); /*! @@ -52,9 +37,7 @@ int jack_sink_process (jack_nframes_t nframes, void *arg); * * Input samples must be in the range [-1,1]. */ -class audio_jack_sink : public gr_sync_block { - friend audio_jack_sink_sptr - audio_jack_make_sink (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_jack_sink : public audio_sink { friend int jack_sink_process (jack_nframes_t nframes, void *arg); @@ -81,10 +64,9 @@ class audio_jack_sink : public gr_sync_block { void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_jack_sink (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_jack_sink (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-jack/src/audio_jack_source.cc b/gr-audio/lib/jack/audio_jack_source.cc index a92e970f5..415c7f22b 100644 --- a/gr-audio-jack/src/audio_jack_source.cc +++ b/gr-audio/lib/jack/audio_jack_source.cc @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_jack_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -36,6 +37,12 @@ #include <pthread.h> #endif +AUDIO_REGISTER_SOURCE(REG_PRIO_MED, jack)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_jack_source(sampling_rate, device_name, ok_to_block)); +} + typedef jack_default_audio_sample_t sample_t; @@ -85,16 +92,10 @@ jack_source_process (jack_nframes_t nframes, void *arg) // ---------------------------------------------------------------- -audio_jack_source_sptr -audio_jack_make_source (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_jack_source (sampling_rate, dev, ok_to_block)); -} - audio_jack_source::audio_jack_source (int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_jack_source", + : audio_source ("audio_jack_source", gr_make_io_signature (0, 0, 0), gr_make_io_signature (0, 0, 0)), d_sampling_rate (sampling_rate), diff --git a/gr-audio-jack/src/audio_jack_source.h b/gr-audio/lib/jack/audio_jack_source.h index 8831a7363..858f34528 100644 --- a/gr-audio-jack/src/audio_jack_source.h +++ b/gr-audio/lib/jack/audio_jack_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,27 +22,12 @@ #ifndef INCLUDED_AUDIO_JACK_SOURCE_H #define INCLUDED_AUDIO_JACK_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> #include <jack/jack.h> #include <jack/ringbuffer.h> #include <stdexcept> -class audio_jack_source; -typedef boost::shared_ptr<audio_jack_source> audio_jack_source_sptr; - -/*! - * \brief make a JACK audio source. - * - * \param sampling_rate sampling rate in Hz - * \param device_name JACK device name, e.g., "gr_source" - * \param ok_to_block - */ -audio_jack_source_sptr -audio_jack_make_source (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - int jack_source_process (jack_nframes_t nframes, void *arg); /*! @@ -52,9 +37,7 @@ int jack_source_process (jack_nframes_t nframes, void *arg); * * Output samples will be in the range [-1,1]. */ -class audio_jack_source : public gr_sync_block { - friend audio_jack_source_sptr - audio_jack_make_source (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_jack_source : public audio_source { friend int jack_source_process (jack_nframes_t nframes, void *arg); @@ -81,10 +64,9 @@ class audio_jack_source : public gr_sync_block { void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_jack_source (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_jack_source (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-jack/gr-audio-jack.conf b/gr-audio/lib/jack/gr-audio-jack.conf index bdbc1fd1d..bdbc1fd1d 100644 --- a/gr-audio-jack/gr-audio-jack.conf +++ b/gr-audio/lib/jack/gr-audio-jack.conf diff --git a/gr-audio-jack/src/gri_jack.cc b/gr-audio/lib/jack/gri_jack.cc index fef1c58a6..fef1c58a6 100644 --- a/gr-audio-jack/src/gri_jack.cc +++ b/gr-audio/lib/jack/gri_jack.cc diff --git a/gr-audio-jack/src/gri_jack.h b/gr-audio/lib/jack/gri_jack.h index ddc0b744d..ddc0b744d 100644 --- a/gr-audio-jack/src/gri_jack.h +++ b/gr-audio/lib/jack/gri_jack.h diff --git a/gr-audio-oss/src/audio_oss_sink.cc b/gr-audio/lib/oss/audio_oss_sink.cc index 8230ab9b6..4e9e7cd79 100644 --- a/gr-audio-oss/src/audio_oss_sink.cc +++ b/gr-audio/lib/oss/audio_oss_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_oss_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -37,6 +38,11 @@ #include <iostream> #include <stdexcept> +AUDIO_REGISTER_SINK(REG_PRIO_LOW, oss)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_oss_sink(sampling_rate, device_name, ok_to_block)); +} static std::string default_device_name () @@ -44,16 +50,10 @@ default_device_name () return gr_prefs::singleton()->get_string("audio_oss", "default_output_device", "/dev/dsp"); } -audio_oss_sink_sptr -audio_oss_make_sink (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_oss_sink (sampling_rate, dev, ok_to_block)); -} - audio_oss_sink::audio_oss_sink (int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_oss_sink", + : audio_sink ("audio_oss_sink", gr_make_io_signature (1, 2, sizeof (float)), gr_make_io_signature (0, 0, 0)), d_sampling_rate (sampling_rate), diff --git a/gr-audio-oss/src/audio_oss_sink.h b/gr-audio/lib/oss/audio_oss_sink.h index 052faac13..0d7280c2f 100644 --- a/gr-audio-oss/src/audio_oss_sink.h +++ b/gr-audio/lib/oss/audio_oss_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,18 +23,9 @@ #ifndef INCLUDED_AUDIO_OSS_SINK_H #define INCLUDED_AUDIO_OSS_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> - -class audio_oss_sink; -typedef boost::shared_ptr<audio_oss_sink> audio_oss_sink_sptr; - -audio_oss_sink_sptr -audio_oss_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true); - /*! * \brief audio sink using OSS * @@ -42,9 +33,7 @@ audio_oss_make_sink (int sampling_rate, * Input samples must be in the range [-1,1]. */ -class audio_oss_sink : public gr_sync_block { - friend audio_oss_sink_sptr - audio_oss_make_sink (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_oss_sink : public audio_sink { int d_sampling_rate; std::string d_device_name; @@ -52,10 +41,9 @@ class audio_oss_sink : public gr_sync_block { short *d_buffer; int d_chunk_size; - protected: +public: audio_oss_sink (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - public: ~audio_oss_sink (); int work (int noutput_items, diff --git a/gr-audio-oss/src/audio_oss_source.cc b/gr-audio/lib/oss/audio_oss_source.cc index fbb898f8c..b7d53931d 100644 --- a/gr-audio-oss/src/audio_oss_source.cc +++ b/gr-audio/lib/oss/audio_oss_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_oss_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -37,6 +38,11 @@ #include <iostream> #include <stdexcept> +AUDIO_REGISTER_SOURCE(REG_PRIO_LOW, oss)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_oss_source(sampling_rate, device_name, ok_to_block)); +} static std::string default_device_name () @@ -44,17 +50,10 @@ default_device_name () return gr_prefs::singleton()->get_string("audio_oss", "default_input_device", "/dev/dsp"); } -audio_oss_source_sptr -audio_oss_make_source (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_oss_source (sampling_rate, dev, ok_to_block)); -} - - audio_oss_source::audio_oss_source (int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_oss_source", + : audio_source ("audio_oss_source", gr_make_io_signature (0, 0, 0), gr_make_io_signature (1, 2, sizeof (float))), d_sampling_rate (sampling_rate), diff --git a/gr-audio-oss/src/audio_oss_source.h b/gr-audio/lib/oss/audio_oss_source.h index 22d4392e2..b20ef5c05 100644 --- a/gr-audio-oss/src/audio_oss_source.h +++ b/gr-audio/lib/oss/audio_oss_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,18 +23,9 @@ #ifndef INCLUDED_AUDIO_OSS_SOURCE_H #define INCLUDED_AUDIO_OSS_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> - -class audio_oss_source; -typedef boost::shared_ptr<audio_oss_source> audio_oss_source_sptr; - -audio_oss_source_sptr -audio_oss_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true); - /*! * \brief audio source using OSS * @@ -42,9 +33,7 @@ audio_oss_make_source (int sampling_rate, * Output samples will be in the range [-1,1]. */ -class audio_oss_source : public gr_sync_block { - friend audio_oss_source_sptr - audio_oss_make_source (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_oss_source : public audio_source { int d_sampling_rate; std::string d_device_name; @@ -52,12 +41,11 @@ class audio_oss_source : public gr_sync_block { short *d_buffer; int d_chunk_size; - protected: +public: audio_oss_source (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - public: ~audio_oss_source (); int work (int noutput_items, diff --git a/gr-audio-oss/gr-audio-oss.conf b/gr-audio/lib/oss/gr-audio-oss.conf index 6ea14d67e..6ea14d67e 100644 --- a/gr-audio-oss/gr-audio-oss.conf +++ b/gr-audio/lib/oss/gr-audio-oss.conf diff --git a/gr-audio-osx/src/audio_osx.h b/gr-audio/lib/osx/audio_osx.h index 79e79e36c..79e79e36c 100644 --- a/gr-audio-osx/src/audio_osx.h +++ b/gr-audio/lib/osx/audio_osx.h diff --git a/gr-audio-osx/src/audio_osx_sink.cc b/gr-audio/lib/osx/audio_osx_sink.cc index ec9b024e8..f7aeb54f8 100644 --- a/gr-audio-osx/src/audio_osx_sink.cc +++ b/gr-audio/lib/osx/audio_osx_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_osx_sink.h> #include <gr_io_signature.h> #include <stdexcept> @@ -31,12 +32,18 @@ #define _OSX_AU_DEBUG_ 0 +AUDIO_REGISTER_SINK(REG_PRIO_HIGH, osx)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_osx_sink(sampling_rate, device_name, ok_to_block)); +} + audio_osx_sink::audio_osx_sink (int sample_rate, const std::string device_name, bool do_block, int channel_config, int max_sample_count) - : gr_sync_block ("audio_osx_sink", + : audio_sink ("audio_osx_sink", gr_make_io_signature (0, 0, 0), gr_make_io_signature (0, 0, 0)), d_sample_rate (0.0), d_channel_config (0), d_n_channels (0), @@ -260,20 +267,6 @@ audio_osx_sink::~audio_osx_sink () d_internal = 0; } -audio_osx_sink_sptr -audio_osx_make_sink (int sampling_freq, - const std::string dev, - bool do_block, - int channel_config, - int max_sample_count) -{ - return gnuradio::get_initial_sptr(new audio_osx_sink (sampling_freq, - dev, - do_block, - channel_config, - max_sample_count)); -} - int audio_osx_sink::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gr-audio-osx/src/audio_osx_sink.h b/gr-audio/lib/osx/audio_osx_sink.h index a1a56502c..13bd95d53 100644 --- a/gr-audio-osx/src/audio_osx_sink.h +++ b/gr-audio/lib/osx/audio_osx_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -23,22 +23,12 @@ #ifndef INCLUDED_AUDIO_OSX_SINK_H #define INCLUDED_AUDIO_OSX_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> #include <list> #include <AudioUnit/AudioUnit.h> #include <circular_buffer.h> -class audio_osx_sink; -typedef boost::shared_ptr<audio_osx_sink> audio_osx_sink_sptr; - -audio_osx_sink_sptr -audio_osx_make_sink (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = true, - int channel_config = -1, - int max_sample_count = -1); - /*! * \brief audio sink using OSX * @@ -46,13 +36,7 @@ audio_osx_make_sink (int sample_rate = 44100, * Input samples must be in the range [-1,1]. */ -class audio_osx_sink : public gr_sync_block { - friend audio_osx_sink_sptr - audio_osx_make_sink (int sample_rate, - const std::string device_name, - bool do_block, - int channel_config, - int max_sample_count); +class audio_osx_sink : public audio_sink { Float64 d_sample_rate; int d_channel_config; @@ -66,14 +50,13 @@ class audio_osx_sink : public gr_sync_block { // AudioUnits and Such AudioUnit d_OutputAU; -protected: +public: audio_osx_sink (int sample_rate = 44100, const std::string device_name = "2", bool do_block = true, int channel_config = -1, int max_sample_count = -1); -public: ~audio_osx_sink (); bool IsRunning (); diff --git a/gr-audio-osx/src/audio_osx_source.cc b/gr-audio/lib/osx/audio_osx_source.cc index 757e65a9e..e380156d6 100644 --- a/gr-audio-osx/src/audio_osx_source.cc +++ b/gr-audio/lib/osx/audio_osx_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_osx_source.h> #include <gr_io_signature.h> #include <stdexcept> @@ -32,6 +33,12 @@ #define _OSX_AU_DEBUG_ 0 #define _OSX_DO_LISTENERS_ 0 +AUDIO_REGISTER_SOURCE(REG_PRIO_HIGH, osx)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_osx_source(sampling_rate, device_name, ok_to_block)); +} + void PrintStreamDesc (AudioStreamBasicDescription *inDesc) { if (inDesc == NULL) { @@ -58,7 +65,7 @@ audio_osx_source::audio_osx_source (int sample_rate, bool do_block, int channel_config, int max_sample_count) - : gr_sync_block ("audio_osx_source", + : audio_source ("audio_osx_source", gr_make_io_signature (0, 0, 0), gr_make_io_signature (0, 0, 0)), d_deviceSampleRate (0.0), d_outputSampleRate (0.0), @@ -607,20 +614,6 @@ audio_osx_source::~audio_osx_source () d_internal = 0; } -audio_osx_source_sptr -audio_osx_make_source (int sampling_freq, - const std::string device_name, - bool do_block, - int channel_config, - int max_sample_count) -{ - return gnuradio::get_initial_sptr(new audio_osx_source (sampling_freq, - device_name, - do_block, - channel_config, - max_sample_count)); -} - bool audio_osx_source::check_topology (int ninputs, int noutputs) { diff --git a/gr-audio-osx/src/audio_osx_source.h b/gr-audio/lib/osx/audio_osx_source.h index e8df47b16..754f0d928 100644 --- a/gr-audio-osx/src/audio_osx_source.h +++ b/gr-audio/lib/osx/audio_osx_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -23,22 +23,12 @@ #ifndef INCLUDED_AUDIO_OSX_SOURCE_H #define INCLUDED_AUDIO_OSX_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> #include <AudioToolbox/AudioToolbox.h> #include <AudioUnit/AudioUnit.h> #include <circular_buffer.h> -class audio_osx_source; -typedef boost::shared_ptr<audio_osx_source> audio_osx_source_sptr; - -audio_osx_source_sptr -audio_osx_make_source (int sample_rate = 44100, - const std::string device_name = "", - bool do_block = true, - int channel_config = -1, - int max_sample_count = -1); - /*! * \brief audio source using OSX * @@ -47,12 +37,6 @@ audio_osx_make_source (int sample_rate = 44100, */ class audio_osx_source : public gr_sync_block { - friend audio_osx_source_sptr - audio_osx_make_source (int sample_rate, - const std::string device_name, - bool do_block, - int channel_config, - int max_sample_count); Float64 d_deviceSampleRate, d_outputSampleRate; int d_channel_config; @@ -76,14 +60,13 @@ class audio_osx_source : public gr_sync_block { AudioBufferList* d_OutputBuffer; AudioConverterRef d_AudioConverter; -protected: +public: audio_osx_source (int sample_rate = 44100, const std::string device_name = "", bool do_block = true, int channel_config = -1, int max_sample_count = -1); -public: ~audio_osx_source (); bool start (); diff --git a/gr-audio-portaudio/src/audio_portaudio_sink.cc b/gr-audio/lib/portaudio/audio_portaudio_sink.cc index 64e64ccf4..515cd04d9 100644 --- a/gr-audio-portaudio/src/audio_portaudio_sink.cc +++ b/gr-audio/lib/portaudio/audio_portaudio_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_portaudio_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -34,6 +35,12 @@ #include <gri_portaudio.h> #include <string.h> +AUDIO_REGISTER_SINK(REG_PRIO_MED, portaudio)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_portaudio_sink(sampling_rate, device_name, ok_to_block)); +} + //#define LOGGING 0 // define to 0 or 1 #define SAMPLE_FORMAT paFloat32 @@ -120,17 +127,10 @@ portaudio_sink_callback (const void *inputBuffer, // ---------------------------------------------------------------- -audio_portaudio_sink_sptr -audio_portaudio_make_sink (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_portaudio_sink (sampling_rate, - dev, ok_to_block)); -} - audio_portaudio_sink::audio_portaudio_sink(int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_portaudio_sink", + : audio_sink ("audio_portaudio_sink", gr_make_io_signature(0, 0, 0), gr_make_io_signature(0, 0, 0)), d_sampling_rate(sampling_rate), diff --git a/gr-audio-portaudio/src/audio_portaudio_sink.h b/gr-audio/lib/portaudio/audio_portaudio_sink.h index 71cbfcf9f..6426a32ac 100644 --- a/gr-audio-portaudio/src/audio_portaudio_sink.h +++ b/gr-audio/lib/portaudio/audio_portaudio_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,7 +22,7 @@ #ifndef INCLUDED_AUDIO_PORTAUDIO_SINK_H #define INCLUDED_AUDIO_PORTAUDIO_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <gr_buffer.h> #include <gruel/thread.h> #include <string> @@ -30,21 +30,6 @@ #include <stdexcept> //#include <gri_logger.h> -class audio_portaudio_sink; -typedef boost::shared_ptr<audio_portaudio_sink> audio_portaudio_sink_sptr; - -/*! - * \brief PORTAUDIO audio sink. - * - * \param sampling_rate sampling rate in Hz - * \param device_name PORTAUDIO device name, e.g., "pa:" - * \param ok_to_block true if it's ok for us to block - */ -audio_portaudio_sink_sptr -audio_portaudio_make_sink (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - PaStreamCallback portaudio_sink_callback; @@ -53,11 +38,7 @@ PaStreamCallback portaudio_sink_callback; * * Input samples must be in the range [-1,1]. */ -class audio_portaudio_sink : public gr_sync_block { - friend audio_portaudio_sink_sptr - audio_portaudio_make_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block); +class audio_portaudio_sink : public audio_sink { friend PaStreamCallback portaudio_sink_callback; @@ -88,11 +69,10 @@ class audio_portaudio_sink : public gr_sync_block { void create_ringbuffer(); - protected: +public: audio_portaudio_sink (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_portaudio_sink (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-portaudio/src/audio_portaudio_source.cc b/gr-audio/lib/portaudio/audio_portaudio_source.cc index e508fda22..bdb8b3b3d 100644 --- a/gr-audio-portaudio/src/audio_portaudio_source.cc +++ b/gr-audio/lib/portaudio/audio_portaudio_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_portaudio_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -34,6 +35,12 @@ #include <gri_portaudio.h> #include <string.h> +AUDIO_REGISTER_SOURCE(REG_PRIO_MED, portaudio)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_portaudio_source(sampling_rate, device_name, ok_to_block)); +} + //#define LOGGING 0 // define to 0 or 1 #define SAMPLE_FORMAT paFloat32 @@ -119,17 +126,10 @@ portaudio_source_callback (const void *inputBuffer, // ---------------------------------------------------------------- -audio_portaudio_source_sptr -audio_portaudio_make_source (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_portaudio_source (sampling_rate, - dev, ok_to_block)); -} - audio_portaudio_source::audio_portaudio_source(int sampling_rate, const std::string device_name, bool ok_to_block) - : gr_sync_block ("audio_portaudio_source", + : audio_source ("audio_portaudio_source", gr_make_io_signature(0, 0, 0), gr_make_io_signature(0, 0, 0)), d_sampling_rate(sampling_rate), diff --git a/gr-audio-portaudio/src/audio_portaudio_source.h b/gr-audio/lib/portaudio/audio_portaudio_source.h index 31e70a127..245b3410b 100644 --- a/gr-audio-portaudio/src/audio_portaudio_source.h +++ b/gr-audio/lib/portaudio/audio_portaudio_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006.2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,28 +22,13 @@ #ifndef INCLUDED_AUDIO_PORTAUDIO_SOURCE_H #define INCLUDED_AUDIO_PORTAUDIO_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <gr_buffer.h> #include <gruel/thread.h> #include <string> #include <portaudio.h> #include <stdexcept> -class audio_portaudio_source; -typedef boost::shared_ptr<audio_portaudio_source> audio_portaudio_source_sptr; - -/*! - * \brief PORTAUDIO audio source. - * - * \param sampling_rate sampling rate in Hz - * \param device_name PORTAUDIO device name, e.g., "pa:" - * \param ok_to_block true if it's ok for us to block - */ -audio_portaudio_source_sptr -audio_portaudio_make_source (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - PaStreamCallback portaudio_source_callback; @@ -52,11 +37,7 @@ PaStreamCallback portaudio_source_callback; * * Input samples must be in the range [-1,1]. */ -class audio_portaudio_source : public gr_sync_block { - friend audio_portaudio_source_sptr - audio_portaudio_make_source (int sampling_rate, - const std::string device_name, - bool ok_to_block); +class audio_portaudio_source : public audio_source { friend PaStreamCallback portaudio_source_callback; @@ -86,11 +67,10 @@ class audio_portaudio_source : public gr_sync_block { void create_ringbuffer(); - protected: +public: audio_portaudio_source (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_portaudio_source (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-portaudio/gr-audio-portaudio.conf b/gr-audio/lib/portaudio/gr-audio-portaudio.conf index 0dd147443..0dd147443 100644 --- a/gr-audio-portaudio/gr-audio-portaudio.conf +++ b/gr-audio/lib/portaudio/gr-audio-portaudio.conf diff --git a/gr-audio-portaudio/src/gri_portaudio.cc b/gr-audio/lib/portaudio/gri_portaudio.cc index faa472337..faa472337 100644 --- a/gr-audio-portaudio/src/gri_portaudio.cc +++ b/gr-audio/lib/portaudio/gri_portaudio.cc diff --git a/gr-audio-portaudio/src/gri_portaudio.h b/gr-audio/lib/portaudio/gri_portaudio.h index 36191e25a..36191e25a 100644 --- a/gr-audio-portaudio/src/gri_portaudio.h +++ b/gr-audio/lib/portaudio/gri_portaudio.h diff --git a/gr-audio-windows/src/audio_windows_sink.cc b/gr-audio/lib/windows/audio_windows_sink.cc index a47871954..e3f67a8f4 100644 --- a/gr-audio-windows/src/audio_windows_sink.cc +++ b/gr-audio/lib/windows/audio_windows_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* -* Copyright 2004,2010 Free Software Foundation, Inc. +* Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_windows_sink.h> #include <gr_io_signature.h> #include <sys/types.h> @@ -36,6 +37,12 @@ #include <string> #include <sstream> +AUDIO_REGISTER_SINK(REG_PRIO_HIGH, windows)( + int sampling_rate, const std::string &device_name, bool +){ + return audio_sink::sptr(new audio_windows_sink(sampling_rate, device_name)); +} + static const double CHUNK_TIME = 0.1; //0.001; // 100 ms // FIXME these should query some kind of user preference @@ -47,7 +54,7 @@ default_device_name () } audio_windows_sink::audio_windows_sink (int sampling_freq, const std::string device_name) - : gr_sync_block ("audio_windows_sink", + : audio_sink ("audio_windows_sink", gr_make_io_signature (1, 2, sizeof (float)), gr_make_io_signature (0, 0, 0)), d_sampling_freq (sampling_freq), @@ -78,13 +85,6 @@ audio_windows_sink::~audio_windows_sink () delete[]d_buffer; } -audio_windows_sink_sptr -audio_windows_make_sink (int sampling_freq, const std::string dev) -{ - return gnuradio::get_initial_sptr (new audio_windows_sink (sampling_freq, dev)); -} - - int audio_windows_sink::work (int noutput_items, gr_vector_const_void_star & input_items, diff --git a/gr-audio-windows/src/audio_windows_sink.h b/gr-audio/lib/windows/audio_windows_sink.h index 2212ecf06..6819bd448 100644 --- a/gr-audio-windows/src/audio_windows_sink.h +++ b/gr-audio/lib/windows/audio_windows_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,16 +29,9 @@ #include <windows.h> #include <mmsystem.h> -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> - -class audio_windows_sink; -typedef boost::shared_ptr <audio_windows_sink> audio_windows_sink_sptr; - -audio_windows_sink_sptr -audio_windows_make_sink (int sampling_freq, const std::string dev = ""); - /*! * \brief audio sink using winmm mmsystem (win32 only) * @@ -46,12 +39,8 @@ audio_windows_make_sink (int sampling_freq, const std::string dev = ""); * Input samples must be in the range [-1,1]. */ -class audio_windows_sink : public gr_sync_block +class audio_windows_sink : public audio_sink { - friend - audio_windows_sink_sptr - audio_windows_make_sink (int sampling_freq, const std::string device_name); - int d_sampling_freq; std::string d_device_name; int d_fd; @@ -65,13 +54,13 @@ class audio_windows_sink : public gr_sync_block protected: int string_to_int (const std::string & s); - audio_windows_sink (int sampling_freq, const std::string device_name = ""); int open_waveout_device (void); int write_waveout (HPSTR lp_data, DWORD dw_data_size); public: + audio_windows_sink (int sampling_freq, const std::string device_name = ""); ~audio_windows_sink (); int diff --git a/gr-audio-windows/src/audio_windows_source.cc b/gr-audio/lib/windows/audio_windows_source.cc index a88923afd..4b657a0e3 100644 --- a/gr-audio-windows/src/audio_windows_source.cc +++ b/gr-audio/lib/windows/audio_windows_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_windows_source.h> #include <gr_io_signature.h> //include <sys/soundcard.h> @@ -36,6 +37,11 @@ #include <iostream> #include <stdexcept> +AUDIO_REGISTER_SOURCE(REG_PRIO_HIGH, windows)( + int sampling_rate, const std::string &device_name, bool +){ + return audio_source::sptr(new audio_windows_source(sampling_rate, device_name)); +} static const double CHUNK_TIME = 0.005; // 5 ms @@ -48,7 +54,7 @@ default_device_name () } audio_windows_source::audio_windows_source (int sampling_freq, const std::string device_name) - : gr_sync_block ("audio_windows_source", + : audio_source ("audio_windows_source", gr_make_io_signature (0, 0, 0), gr_make_io_signature (1, 2, sizeof (float))), d_sampling_freq (sampling_freq), @@ -125,13 +131,6 @@ audio_windows_source::~audio_windows_source () */ } -audio_windows_source_sptr -audio_windows_make_source (int sampling_freq, const std::string dev) -{ - return gnuradio::get_initial_sptr (new audio_windows_source (sampling_freq, dev)); -} - - int audio_windows_source::work (int noutput_items, gr_vector_const_void_star & input_items, diff --git a/gr-audio-windows/src/audio_windows_source.h b/gr-audio/lib/windows/audio_windows_source.h index caeda36b8..36311968d 100644 --- a/gr-audio-windows/src/audio_windows_source.h +++ b/gr-audio/lib/windows/audio_windows_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,16 +23,9 @@ #ifndef INCLUDED_AUDIO_WINDOWS_SOURCE_H #define INCLUDED_AUDIO_WINDOWS_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> - -class audio_windows_source; -typedef boost::shared_ptr <audio_windows_source> audio_windows_source_sptr; - -audio_windows_source_sptr -audio_windows_make_source (int sampling_freq, const std::string dev = ""); - /*! * \brief audio source using winmm mmsystem (win32 only) * @@ -40,12 +33,8 @@ audio_windows_make_source (int sampling_freq, const std::string dev = ""); * Output samples will be in the range [-1,1]. */ -class audio_windows_source : public gr_sync_block +class audio_windows_source : public audio_source { - friend - audio_windows_source_sptr - audio_windows_make_source (int sampling_freq, - const std::string device_name); int d_sampling_freq; std::string d_device_name; @@ -53,10 +42,9 @@ class audio_windows_source : public gr_sync_block short *d_buffer; int d_chunk_size; -protected: +public: audio_windows_source (int sampling_freq, const std::string device_name = ""); -public: ~audio_windows_source (); int diff --git a/gr-audio/swig/.gitignore b/gr-audio/swig/.gitignore new file mode 100644 index 000000000..7fd371091 --- /dev/null +++ b/gr-audio/swig/.gitignore @@ -0,0 +1,5 @@ +/audio_swig.cc +/audio_swig.py +/Makefile +/Makefile.in +/python diff --git a/gr-audio-oss/src/Makefile.am b/gr-audio/swig/Makefile.am index 2468958b2..d95e4c5d5 100644 --- a/gr-audio-oss/src/Makefile.am +++ b/gr-audio/swig/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,54 +17,41 @@ # 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. -# +# include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.swig -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_oss_sink.h \ - audio_oss_source.h +AUDIO_CPPFLAGS = -I$(abs_top_srcdir)/gr-audio/include -noinst_PYTHON = qa_oss.py +AM_CPPFLAGS = \ + $(STD_DEFINES_AND_INCLUDES) \ + $(PYTHON_CPPFLAGS) \ + $(AUDIO_CPPFLAGS) \ + $(WITH_INCLUDES) -lib_LTLIBRARIES = libgnuradio-audio-oss.la +# ---------------------------------------------------------------- +# The SWIG library -libgnuradio_audio_oss_la_SOURCES = \ - audio_oss_sink.cc \ - audio_oss_source.cc - -libgnuradio_audio_oss_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(OSS_LIBS) - -libgnuradio_audio_oss_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - -################################### -# SWIG interface and library -TOP_SWIG_IFILES = \ - audio_oss.i +TOP_SWIG_IFILES = \ + audio_swig.i # Install so that they end up available as: -# import gnuradio.audio_oss +# import gnuradio.audio # This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_oss_pythondir_category = \ - gnuradio +# ${prefix}/lib/python${python_version}/site-packages/gnuradio/audio +audio_swig_pythondir_category = \ + gnuradio/audio # additional libraries for linking with the SWIG-generated library -audio_oss_la_swig_libadd = \ - libgnuradio-audio-oss.la +audio_swig_la_swig_libadd = \ + $(top_builddir)/gr-audio/lib/libgnuradio-audio.la + +# additional Python files to be installed along with the SWIG-generated one +audio_swig_python = \ + __init__.py +# additional SWIG files to be installed +audio_swig_swiginclude_headers = -if PYTHON -TESTS += run_tests -endif +audio_swig_swig_args = $(AUDIO_CPPFLAGS) diff --git a/gr-audio-alsa/src/Makefile.swig.gen b/gr-audio/swig/Makefile.swig.gen index c231a4784..7cdf04665 100644 --- a/gr-audio-alsa/src/Makefile.swig.gen +++ b/gr-audio/swig/Makefile.swig.gen @@ -1,6 +1,6 @@ # -*- Makefile -*- # -# Copyright 2009 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,37 +20,37 @@ # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for audio_alsa.i +# Makefile.swig.gen for audio_swig.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_alsa +## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_swig ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_alsa +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_swig ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -audio_alsa_pythondir_category ?= gnuradio/audio_alsa -audio_alsa_pylibdir_category ?= $(audio_alsa_pythondir_category) -audio_alsa_pythondir = $(pythondir)/$(audio_alsa_pythondir_category) -audio_alsa_pylibdir = $(pyexecdir)/$(audio_alsa_pylibdir_category) +audio_swig_pythondir_category ?= gnuradio/audio_swig +audio_swig_pylibdir_category ?= $(audio_swig_pythondir_category) +audio_swig_pythondir = $(pythondir)/$(audio_swig_pythondir_category) +audio_swig_pylibdir = $(pyexecdir)/$(audio_swig_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -audio_alsa_scmlibdir = $(libdir) +audio_swig_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_alsa +# is installed, usually /usr/share/guile/site/audio_swig # FIXME: determince whether these should be installed with gnuradio. -audio_alsa_scmdir = $(guiledir) +audio_swig_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. -audio_alsa_swigincludedir = $(swigincludedir) +audio_swig_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -75,70 +75,70 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -audio_alsa_swiginclude_HEADERS = \ - audio_alsa.i \ - $(audio_alsa_swiginclude_headers) +audio_swig_swiginclude_HEADERS = \ + audio_swig.i \ + $(audio_swig_swiginclude_headers) if PYTHON -audio_alsa_pylib_LTLIBRARIES = \ - _audio_alsa.la +audio_swig_pylib_LTLIBRARIES = \ + _audio_swig.la -_audio_alsa_la_SOURCES = \ - python/audio_alsa.cc \ - $(audio_alsa_la_swig_sources) +_audio_swig_la_SOURCES = \ + python/audio_swig.cc \ + $(audio_swig_la_swig_sources) -audio_alsa_python_PYTHON = \ - audio_alsa.py \ - $(audio_alsa_python) +audio_swig_python_PYTHON = \ + audio_swig.py \ + $(audio_swig_python) -_audio_alsa_la_LIBADD = \ +_audio_swig_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(audio_alsa_la_swig_libadd) + $(audio_swig_la_swig_libadd) -_audio_alsa_la_LDFLAGS = \ +_audio_swig_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_alsa_la_swig_ldflags) + $(audio_swig_la_swig_ldflags) -_audio_alsa_la_CXXFLAGS = \ +_audio_swig_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(audio_alsa_la_swig_cxxflags) + $(audio_swig_la_swig_cxxflags) -python/audio_alsa.cc: audio_alsa.py -audio_alsa.py: audio_alsa.i +python/audio_swig.cc: audio_swig.py +audio_swig.py: audio_swig.i # Include the python dependencies for this file --include python/audio_alsa.d +-include python/audio_swig.d endif # end of if python if GUILE -audio_alsa_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_alsa.la -libguile_gnuradio_audio_alsa_la_SOURCES = \ - guile/audio_alsa.cc \ - $(audio_alsa_la_swig_sources) -nobase_audio_alsa_scm_DATA = \ - gnuradio/audio_alsa.scm \ - gnuradio/audio_alsa-primitive.scm -libguile_gnuradio_audio_alsa_la_LIBADD = \ +audio_swig_scmlib_LTLIBRARIES = \ + libguile-gnuradio-audio_swig.la +libguile_gnuradio_audio_swig_la_SOURCES = \ + guile/audio_swig.cc \ + $(audio_swig_la_swig_sources) +nobase_audio_swig_scm_DATA = \ + gnuradio/audio_swig.scm \ + gnuradio/audio_swig-primitive.scm +libguile_gnuradio_audio_swig_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(audio_alsa_la_swig_libadd) -libguile_gnuradio_audio_alsa_la_LDFLAGS = \ + $(audio_swig_la_swig_libadd) +libguile_gnuradio_audio_swig_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_alsa_la_swig_ldflags) -libguile_gnuradio_audio_alsa_la_CXXFLAGS = \ + $(audio_swig_la_swig_ldflags) +libguile_gnuradio_audio_swig_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(audio_alsa_la_swig_cxxflags) + $(audio_swig_la_swig_cxxflags) -guile/audio_alsa.cc: gnuradio/audio_alsa.scm -gnuradio/audio_alsa.scm: audio_alsa.i -gnuradio/audio_alsa-primitive.scm: gnuradio/audio_alsa.scm +guile/audio_swig.cc: gnuradio/audio_swig.scm +gnuradio/audio_swig.scm: audio_swig.i +gnuradio/audio_swig-primitive.scm: gnuradio/audio_swig.scm # Include the guile dependencies for this file --include guile/audio_alsa.d +-include guile/audio_swig.d endif # end of GUILE diff --git a/gr-audio-windows/Makefile.am b/gr-audio/swig/__init__.py index b3cecff96..23efda07e 100644 --- a/gr-audio-windows/Makefile.am +++ b/gr-audio/swig/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,8 +17,6 @@ # 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. -# - -include $(top_srcdir)/Makefile.common +# -SUBDIRS = src +from audio_swig import * diff --git a/gr-audio/swig/audio_swig.i b/gr-audio/swig/audio_swig.i new file mode 100644 index 000000000..612e96d23 --- /dev/null +++ b/gr-audio/swig/audio_swig.i @@ -0,0 +1,63 @@ +/* + * 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. + */ + + +#define GR_AUDIO_API + +//////////////////////////////////////////////////////////////////////// +// Language independent exception handler +//////////////////////////////////////////////////////////////////////// +%include exception.i + +%exception { + try { + $action + } + catch(std::exception &e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + +} + +//////////////////////////////////////////////////////////////////////// +// standard includes +//////////////////////////////////////////////////////////////////////// +%include "gnuradio.i" + +//////////////////////////////////////////////////////////////////////// +// block headers +//////////////////////////////////////////////////////////////////////// +%{ +#include <gr_audio_source.h> +#include <gr_audio_sink.h> +%} + +//////////////////////////////////////////////////////////////////////// +// block magic +//////////////////////////////////////////////////////////////////////// +GR_SWIG_BLOCK_MAGIC(audio,source) +%include <gr_audio_source.h> + +GR_SWIG_BLOCK_MAGIC(audio,sink) +%include <gr_audio_sink.h> diff --git a/gr-qtgui/Makefile.am b/gr-qtgui/Makefile.am index d53f96c1f..e794266cb 100644 --- a/gr-qtgui/Makefile.am +++ b/gr-qtgui/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,3 +23,8 @@ include $(top_srcdir)/Makefile.common SUBDIRS = src DIST_SUBDIRS = src + +if PYTHON +SUBDIRS += grc +DIST_SUBDIRS += grc +endif diff --git a/gr-qtgui/grc/.gitignore b/gr-qtgui/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-qtgui/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-alsa/Makefile.am b/gr-qtgui/grc/Makefile.am index 5bd92b0ff..b3114268c 100644 --- a/gr-audio-alsa/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2006,2009 Free Software Foundation, Inc. +# Copyright 2010-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,14 +17,17 @@ # 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. -# +# include $(top_srcdir)/Makefile.common -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-alsa.pc +grcblocksdir = $(grc_blocksdir) -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-alsa.conf +dist_grcblocks_DATA = \ + qtgui_check_box.xml \ + qtgui_entry.xml \ + qtgui_label.xml \ + qtgui_range.xml \ + qtgui_sink_x.xml \ + qtgui_tab_widget.xml \ + qtgui_chooser.xml diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml new file mode 100644 index 000000000..95f4f968a --- /dev/null +++ b/gr-qtgui/grc/qtgui_check_box.xml @@ -0,0 +1,83 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Check Box: +## a gui check box form +################################################### + --> +<block> + <name>QT GUI Check Box</name> + <key>variable_qtgui_check_box</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = '_%s_check_box'%$id +#if not $label() + #set $label = '"%s"'%$id +#end if +$win = Qt.QCheckBox($label) +self._$(id)_choices = {True: $true, False: $false} +self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems()) +self._$(id)_callback = lambda i: $(win).setChecked(self._$(id)_choices_inv[i]) +self._$(id)_callback(self.$id) +$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)])) +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_callback($id)</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key><opt>conv:float</opt></option> + <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> + <option><name>String</name><key>string</key><opt>conv:str</opt></option> + <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> + <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>True</value> + <type>$type</type> + </param> + <param> + <name>True</name> + <key>true</key> + <value>True</value> + <type>$type</type> + </param> + <param> + <name>False</name> + <key>false</key> + <value>False</value> + <type>$type</type> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <check>$value in ($true, $false)</check> + <doc> +This block creates a variable check box. \ +Leave the label blank to use the variable id as the label. + +A check box selects between two values of similar type. \ +Te values do not necessarily need to be of boolean type. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml new file mode 100644 index 000000000..cb5090289 --- /dev/null +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -0,0 +1,251 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Chooser: +## A chooser, radio buttons +################################################### + --> +<block> + <name>QT GUI Chooser</name> + <key>variable_qtgui_chooser</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#slurp +#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] +#if not $label() + #set $label = '"%s"'%$id +#end if +######################################################################## +## Create the options list +######################################################################## +#if int($num_opts()) +self._$(id)_options = (#slurp + #for $ch in $all_options +$ch, #slurp + #end for +) +#else +self._$(id)_options = $options +#end if +######################################################################## +## Create the labels list +######################################################################## +#if int($num_opts()) +self._$(id)_labels = (#slurp + #for i, $lbl in enumerate($all_labels) + #if $lbl() +$lbl, #slurp + #else +str(self._$(id)_options[$i]), #slurp + #end if + #end for +) +#elif $labels() +self._$(id)_labels = $labels +#else +self._$(id)_labels = map(str, self._$(id)_options) +#end if +######################################################################## +## Create the combo box +######################################################################## +#if $widget() == 'combo_box' +#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_combo_box = Qt.QComboBox() +$(win).addWidget(self._$(id)_combo_box) +for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) +self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) +self._$(id)_callback(self.$id) +self._$(id)_combo_box.currentIndexChanged.connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) +#end if +######################################################################## +## Create the radio buttons +######################################################################## +#if $widget() == 'radio_buttons' +#set $win = 'self._%s_group_box'%$id +$win = Qt.QGroupBox($label) +self._$(id)_box = $(orient)() +self._$(id)_button_group = Qt.QButtonGroup() +$(win).setLayout(self._$(id)_box) +for i, label in enumerate(self._$(id)_labels): + radio_button = Qt.QRadioButton(label) + self._$(id)_box.addWidget(radio_button) + self._$(id)_button_group.addButton(radio_button, i) +self._$(id)_callback = lambda i: self._$(id)_button_group.button(self._$(id)_options.index(i)).setChecked(True) +self._$(id)_callback(self.$id) +self._$(id)_button_group.buttonClicked[int].connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) +#end if +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_callback($id)</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key></option> + <option><name>Integer</name><key>int</key></option> + <option><name>String</name><key>string</key></option> + <option><name>Any</name><key>raw</key></option> + </param> + <param> + <name>Num Options</name> + <key>num_opts</key> + <value>3</value> + <type>enum</type> + <option><name>List</name><key>0</key></option> + <option><name>1</name><key>1</key></option> + <option><name>2</name><key>2</key></option> + <option><name>3</name><key>3</key></option> + <option><name>4</name><key>4</key></option> + <option><name>5</name><key>5</key></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>$type</type> + </param> + <param> + <name>Options</name> + <key>options</key> + <value>[0, 1, 2]</value> + <type>raw</type> + <hide>#if int($num_opts()) then 'all' else 'none'#</hide> + </param> + <param> + <name>Labels</name> + <key>labels</key> + <value>[]</value> + <type>raw</type> + <hide>#if int($num_opts()) then 'all' else 'none'#</hide> + </param> + <param> + <name>Option 0</name> + <key>option0</key> + <value>0</value> + <type>$type</type> + <hide>#if int($num_opts()) > 0 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 0</name> + <key>label0</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 1</name> + <key>option1</key> + <value>1</value> + <type>$type</type> + <hide>#if int($num_opts()) > 1 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 1</name> + <key>label1</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 2</name> + <key>option2</key> + <value>2</value> + <type>$type</type> + <hide>#if int($num_opts()) > 2 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 2</name> + <key>label2</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 3</name> + <key>option3</key> + <value>3</value> + <type>$type</type> + <hide>#if int($num_opts()) > 3 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 3</name> + <key>label3</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 4</name> + <key>option4</key> + <value>4</value> + <type>$type</type> + <hide>#if int($num_opts()) > 4 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 4</name> + <key>label4</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Widget</name> + <key>widget</key> + <value>combo_box</value> + <type>enum</type> + <hide>part</hide> + <option><name>Combo Box</name><key>combo_box</key></option> + <option><name>Radio Buttons</name><key>radio_buttons</key></option> + </param> + <param> + <name>Orientation</name> + <key>orient</key> + <value>Qt.QVBoxLayout</value> + <type>enum</type> + <hide>#if $widget() == 'radio_buttons' then 'part' else 'all'#</hide> + <option> + <name>Horizontal</name> + <key>Qt.QHBoxLayout</key> + </option> + <option> + <name>Vertical</name> + <key>Qt.QVBoxLayout</key> + </option> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a variable with enumerated options. \ +The gui widget is implemented as a combo box or radio button group. \ +Leave the label blank to use the variable id as the label. + +Choose the number of options available to your chooser. \ +When the label is left blank, the option will be used as the label. \ +Set the number of options to "list" to enter a single list of options and labels. \ +When the labels is an empty list, the options will be used as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml new file mode 100644 index 000000000..1a98402a0 --- /dev/null +++ b/gr-qtgui/grc/qtgui_entry.xml @@ -0,0 +1,68 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Text Entry: +## a gui text box form +################################################### + --> +<block> + <name>QT GUI Entry</name> + <key>variable_qtgui_entry</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>from gnuradio import eng_notation</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if not $label() + #set $label = '"%s"'%$id +#end if +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) +self._$(id)_line_edit.returnPressed.connect( + lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text().toAscii()))) +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_line_edit.setText($(type.str)($id))</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> + <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> + <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> + <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> + <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>$type</type> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a variable with a text entry box. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml new file mode 100644 index 000000000..5049118c4 --- /dev/null +++ b/gr-qtgui/grc/qtgui_label.xml @@ -0,0 +1,66 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Label Text: +## a gui static text form +################################################### + --> +<block> + <name>QT GUI Label</name> + <key>variable_qtgui_label</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>from gnuradio import eng_notation</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if not $label() + #set $label = '"%s"'%$id +#end if +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_label = Qt.QLabel(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_label) +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_label.setText($(type.str)($id))</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> + <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> + <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> + <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> + <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>$type</type> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a variable with a label widget for text. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml new file mode 100644 index 000000000..6b0555f98 --- /dev/null +++ b/gr-qtgui/grc/qtgui_range.xml @@ -0,0 +1,211 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Range: +## ranged widgets like a slider or a knob +################################################### + --> +<block> + <name>QT GUI Range</name> + <key>variable_qtgui_range</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>import PyQt4.Qwt5 as Qwt</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = 'self._%s_layout'%$id +#if not $label() + #set $label = '"%s"'%$id +#end if +######################################################################## +#if $widget() == "knob" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_knob = Qwt.QwtKnob() +self._$(id)_knob.setRange($start, $stop, $step) +self._$(id)_knob.setValue(self.$id) +self._$(id)_knob.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_knob) +self._$(id)_label = Qt.QLabel($label) +self._$(id)_label.setAlignment(Qt.Qt.AlignTop | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +#end if +######################################################################## +#if $widget() == "thermo" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_label = Qt.QLabel($label) +self._$(id)_thermo = Qwt.QwtThermo() +self._$(id)_thermo.setScalePosition(Qwt.QwtThermo.$orient.scalepos) +self._$(id)_thermo.setRange($start, $stop) +self._$(id)_thermo.setValue(self.$id) +self._$(id)_thermo.$(orient.minfcn)($min_len) +#if 'horizontal' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +$(win).addWidget(self._$(id)_thermo) +#elif 'vertical' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignTop) +$(win).addWidget(self._$(id)_thermo) +$(win).addWidget(self._$(id)_label) +#end if +#end if +######################################################################## +#if $widget() == "counter" +######################################################################## +$win = Qt.QHBoxLayout() +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_counter = Qwt.QwtCounter() +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setMinimumWidth($min_len) +self._$(id)_counter.setValue(self.$id) +$(win).addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +#end if +######################################################################## +#if $widget() == "slider" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_label = Qt.QLabel($label) +self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, Qwt.QwtSlider.$orient.scalepos, Qwt.QwtSlider.BgSlot) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue(self.$id) +self._$(id)_slider.$(orient.minfcn)($min_len) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +#if 'horizontal' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +$(win).addWidget(self._$(id)_slider) +#elif 'vertical' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignTop) +$(win).addWidget(self._$(id)_slider) +$(win).addWidget(self._$(id)_label) +#end if +#end if +######################################################################## +#if $widget() == "counter_slider" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_tool_bar = Qt.QToolBar(self) +$(win).addWidget(self._$(id)_tool_bar) +self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ")) +self._$(id)_counter = Qwt.QwtCounter() +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setValue(self.$id) +self._$(id)_tool_bar.addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +self._$(id)_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue(self.$id) +self._$(id)_slider.setMinimumWidth($min_len) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_slider) +#end if +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>#if $widget() == "knob" +self._$(id)_knob.setValue($id) +#end if +#if $widget() == "thermo" +self._$(id)_thermo.setValue($id) +#end if +#if $widget() == "counter" +self._$(id)_counter.setValue($id) +#end if +#if $widget() == "slider" +self._$(id)_slider.setValue($id) +#end if +#if $widget() == "counter_slider" +self._$(id)_counter.setValue($id) +self._$(id)_slider.setValue($id) +#end if</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>50</value> + <type>real</type> + </param> + <param> + <name>Start</name> + <key>start</key> + <value>0</value> + <type>real</type> + </param> + <param> + <name>Stop</name> + <key>stop</key> + <value>100</value> + <type>real</type> + </param> + <param> + <name>Step</name> + <key>step</key> + <value>1</value> + <type>real</type> + </param> + <param> + <name>Widget</name> + <key>widget</key> + <value>counter_slider</value> + <type>enum</type> + <hide>part</hide> + <option><name>Counter + Slider</name><key>counter_slider</key></option> + <option><name>Counter</name><key>counter</key></option> + <option><name>Slider</name><key>slider</key></option> + <option><name>Knob</name><key>knob</key></option> + <option><name>Thermo</name><key>thermo</key></option> + </param> + <param> + <name>Orientation</name> + <key>orient</key> + <value>Qt.Horizontal</value> + <type>enum</type> + <hide>#if $widget() in ("slider", "thermo") then 'part' else 'all'#</hide> + <option> + <name>Horizontal</name> + <key>Qt.Horizontal</key> + <opt>scalepos:BottomScale</opt> + <opt>minfcn:setMinimumWidth</opt> + </option> + <option> + <name>Vertical</name> + <key>Qt.Vertical</key> + <opt>scalepos:LeftScale</opt> + <opt>minfcn:setMinimumHeight</opt> + </option> + </param> + <param> + <name>Minimum Length</name> + <key>min_len</key> + <value>200</value> + <type>int</type> + <hide>#if $widget().split('_')[0] in ("slider", "counter", "thermo") then 'part' else 'all'#</hide> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <check>$start <= $value <= $stop</check> + <check>$start < $stop</check> + <doc> +This block creates a variable with a slider. \ +Leave the label blank to use the variable id as the label. \ +The value must be a real number. \ +The value must be between the start and the stop. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml new file mode 100644 index 000000000..7a5f5ec13 --- /dev/null +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -0,0 +1,136 @@ +<?xml version="1.0"?> +<!-- +################################################### +##QT GUI Sink +################################################### + --> +<block> + <name>QT GUI Sink</name> + <key>qtgui_sink_x</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>from gnuradio.qtgui import qtgui</import> + <import>from gnuradio.gr import firdes</import> + <import>import sip</import> + <make>#set $win = 'self._%s_win'%$id +qtgui.$(type.fcn)( + $fftsize, \#fftsize + $wintype, \#wintype + $fc, \#fc + $bw, \#bw + $name, \#name + $plotfreq, \#plotfreq + $plotwaterfall, \#plotwaterfall + $plotwaterfall3d, \#plotwaterfall3d + $plottime, \#plottime + $plotconst, \#plotconst +) +self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) +$(gui_hint()($win))</make> + <callback>set_frequency_range($fc, $bw)</callback> + <param> + <name>Type</name> + <key>type</key> + <value>complex</value> + <type>enum</type> + <option><name>Complex</name><key>complex</key><opt>fcn:sink_c</opt></option> + <option><name>Float</name><key>float</key><opt>fcn:sink_f</opt></option> + </param> + <param> + <name>Name</name> + <key>name</key> + <value>QT GUI Plot</value> + <type>string</type> + </param> + <param> + <name>FFT Size</name> + <key>fftsize</key> + <value>1024</value> + <type>int</type> + </param> + <param> + <name>Window Type</name> + <key>wintype</key> + <value>firdes.WIN_BLACKMAN_hARRIS</value> + <type>int</type> + <hide>part</hide> + <option> + <name>Blackman-harris</name> + <key>firdes.WIN_BLACKMAN_hARRIS</key> + </option> + </param> + <param> + <name>Center Frequency (Hz)</name> + <key>fc</key> + <value>0</value> + <type>real</type> + </param> + <param> + <name>Bandwidth (Hz)</name> + <key>bw</key> + <value>samp_rate</value> + <type>real</type> + </param> + <param> + <name>Plot Frequency</name> + <key>plotfreq</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Waterfall</name> + <key>plotwaterfall</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Waterfall 3D</name> + <key>plotwaterfall3d</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Time</name> + <key>plottime</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Const</name> + <key>plotconst</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <sink> + <name>in</name> + <type>$type</type> + <nports>$num_inputs</nports> + </sink> + <doc> +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml new file mode 100644 index 000000000..f90054109 --- /dev/null +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<!-- +################################################### +##WX GUI Notebook +################################################### + --> +<block> + <name>QT GUI Tab Widget</name> + <key>qtgui_tab_widget</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <make>#set $win = 'self.%s'%$id +Qt.QTabWidget() +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())] +#for i, label in enumerate($all_labels) +self.$(id)_widget_$(i) = Qt.QWidget() +self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) +self.$(id)_grid_layout_$(i) = Qt.QGridLayout() +self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) +$(win).addTab(self.$(id)_widget_$(i), $label) +#end for +$(gui_hint()($win))</make> + <param> + <name>Num Tabs</name> + <key>num_tabs</key> + <value>1</value> + <type>enum</type> + <option><name>1</name><key>1</key></option> + <option><name>2</name><key>2</key></option> + <option><name>3</name><key>3</key></option> + <option><name>4</name><key>4</key></option> + <option><name>5</name><key>5</key></option> + </param> + <param> + <name>Label 0</name> + <key>label0</key> + <value>Tab 0</value> + <type>string</type> + <hide>#if int($num_tabs()) > 0 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 1</name> + <key>label1</key> + <value>Tab 1</value> + <type>string</type> + <hide>#if int($num_tabs()) > 1 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 2</name> + <key>label2</key> + <value>Tab 2</value> + <type>string</type> + <hide>#if int($num_tabs()) > 2 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 3</name> + <key>label3</key> + <value>Tab 3</value> + <type>string</type> + <hide>#if int($num_tabs()) > 3 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 4</name> + <key>label4</key> + <value>Tab 4</value> + <type>string</type> + <hide>#if int($num_tabs()) > 4 then 'none' else 'all'#</hide> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a tabbed widget to organize other widgets. \ +The ID of this block can be used as the tab_id in the GUI hints of other widgets. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/src/lib/qtgui.h b/gr-qtgui/src/lib/qtgui.h index 6edbca12c..9831697ac 100644 --- a/gr-qtgui/src/lib/qtgui.h +++ b/gr-qtgui/src/lib/qtgui.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,30 +23,31 @@ #ifndef INCLUDED_QTGUI_H #define INCLUDED_QTGUI_H +#include <gruel/thread.h> #include <qapplication.h> #include "SpectrumGUIClass.h" class qtgui_event : public QEvent { private: - pthread_mutex_t *pmutex; + gruel::mutex &d_mutex; public: - qtgui_event(pthread_mutex_t *mut) - : QEvent((QEvent::Type)(QEvent::User+101)) + qtgui_event(gruel::mutex &mutex) + : QEvent((QEvent::Type)(QEvent::User+101)), + d_mutex(mutex) { - pmutex = mut; + //nop } void lock() { - pthread_mutex_lock(pmutex); - + d_mutex.lock(); } void unlock() { - pthread_mutex_unlock(pmutex); + d_mutex.unlock(); } }; diff --git a/gr-qtgui/src/lib/qtgui_sink_c.cc b/gr-qtgui/src/lib/qtgui_sink_c.cc index c12c451b0..05c7b28d5 100644 --- a/gr-qtgui/src/lib/qtgui_sink_c.cc +++ b/gr-qtgui/src/lib/qtgui_sink_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -72,7 +72,6 @@ qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype, } d_main_gui = NULL; - pthread_mutex_init(&d_pmutex, NULL); lock(); // Perform fftshift operation; @@ -107,12 +106,12 @@ qtgui_sink_c::forecast(int noutput_items, gr_vector_int &ninput_items_required) void qtgui_sink_c::lock() { - pthread_mutex_lock(&d_pmutex); + d_mutex.lock(); } void qtgui_sink_c::unlock() { - pthread_mutex_unlock(&d_pmutex); + d_mutex.unlock(); } @@ -151,7 +150,7 @@ qtgui_sink_c::initialize(const bool opengl) set_update_time(0.1); d_object = new qtgui_obj(d_qApplication); - qApp->postEvent(d_object, new qtgui_event(&d_pmutex)); + qApp->postEvent(d_object, new qtgui_event(d_mutex)); } @@ -289,7 +288,7 @@ qtgui_sink_c::general_work (int noutput_items, int j=0; const gr_complex *in = (const gr_complex*)input_items[0]; - pthread_mutex_lock(&d_pmutex); + gruel::scoped_lock lock(d_mutex); // Update the FFT size from the application fftresize(); @@ -322,8 +321,6 @@ qtgui_sink_c::general_work (int noutput_items, } } - pthread_mutex_unlock(&d_pmutex); - consume_each(j); return j; } diff --git a/gr-qtgui/src/lib/qtgui_sink_c.h b/gr-qtgui/src/lib/qtgui_sink_c.h index 9aee66503..bbf9983b0 100644 --- a/gr-qtgui/src/lib/qtgui_sink_c.h +++ b/gr-qtgui/src/lib/qtgui_sink_c.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009 Free Software Foundation, Inc. + * Copyright 2008,2009,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -76,7 +76,7 @@ private: double d_bandwidth; std::string d_name; - pthread_mutex_t d_pmutex; + gruel::mutex d_mutex; bool d_shift; gri_fft_complex *d_fft; diff --git a/gr-qtgui/src/lib/qtgui_sink_f.cc b/gr-qtgui/src/lib/qtgui_sink_f.cc index ab4fd082d..984c2803c 100644 --- a/gr-qtgui/src/lib/qtgui_sink_f.cc +++ b/gr-qtgui/src/lib/qtgui_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -72,7 +72,6 @@ qtgui_sink_f::qtgui_sink_f (int fftsize, int wintype, } d_main_gui = NULL; - pthread_mutex_init(&d_pmutex, NULL); lock(); // Perform fftshift operation; @@ -107,12 +106,12 @@ qtgui_sink_f::forecast(int noutput_items, gr_vector_int &ninput_items_required) void qtgui_sink_f::lock() { - pthread_mutex_lock(&d_pmutex); + d_mutex.lock(); } void qtgui_sink_f::unlock() { - pthread_mutex_unlock(&d_pmutex); + d_mutex.unlock(); } void @@ -146,7 +145,7 @@ qtgui_sink_f::initialize(const bool opengl) set_update_time(0.1); d_object = new qtgui_obj(d_qApplication); - qApp->postEvent(d_object, new qtgui_event(&d_pmutex)); + qApp->postEvent(d_object, new qtgui_event(d_mutex)); } void @@ -284,7 +283,7 @@ qtgui_sink_f::general_work (int noutput_items, int j=0; const float *in = (const float*)input_items[0]; - pthread_mutex_lock(&d_pmutex); + gruel::scoped_lock lock(d_mutex); // Update the FFT size from the application fftresize(); @@ -317,8 +316,6 @@ qtgui_sink_f::general_work (int noutput_items, } } - pthread_mutex_unlock(&d_pmutex); - consume_each(j); return j; } diff --git a/gr-qtgui/src/lib/qtgui_sink_f.h b/gr-qtgui/src/lib/qtgui_sink_f.h index 0cac35d90..d80a6a198 100644 --- a/gr-qtgui/src/lib/qtgui_sink_f.h +++ b/gr-qtgui/src/lib/qtgui_sink_f.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009 Free Software Foundation, Inc. + * Copyright 2008,2009,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -74,7 +74,7 @@ private: double d_bandwidth; std::string d_name; - pthread_mutex_t d_pmutex; + gruel::mutex d_mutex; bool d_shift; gri_fft_complex *d_fft; diff --git a/gr-usrp/Makefile.am b/gr-usrp/Makefile.am index 221a10816..be4035dd4 100644 --- a/gr-usrp/Makefile.am +++ b/gr-usrp/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2004,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -27,5 +27,9 @@ EXTRA_DIST += \ SUBDIRS = src apps +if PYTHON +SUBDIRS += grc +endif + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gnuradio-usrp.pc diff --git a/gr-usrp/grc/.gitignore b/gr-usrp/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-usrp/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-usrp/grc/Makefile.am b/gr-usrp/grc/Makefile.am new file mode 100644 index 000000000..11a5f40dc --- /dev/null +++ b/gr-usrp/grc/Makefile.am @@ -0,0 +1,42 @@ +# +# 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. +# + +include $(top_srcdir)/Makefile.common + +usrp_pythondir = $(pythondir)/grc_gnuradio/usrp +usrp_python_PYTHON = \ + __init__.py \ + common.py \ + dual_usrp.py \ + simple_usrp.py + +dist_bin_SCRIPTS = usrp_probe + +grcblocksdir = $(grc_blocksdir) +dist_grcblocks_DATA = \ + usrp_dual_sink_x.xml \ + usrp_simple_sink_x.xml \ + usrp_dual_source_x.xml \ + usrp_simple_source_x.xml \ + usrp_probe.xml + +ourdatadir = $(pkgdatadir)/grc/freedesktop +dist_ourdata_DATA = gnuradio-usrp_probe.desktop diff --git a/grc/grc_gnuradio/usrp/__init__.py b/gr-usrp/grc/__init__.py index 1956bbd5b..1956bbd5b 100644 --- a/grc/grc_gnuradio/usrp/__init__.py +++ b/gr-usrp/grc/__init__.py diff --git a/grc/grc_gnuradio/usrp/common.py b/gr-usrp/grc/common.py index 65c1e7e29..65c1e7e29 100644 --- a/grc/grc_gnuradio/usrp/common.py +++ b/gr-usrp/grc/common.py diff --git a/grc/grc_gnuradio/usrp/dual_usrp.py b/gr-usrp/grc/dual_usrp.py index 66b76b2df..66b76b2df 100644 --- a/grc/grc_gnuradio/usrp/dual_usrp.py +++ b/gr-usrp/grc/dual_usrp.py diff --git a/grc/freedesktop/gnuradio-usrp_probe.desktop b/gr-usrp/grc/gnuradio-usrp_probe.desktop index 136321994..136321994 100644 --- a/grc/freedesktop/gnuradio-usrp_probe.desktop +++ b/gr-usrp/grc/gnuradio-usrp_probe.desktop diff --git a/grc/grc_gnuradio/usrp/simple_usrp.py b/gr-usrp/grc/simple_usrp.py index fb7a39570..fb7a39570 100644 --- a/grc/grc_gnuradio/usrp/simple_usrp.py +++ b/gr-usrp/grc/simple_usrp.py diff --git a/grc/blocks/usrp_dual_sink_x.xml b/gr-usrp/grc/usrp_dual_sink_x.xml index 4539b62f9..babc124d0 100644 --- a/grc/blocks/usrp_dual_sink_x.xml +++ b/gr-usrp/grc/usrp_dual_sink_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Dual Sink</name> + <name>USRP1 Dual Sink</name> <key>usrp_dual_sink_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.dual_sink_$(type.fcn)(which=$which) self.$(id).set_interp_rate($interpolation) diff --git a/grc/blocks/usrp_dual_source_x.xml b/gr-usrp/grc/usrp_dual_source_x.xml index 07d3174bb..4e1fa81d8 100644 --- a/grc/blocks/usrp_dual_source_x.xml +++ b/gr-usrp/grc/usrp_dual_source_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Dual Source</name> + <name>USRP1 Dual Source</name> <key>usrp_dual_source_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.dual_source_$(type.fcn)( which=$which, diff --git a/grc/scripts/usrp_probe b/gr-usrp/grc/usrp_probe index d2e92e753..d2e92e753 100755 --- a/grc/scripts/usrp_probe +++ b/gr-usrp/grc/usrp_probe diff --git a/grc/blocks/usrp_probe.xml b/gr-usrp/grc/usrp_probe.xml index ee207c28d..ee207c28d 100644 --- a/grc/blocks/usrp_probe.xml +++ b/gr-usrp/grc/usrp_probe.xml diff --git a/grc/blocks/usrp_simple_sink_x.xml b/gr-usrp/grc/usrp_simple_sink_x.xml index b52cd4880..e52b5f047 100644 --- a/grc/blocks/usrp_simple_sink_x.xml +++ b/gr-usrp/grc/usrp_simple_sink_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Sink</name> + <name>USRP1 Sink</name> <key>usrp_simple_sink_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.simple_sink_$(type.fcn)(which=$which, side=$side) self.$(id).set_interp_rate($interpolation) diff --git a/grc/blocks/usrp_simple_source_x.xml b/gr-usrp/grc/usrp_simple_source_x.xml index 7fcc7a22c..a79c78c20 100644 --- a/grc/blocks/usrp_simple_source_x.xml +++ b/gr-usrp/grc/usrp_simple_source_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Source</name> + <name>USRP1 Source</name> <key>usrp_simple_source_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.simple_source_$(type.fcn)(which=$which, side=$side, rx_ant=$rx_ant#if $hb_filters() then ', no_hb=True' else ''#) #if $format() diff --git a/gr-usrp2/Makefile.am b/gr-usrp2/Makefile.am index 2a0fbe203..f6120884a 100644 --- a/gr-usrp2/Makefile.am +++ b/gr-usrp2/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2001,2006,2008,2009 Free Software Foundation, Inc. +# Copyright 2001,2006,2008,2009,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,5 +23,9 @@ include $(top_srcdir)/Makefile.common SUBDIRS = src +if PYTHON +SUBDIRS += grc +endif + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gnuradio-usrp2.pc diff --git a/gr-usrp2/grc/.gitignore b/gr-usrp2/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-usrp2/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-portaudio/Makefile.am b/gr-usrp2/grc/Makefile.am index 198d89f87..2502bf363 100644 --- a/gr-audio-portaudio/Makefile.am +++ b/gr-usrp2/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2006,2009 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,10 +21,13 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = src +dist_bin_SCRIPTS = usrp2_probe -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-portaudio.pc +grcblocksdir = $(grc_blocksdir) +dist_grcblocks_DATA = \ + usrp2_probe.xml \ + usrp2_source_xxxx.xml \ + usrp2_sink_xxxx.xml -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-portaudio.conf +ourdatadir = $(pkgdatadir)/grc/freedesktop +dist_ourdata_DATA = gnuradio-usrp2_probe.desktop diff --git a/grc/freedesktop/gnuradio-usrp2_probe.desktop b/gr-usrp2/grc/gnuradio-usrp2_probe.desktop index c71a092b1..c71a092b1 100644 --- a/grc/freedesktop/gnuradio-usrp2_probe.desktop +++ b/gr-usrp2/grc/gnuradio-usrp2_probe.desktop diff --git a/grc/scripts/usrp2_probe b/gr-usrp2/grc/usrp2_probe index 38c8f655c..38c8f655c 100755 --- a/grc/scripts/usrp2_probe +++ b/gr-usrp2/grc/usrp2_probe diff --git a/grc/blocks/usrp2_probe.xml b/gr-usrp2/grc/usrp2_probe.xml index cc3f9c2fd..cc3f9c2fd 100644 --- a/grc/blocks/usrp2_probe.xml +++ b/gr-usrp2/grc/usrp2_probe.xml diff --git a/grc/blocks/usrp2_sink_xxxx.xml b/gr-usrp2/grc/usrp2_sink_xxxx.xml index f9fb25361..74995da99 100644 --- a/grc/blocks/usrp2_sink_xxxx.xml +++ b/gr-usrp2/grc/usrp2_sink_xxxx.xml @@ -8,6 +8,7 @@ <block> <name>USRP2 Sink</name> <key>usrp2_sink_xxxx</key> + <category>USRP</category> <import>from gnuradio import usrp2</import> <make>#if not $interface() and not $mac_addr() usrp2.sink_$(type.fcn)() diff --git a/grc/blocks/usrp2_source_xxxx.xml b/gr-usrp2/grc/usrp2_source_xxxx.xml index 584199798..a23c5bc5c 100644 --- a/grc/blocks/usrp2_source_xxxx.xml +++ b/gr-usrp2/grc/usrp2_source_xxxx.xml @@ -8,6 +8,7 @@ <block> <name>USRP2 Source</name> <key>usrp2_source_xxxx</key> + <category>USRP</category> <import>from gnuradio import usrp2</import> <make>#if not $interface() and not $mac_addr() usrp2.source_$(type.fcn)() diff --git a/gr-wxgui/Makefile.am b/gr-wxgui/Makefile.am index cee66e587..cfc7a429c 100644 --- a/gr-wxgui/Makefile.am +++ b/gr-wxgui/Makefile.am @@ -27,7 +27,7 @@ EXTRA_DIST += \ README.gl if PYTHON -SUBDIRS = src +SUBDIRS = src grc etcdir = $(gr_prefsdir) dist_etc_DATA = gr-wxgui.conf diff --git a/gr-wxgui/grc/.gitignore b/gr-wxgui/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-wxgui/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-wxgui/grc/Makefile.am b/gr-wxgui/grc/Makefile.am new file mode 100644 index 000000000..d8c7b3471 --- /dev/null +++ b/gr-wxgui/grc/Makefile.am @@ -0,0 +1,45 @@ +# +# 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. +# + +include $(top_srcdir)/Makefile.common + +grcblocksdir = $(grc_blocksdir) +dist_grcblocks_DATA = \ + notebook.xml \ + variable_check_box.xml \ + variable_chooser.xml \ + variable_slider.xml \ + variable_static_text.xml \ + variable_text_box.xml \ + wxgui_constellationsink2.xml \ + wxgui_fftsink2.xml \ + wxgui_histosink2.xml \ + wxgui_numbersink2.xml \ + wxgui_scopesink2.xml \ + wxgui_termsink.xml \ + wxgui_waterfallsink2.xml + +#The wxgui module contains a top_block + wxgui frame. +wxgui_pythondir = $(pythondir)/grc_gnuradio/wxgui +wxgui_python_PYTHON = \ + __init__.py \ + panel.py \ + top_block_gui.py diff --git a/grc/grc_gnuradio/wxgui/__init__.py b/gr-wxgui/grc/__init__.py index 81427253b..81427253b 100644 --- a/grc/grc_gnuradio/wxgui/__init__.py +++ b/gr-wxgui/grc/__init__.py diff --git a/grc/blocks/notebook.xml b/gr-wxgui/grc/notebook.xml index d41db9e2d..bb3de51cb 100644 --- a/grc/blocks/notebook.xml +++ b/gr-wxgui/grc/notebook.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Notebook</name> + <name>WX GUI Notebook</name> <key>notebook</key> + <category>WX GUI Widgets</category> <import>from grc_gnuradio import wxgui as grc_wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' self.$(id) = wx.Notebook($(parent).GetWin(), style=$style) diff --git a/grc/grc_gnuradio/wxgui/panel.py b/gr-wxgui/grc/panel.py index e62133cac..e62133cac 100644 --- a/grc/grc_gnuradio/wxgui/panel.py +++ b/gr-wxgui/grc/panel.py diff --git a/grc/grc_gnuradio/wxgui/top_block_gui.py b/gr-wxgui/grc/top_block_gui.py index 333ccf1c1..333ccf1c1 100644 --- a/grc/grc_gnuradio/wxgui/top_block_gui.py +++ b/gr-wxgui/grc/top_block_gui.py diff --git a/grc/blocks/variable_check_box.xml b/gr-wxgui/grc/variable_check_box.xml index a703703c7..0c7bd1081 100644 --- a/grc/blocks/variable_check_box.xml +++ b/gr-wxgui/grc/variable_check_box.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Check Box</name> + <name>WX GUI Check Box</name> <key>variable_check_box</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_chooser.xml b/gr-wxgui/grc/variable_chooser.xml index ee41f26db..e16e88c5d 100644 --- a/grc/blocks/variable_chooser.xml +++ b/gr-wxgui/grc/variable_chooser.xml @@ -7,8 +7,9 @@ ################################################### --> <block> - <name>Variable Chooser</name> + <name>WX GUI Chooser</name> <key>variable_chooser</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_slider.xml b/gr-wxgui/grc/variable_slider.xml index c13d20856..5e3c175aa 100644 --- a/grc/blocks/variable_slider.xml +++ b/gr-wxgui/grc/variable_slider.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Slider</name> + <name>WX GUI Slider</name> <key>variable_slider</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_static_text.xml b/gr-wxgui/grc/variable_static_text.xml index c866b998d..cd122e76a 100644 --- a/grc/blocks/variable_static_text.xml +++ b/gr-wxgui/grc/variable_static_text.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Static Text</name> + <name>WX GUI Static Text</name> <key>variable_static_text</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_text_box.xml b/gr-wxgui/grc/variable_text_box.xml index 1b4b4355e..afff839cf 100644 --- a/grc/blocks/variable_text_box.xml +++ b/gr-wxgui/grc/variable_text_box.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Text Box</name> + <name>WX GUI Text Box</name> <key>variable_text_box</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml index 598b55064..c200790f9 100644 --- a/grc/blocks/wxgui_constellationsink2.xml +++ b/gr-wxgui/grc/wxgui_constellationsink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Constellation Sink</name> + <name>WX GUI Constellation Sink</name> <key>wxgui_constellationsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import constsink_gl</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' constsink_gl.const_sink_c( diff --git a/grc/blocks/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml index 8df8f90d0..9b35ab848 100644 --- a/grc/blocks/wxgui_fftsink2.xml +++ b/gr-wxgui/grc/wxgui_fftsink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>FFT Sink</name> + <name>WX GUI FFT Sink</name> <key>wxgui_fftsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio import window</import> <import>from gnuradio.wxgui import fftsink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/wxgui_histosink2.xml b/gr-wxgui/grc/wxgui_histosink2.xml index 9edf9650d..f4f6a2959 100644 --- a/grc/blocks/wxgui_histosink2.xml +++ b/gr-wxgui/grc/wxgui_histosink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Histo Sink</name> + <name>WX GUI Histo Sink</name> <key>wxgui_histosink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import histosink_gl</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' histosink_gl.histo_sink_f( diff --git a/grc/blocks/wxgui_numbersink2.xml b/gr-wxgui/grc/wxgui_numbersink2.xml index ad93dec08..255926610 100644 --- a/grc/blocks/wxgui_numbersink2.xml +++ b/gr-wxgui/grc/wxgui_numbersink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Number Sink</name> + <name>WX GUI Number Sink</name> <key>wxgui_numbersink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import numbersink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' numbersink2.$(type.fcn)( diff --git a/grc/blocks/wxgui_scopesink2.xml b/gr-wxgui/grc/wxgui_scopesink2.xml index ef0377373..dbf983e11 100644 --- a/grc/blocks/wxgui_scopesink2.xml +++ b/gr-wxgui/grc/wxgui_scopesink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Scope Sink</name> + <name>WX GUI Scope Sink</name> <key>wxgui_scopesink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import scopesink2</import> <import>from gnuradio import gr</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/wxgui_termsink.xml b/gr-wxgui/grc/wxgui_termsink.xml index 985d89b58..3e35c7578 100644 --- a/grc/blocks/wxgui_termsink.xml +++ b/gr-wxgui/grc/wxgui_termsink.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Terminal Sink</name> + <name>WX GUI Terminal Sink</name> <key>wxgui_termsink</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import termsink</import> diff --git a/grc/blocks/wxgui_waterfallsink2.xml b/gr-wxgui/grc/wxgui_waterfallsink2.xml index 3de67597f..7c646c3b2 100644 --- a/grc/blocks/wxgui_waterfallsink2.xml +++ b/gr-wxgui/grc/wxgui_waterfallsink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Waterfall Sink</name> + <name>WX GUI Waterfall Sink</name> <key>wxgui_waterfallsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio import window</import> <import>from gnuradio.wxgui import waterfallsink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/Makefile.am b/grc/Makefile.am index 330777bb7..c36786281 100644 --- a/grc/Makefile.am +++ b/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,16 +25,12 @@ if PYTHON SUBDIRS = \ base \ blocks \ + freedesktop \ grc_gnuradio \ gui \ python \ scripts -## append freedesktop to the list of subdirs when xdg utils are present -if XDG_UTILS -SUBDIRS += freedesktop -endif - ourpythondir = $(pkgpythondir)/grc ourpython_PYTHON = __init__.py diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..6f7802169 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,8 +24,6 @@ include $(top_srcdir)/Makefile.common ourdatadir = $(grc_blocksdir) dist_ourdata_DATA = \ block_tree.xml \ - audio_sink.xml \ - audio_source.xml \ band_pass_filter.xml \ band_reject_filter.xml \ blks2_am_demod_cf.xml \ @@ -60,7 +58,6 @@ dist_ourdata_DATA = \ blks2_tcp_sink.xml \ blks2_tcp_source.xml \ blks2_valve.xml \ - blks2_variable_sink_x.xml \ blks2_wfm_rcv.xml \ blks2_wfm_rcv_pll.xml \ blks2_wfm_tx.xml \ @@ -158,6 +155,7 @@ dist_ourdata_DATA = \ gr_probe_avg_mag_sqrd_x.xml \ gr_probe_density_b.xml \ gr_probe_mpsk_snr_c.xml \ + gr_probe_signal_f.xml \ gr_pwr_squelch_xx.xml \ gr_quadrature_demod_cf.xml \ gr_rational_resampler_base_xxx.xml \ @@ -197,12 +195,10 @@ dist_ourdata_DATA = \ import.xml \ low_pass_filter.xml \ note.xml \ - notebook.xml \ options.xml \ pad_sink.xml \ pad_source.xml \ parameter.xml \ - probe_function.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ @@ -212,29 +208,10 @@ dist_ourdata_DATA = \ trellis_siso_f.xml \ trellis_viterbi_combined_xx.xml \ trellis_viterbi_x.xml \ - usrp2_probe.xml \ - usrp2_sink_xxxx.xml \ - usrp2_source_xxxx.xml \ - usrp_dual_sink_x.xml \ - usrp_dual_source_x.xml \ - usrp_probe.xml \ - usrp_simple_sink_x.xml \ - usrp_simple_source_x.xml \ variable.xml \ - variable_check_box.xml \ - variable_chooser.xml \ variable_config.xml \ - variable_slider.xml \ - variable_static_text.xml \ - variable_text_box.xml \ + variable_function_probe.xml \ virtual_sink.xml \ virtual_source.xml \ - wxgui_constellationsink2.xml \ - wxgui_fftsink2.xml \ - wxgui_histosink2.xml \ - wxgui_numbersink2.xml \ - wxgui_scopesink2.xml \ - wxgui_termsink.xml \ - wxgui_waterfallsink2.xml \ xmlrpc_client.xml \ xmlrpc_server.xml diff --git a/grc/blocks/blks2_variable_sink_x.xml b/grc/blocks/blks2_variable_sink_x.xml deleted file mode 100644 index 5709c9f76..000000000 --- a/grc/blocks/blks2_variable_sink_x.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Sink: Custom blks2 block -################################################### - --> -<block> - <name>Variable Sink</name> - <key>blks2_variable_sink_x</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.variable_sink_$(type.fcn)( - vlen=$vlen, - decim=$decim, - callback=self.set_$(variable()), -)</make> - <callback>set_decim($decim)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:i</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:b</opt> - </option> - </param> - <param> - <name>Variable</name> - <key>variable</key> - <value></value> - <type>string</type> - </param> - <param> - <name>Decimation</name> - <key>decim</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - </sink> - <doc> -Read samples from the input stream and \ -write one in every decimation samples to the variable. - -The variable must be the id of an existing variable block. - </doc> -</block> diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..549ffbdbf 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -18,7 +18,6 @@ <block>gr_file_source</block> <block>blks2_tcp_source</block> <block>gr_udp_source</block> - <block>audio_source</block> <block>gr_wavfile_source</block> <block>gr_message_source</block> <block>pad_source</block> @@ -26,29 +25,17 @@ </cat> <cat> <name>Sinks</name> - <block>blks2_variable_sink_x</block> <block>gr_vector_sink_x</block> <block>gr_null_sink</block> <block>gr_file_sink</block> <block>blks2_tcp_sink</block> <block>gr_udp_sink</block> - <block>audio_sink</block> <block>gr_wavfile_sink</block> <block>gr_message_sink</block> <block>pad_sink</block> <block>virtual_sink</block> </cat> <cat> - <name>Graphical Sinks</name> - <block>wxgui_numbersink2</block> - <block>wxgui_scopesink2</block> - <block>wxgui_fftsink2</block> - <block>wxgui_constellationsink2</block> - <block>wxgui_waterfallsink2</block> - <block>wxgui_histosink2</block> - <block>wxgui_termsink</block> - </cat> - <cat> <name>Operators</name> <block>gr_add_xx</block> <block>gr_sub_xx</block> @@ -138,7 +125,7 @@ <block>gr_pll_freqdet_cf</block> <block>gr_pll_refout_cc</block> - <block>gr_fll_band_edge_cc</block> + <block>gr_fll_band_edge_cc</block> <block>gr_correlate_access_code_bb</block> <block>gr_pn_correlator_cc</block> @@ -262,7 +249,7 @@ <block>gr_additive_scrambler_bb</block> </cat> <cat> - <name>Vocoders</name> + <name>Vocoders</name> <block>blks2_cvsd_encode</block> <block>blks2_cvsd_decode</block> </cat> @@ -271,26 +258,13 @@ <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_density_b</block> <block>gr_probe_mpsk_snr_c</block> - <block>probe_function</block> - </cat> - <cat> - <name>USRP</name> - <block>usrp_simple_source_x</block> - <block>usrp_simple_sink_x</block> - <block>usrp_dual_source_x</block> - <block>usrp_dual_sink_x</block> - <block>usrp2_source_xxxx</block> - <block>usrp2_sink_xxxx</block> + <block>gr_probe_signal_f</block> </cat> <cat> <name>Variables</name> <block>variable</block> - <block>variable_slider</block> - <block>variable_chooser</block> - <block>variable_check_box</block> - <block>variable_text_box</block> - <block>variable_static_text</block> <block>variable_config</block> + <block>variable_function_probe</block> <block>parameter</block> </cat> <cat> @@ -315,7 +289,5 @@ <block>xmlrpc_server</block> <block>xmlrpc_client</block> - - <block>notebook</block> </cat> </cat> diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index eb855956a..6bf706ae1 100644 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -7,15 +7,10 @@ <block> <name>Probe Avg Mag^2</name> <key>gr_probe_avg_mag_sqrd_x</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_avg_mag_sqrd_$(type)( - threshold=$threshold, - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha)</make> <callback>set_alpha($alpha)</callback> <callback>set_threshold($threshold)</callback> - <callback>set_probe_rate($probe_rate)</callback> <param> <name>Type</name> <key>type</key> @@ -43,18 +38,13 @@ <value>1</value> <type>real</type> </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> <sink> <name>in</name> <type>$type.input</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: level() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 74d3b0a2b..3a91256aa 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -7,13 +7,9 @@ <block> <name>Probe Density</name> <key>gr_probe_density_b</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_density_b( - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_density_b($alpha)</make> <callback>set_alpha($alpha)</callback> - <callback>set_probe_rate($probe_rate)</callback> <param> <name>Alpha</name> <key>alpha</key> @@ -30,8 +26,9 @@ <name>in</name> <type>byte</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: density() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 7f562d2f3..5687e867d 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -7,49 +7,22 @@ <block> <name>Probe MPSK SNR</name> <key>gr_probe_mpsk_snr_c</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_mpsk_snr_c( - type='$type', - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_mpsk_snr_c($alpha)</make> <callback>set_alpha($alpha)</callback> - <callback>set_probe_rate($probe_rate)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>SNR</name> - <key>snr</key> - </option> - <option> - <name>Signal Mean</name> - <key>signal_mean</key> - </option> - <option> - <name>Noise Variance</name> - <key>noise_variance</key> - </option> - </param> <param> <name>Alpha</name> <key>alpha</key> <value>1</value> <type>real</type> </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> <sink> <name>in</name> <type>complex</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: signal_mean(), noise_variance() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml new file mode 100644 index 000000000..5c38e816f --- /dev/null +++ b/grc/blocks/gr_probe_signal_f.xml @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe Signal +################################################### + --> +<block> + <name>Probe Signal</name> + <key>gr_probe_signal_f</key> + <import>from gnuradio import gr</import> + <make>gr.probe_signal_f()</make> + <sink> + <name>in</name> + <type>float</type> + </sink> + <doc> +Available functions to probe: level() + +Use with the function probe block. + </doc> +</block> diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 4d0dd2899..b27ea900c 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -15,6 +15,10 @@ from grc_gnuradio import wxgui as grc_wxgui import wx #end if +#if $generate_options() == 'qt_gui' +from PyQt4 import Qt +import sys +#end if #if $generate_options() != 'hb' from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -56,12 +60,15 @@ else: self.stop(); self.wait()</callback> <key>generate_options</key> <value>wx_gui</value> <type>enum</type> - <hide>#if $generate_options() == 'wx_gui' then 'part' else 'none'#</hide> <option> <name>WX GUI</name> <key>wx_gui</key> </option> <option> + <name>QT GUI</name> + <key>qt_gui</key> + </option> + <option> <name>No GUI</name> <key>no_gui</key> </option> @@ -98,7 +105,7 @@ else: self.stop(); self.wait()</callback> <value>True</value> <type>bool</type> <hide> -#if $generate_options() == 'wx_gui' +#if $generate_options() in ('qt_gui', 'wx_gui') #if $run() part #else diff --git a/grc/blocks/probe_function.xml b/grc/blocks/probe_function.xml deleted file mode 100644 index ac0b3dcde..000000000 --- a/grc/blocks/probe_function.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Probe Function -################################################### - --> -<block> - <name>Probe Function</name> - <key>probe_function</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_function( - probe_callback=self.$(block_id()).$(function_name()), - probe_rate=$probe_rate, -)</make> - <callback>set_probe_rate($probe_rate)</callback> - <param> - <name>Block ID</name> - <key>block_id</key> - <value>my_block_0</value> - <type>string</type> - </param> - <param> - <name>Function Name</name> - <key>function_name</key> - <value>get_number</value> - <type>string</type> - </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> - <source> - <name>out</name> - <type>float</type> - </source> - <doc> -Polls a function of an arbitrary block and writes the value to the output port. \ -The block id is the id of another block in the flow graph. \ -The function name is the name of a function in the said block. \ -The function should take no arguments and return a floating point or integer number. - </doc> -</block> diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml new file mode 100644 index 000000000..269966c70 --- /dev/null +++ b/grc/blocks/variable_function_probe.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable function probe +################################################### + --> +<block> + <name>Function Probe</name> + <key>variable_function_probe</key> + <import>import time</import> + <import>import threading</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#slurp +def _$(id)_probe(): + while True: + val = self.$(block_id()).$(function_name())($(function_args())) + try: self.set_$(id)(val) + except AttributeError, e: pass + time.sleep(1.0/($poll_rate)) +_$(id)_thread = threading.Thread(target=_$(id)_probe) +_$(id)_thread.daemon = True +_$(id)_thread.start()</make> + <callback>self.set_$(id)($value)</callback> + <param> + <name>Value</name> + <key>value</key> + <value>0</value> + <type>raw</type> + </param> + <param> + <name>Block ID</name> + <key>block_id</key> + <value>my_block_0</value> + <type>string</type> + </param> + <param> + <name>Function Name</name> + <key>function_name</key> + <value>get_number</value> + <type>string</type> + </param> + <param> + <name>Function Args</name> + <key>function_args</key> + <value></value> + <type>string</type> + <hide>#if $function_args() then 'none' else 'part'#</hide> + </param> + <param> + <name>Poll Rate (Hz)</name> + <key>poll_rate</key> + <value>10</value> + <type>real</type> + </param> + <doc> +Periodically probe a function and set its value to this variable. + +Set the values for block ID, function name, and function args appropriately: \ +Block ID should be the ID of another block in this flow graph. \ +Function name should be the name of a class method on that block. \ +Function args are the parameters passed into that function. \ +For a function with no arguments, leave function args blank. \ +When passing a string for the function arguments, quote the string literal: '"arg"'. + +The values will used literally, and generated into the following form: +self.block_id.function_name(function_args) + +To poll a stream for a level, use this with the probe signal block. + </doc> +</block> diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am index dd7411bbb..f89a344f7 100644 --- a/grc/freedesktop/Makefile.am +++ b/grc/freedesktop/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,9 +29,7 @@ dist_ourdata_DATA = \ grc-icon-48.png \ grc-icon-32.png \ gnuradio-grc.xml \ - gnuradio-grc.desktop \ - gnuradio-usrp2_probe.desktop \ - gnuradio-usrp_probe.desktop + gnuradio-grc.desktop pkglibexecdir = $(libexecdir)/$(PACKAGE) dist_pkglibexec_SCRIPTS = grc_setup_freedesktop @@ -42,6 +40,7 @@ grc_setup_freedesktop: $(srcdir)/grc_setup_freedesktop.in Makefile EXTRA_DIST += $(srcdir)/grc_setup_freedesktop.in BUILT_SOURCES += grc_setup_freedesktop +if XDG_UTILS install-data-hook: @printf "\n*** GRC Post-Install Message ***\ \nTo install icons, mime type, and menu items\ @@ -53,3 +52,4 @@ uninstall-hook: \nTo uninstall icons, mime type, and menu items\ \nfor a freedesktop.org system (Gnome/KDE/Xfce):\ \n >>> sudo $(pkglibexecdir)/grc_setup_freedesktop uninstall\n\n" +endif diff --git a/grc/freedesktop/grc_setup_freedesktop.in b/grc/freedesktop/grc_setup_freedesktop.in index ab4ce82ef..1e3546197 100644 --- a/grc/freedesktop/grc_setup_freedesktop.in +++ b/grc/freedesktop/grc_setup_freedesktop.in @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,6 @@ ################################################## ICON_SIZES="32 48 64 128 256" -MENU_ITEMS="grc usrp2_probe usrp_probe" if [ -n "$2" ]; then SRCDIR="$2" else @@ -49,9 +48,7 @@ case "$1" in echo "Install mime type" xdg-mime install ${SRCDIR}/gnuradio-grc.xml echo "Install menu items" - for menu_item in ${MENU_ITEMS}; do \ - xdg-desktop-menu install ${SRCDIR}/gnuradio-${menu_item}.desktop; \ - done + xdg-desktop-menu install ${SRCDIR}/*.desktop echo "Done!" echo "" ;; @@ -68,9 +65,7 @@ case "$1" in echo "Uninstall mime type" xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml echo "Uninstall menu items" - for menu_item in ${MENU_ITEMS}; do \ - xdg-desktop-menu uninstall gnuradio-${menu_item}.desktop; \ - done + xdg-desktop-menu uninstall `ls ${SRCDIR}/*.desktop | xargs -n1 basename` echo "Done!" echo "" ;; diff --git a/grc/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am index 63bb72822..af1d86be9 100644 --- a/grc/grc_gnuradio/Makefile.am +++ b/grc/grc_gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,20 +31,5 @@ blks2_python_PYTHON = \ blks2/__init__.py \ blks2/error_rate.py \ blks2/packet.py \ - blks2/probe.py \ blks2/selector.py \ - blks2/tcp.py \ - blks2/variable_sink.py - -usrp_pythondir = $(grc_gnuradio_prefix)/usrp -usrp_python_PYTHON = \ - usrp/__init__.py \ - usrp/common.py \ - usrp/dual_usrp.py \ - usrp/simple_usrp.py - -wxgui_pythondir = $(grc_gnuradio_prefix)/wxgui -wxgui_python_PYTHON = \ - wxgui/__init__.py \ - wxgui/panel.py \ - wxgui/top_block_gui.py + blks2/tcp.py diff --git a/grc/grc_gnuradio/blks2/__init__.py b/grc/grc_gnuradio/blks2/__init__.py index cb1196f25..fde76f256 100644 --- a/grc/grc_gnuradio/blks2/__init__.py +++ b/grc/grc_gnuradio/blks2/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,4 @@ from packet import options, packet_encoder, packet_decoder, \ packet_mod_b, packet_mod_s, packet_mod_i, packet_mod_f, packet_mod_c, \ packet_demod_b, packet_demod_s, packet_demod_i, packet_demod_f, packet_demod_c from error_rate import error_rate -from probe import probe_function, probe_avg_mag_sqrd_c, probe_avg_mag_sqrd_f, probe_density_b, probe_mpsk_snr_c -from variable_sink import variable_sink_b, variable_sink_s, variable_sink_i, variable_sink_f, variable_sink_c from tcp import tcp_source, tcp_sink diff --git a/grc/grc_gnuradio/blks2/probe.py b/grc/grc_gnuradio/blks2/probe.py deleted file mode 100644 index 8db81f057..000000000 --- a/grc/grc_gnuradio/blks2/probe.py +++ /dev/null @@ -1,123 +0,0 @@ -# -# Copyright 2008 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. -# - -from gnuradio import gr -import threading -import numpy -import time - -####################################################################################### -## Probe: Function -####################################################################################### -class probe_function(gr.hier_block2, threading.Thread): - """ - The thread polls the function for values and writes to a message source. - """ - - def __init__(self, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe_function', - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float), - ) - self._probe_callback = probe_callback - self.set_probe_rate(probe_rate) - #create message source - message_source = gr.message_source(gr.sizeof_float, 1) - self._msgq = message_source.msgq() - #connect - self.connect(message_source, self) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def run(self): - """ - Infinite polling loop. - """ - while True: - time.sleep(1.0/self._probe_rate) - arr = numpy.array(self._probe_callback(), numpy.float32) - msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, 1) - self._msgq.insert_tail(msg) - - def set_probe_rate(self, probe_rate): - self._probe_rate = probe_rate - -class _probe_base(gr.hier_block2): - def __init__(self, probe_block, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe', - gr.io_signature(1, 1, probe_block.input_signature().sizeof_stream_items()[0]), - gr.io_signature(1, 1, gr.sizeof_float), - ) - probe_function_block = probe_function(probe_callback, probe_rate) - #forward callbacks - self.set_probe_rate = probe_function_block.set_probe_rate - #connect - self.connect(self, probe_block) - self.connect(probe_function_block, self) - -####################################################################################### -## Probe: Average Magnitude Squared -####################################################################################### -class _probe_avg_mag_sqrd_base(_probe_base): - def __init__(self, threshold, alpha, probe_rate): - #create block - probe_block = self._probe_block_contructor[0](threshold, alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - self.set_threshold = probe_block.set_threshold - #init - _probe_base.__init__(self, probe_block, probe_block.level, probe_rate) - -class probe_avg_mag_sqrd_c(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_c,) -class probe_avg_mag_sqrd_f(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_f,) - -####################################################################################### -## Probe: Density -####################################################################################### -class probe_density_b(_probe_base): - def __init__(self, alpha, probe_rate): - #create block - probe_block = gr.probe_density_b(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, probe_block.density, probe_rate) - -####################################################################################### -## Probe: MPSK SNR -####################################################################################### -class probe_mpsk_snr_c(_probe_base): - def __init__(self, type, alpha, probe_rate): - """ - Type can be "snr", "signal_mean", or "noise_variance" - """ - #create block - probe_block = gr.probe_mpsk_snr_c(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, getattr(probe_block, type), probe_rate) diff --git a/grc/grc_gnuradio/blks2/variable_sink.py b/grc/grc_gnuradio/blks2/variable_sink.py deleted file mode 100644 index cad3b8b04..000000000 --- a/grc/grc_gnuradio/blks2/variable_sink.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright 2009 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. -# - -from gnuradio import gr -import threading -import numpy - -class _variable_sink_base(gr.hier_block2, threading.Thread): - """ - The thread polls the message queue for values and writes to a callback. - """ - - def __init__(self, vlen, decim, callback): - self._vlen = vlen - self._callback = callback - self._item_size = self._size*self._vlen - #init hier block - gr.hier_block2.__init__( - self, 'variable_sink', - gr.io_signature(1, 1, self._item_size), - gr.io_signature(0, 0, 0), - ) - #create blocks - self._decimator = gr.keep_one_in_n(self._item_size, decim) - self._msgq = gr.msg_queue(2) - message_sink = gr.message_sink(self._item_size, self._msgq, False) - #connect - self.connect(self, self._decimator, message_sink) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def set_decim(self, decim): self._decimator.set_n(decim) - - def run(self): - while True: #truncate to item size, convert to array, callback - msg = self._msgq.delete_head().to_string()[-self._item_size:] - arr = map(self._cast, numpy.fromstring(msg, self._numpy)) - self._callback(self._vlen > 1 and arr or arr[0]) - -class variable_sink_b(_variable_sink_base): _numpy, _size, _cast = numpy.int8, gr.sizeof_char, int -class variable_sink_s(_variable_sink_base): _numpy, _size, _cast = numpy.int16, gr.sizeof_short, int -class variable_sink_i(_variable_sink_base): _numpy, _size, _cast = numpy.int32, gr.sizeof_int, int -class variable_sink_f(_variable_sink_base): _numpy, _size, _cast = numpy.float32, gr.sizeof_float, float -class variable_sink_c(_variable_sink_base): _numpy, _size, _cast = numpy.complex64, gr.sizeof_gr_complex, complex diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 108e23a23..350b297bb 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -282,7 +282,7 @@ class ActionHandler: # Gen/Exec/Stop ################################################## elif action == Actions.FLOW_GRAPH_GEN: - if not self.get_page().get_pid(): + if not self.get_page().get_proc(): if not self.get_page().get_saved() or not self.get_page().get_file_path(): Actions.FLOW_GRAPH_SAVE() #only save if file path missing or not saved if self.get_page().get_saved() and self.get_page().get_file_path(): @@ -293,14 +293,14 @@ class ActionHandler: except Exception,e: Messages.send_fail_gen(e) else: self.generator = None elif action == Actions.FLOW_GRAPH_EXEC: - if not self.get_page().get_pid(): + if not self.get_page().get_proc(): Actions.FLOW_GRAPH_GEN() if self.get_page().get_saved() and self.get_page().get_file_path(): ExecFlowGraphThread(self) elif action == Actions.FLOW_GRAPH_KILL: - if self.get_page().get_pid(): - try: os.kill(self.get_page().get_pid(), signal.SIGKILL) - except: print "could not kill pid: %s"%self.get_page().get_pid() + if self.get_page().get_proc(): + try: self.get_page().get_proc().kill() + except: print "could not kill process: %d"%self.get_page().get_proc().pid elif action == Actions.PAGE_CHANGE: #pass and run the global actions pass else: print '!!! Action "%s" not handled !!!'%action @@ -340,10 +340,10 @@ class ActionHandler: Update the exec and stop buttons. Lock and unlock the mutex for race conditions with exec flow graph threads. """ - sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_pid() + sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_proc() Actions.FLOW_GRAPH_GEN.set_sensitive(sensitive) Actions.FLOW_GRAPH_EXEC.set_sensitive(sensitive) - Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_pid() != None) + Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_proc() != None) class ExecFlowGraphThread(Thread): """Execute the flow graph as a new process and wait on it to finish.""" @@ -362,7 +362,7 @@ class ExecFlowGraphThread(Thread): #get the popen try: self.p = self.page.get_generator().get_popen() - self.page.set_pid(self.p.pid) + self.page.set_proc(self.p) #update self.update_exec_stop() self.start() @@ -385,5 +385,5 @@ class ExecFlowGraphThread(Thread): def done(self): """Perform end of execution tasks.""" Messages.send_end_exec() - self.page.set_pid(None) + self.page.set_proc(None) self.update_exec_stop() diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 9fcbe2a6c..2f761df1f 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -216,7 +216,7 @@ class MainWindow(gtk.Window): """ if not self.page_to_be_closed: self.page_to_be_closed = self.get_page() #show the page if it has an executing flow graph or is unsaved - if self.page_to_be_closed.get_pid() or not self.page_to_be_closed.get_saved(): + if self.page_to_be_closed.get_proc() or not self.page_to_be_closed.get_saved(): self._set_page(self.page_to_be_closed) #unsaved? ask the user if not self.page_to_be_closed.get_saved() and self._save_changes(): @@ -225,7 +225,7 @@ class MainWindow(gtk.Window): self.page_to_be_closed = None #set the page to be closed back to None return #stop the flow graph if executing - if self.page_to_be_closed.get_pid(): Actions.FLOW_GRAPH_KILL() + if self.page_to_be_closed.get_proc(): Actions.FLOW_GRAPH_KILL() #remove the page self.notebook.remove_page(self.notebook.page_num(self.page_to_be_closed)) if ensure and self.notebook.get_n_pages() == 0: self.new_page() #no pages, make a new one diff --git a/grc/gui/NotebookPage.py b/grc/gui/NotebookPage.py index fddfeaf5f..86b6f1513 100644 --- a/grc/gui/NotebookPage.py +++ b/grc/gui/NotebookPage.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ class NotebookPage(gtk.HBox): @param file_path path to a flow graph file """ self._flow_graph = flow_graph - self.set_pid(None) + self.set_proc(None) #import the file self.main_window = main_window self.set_file_path(file_path) @@ -119,19 +119,19 @@ class NotebookPage(gtk.HBox): """ return self.tab - def get_pid(self): + def get_proc(self): """ - Get the pid for the flow graph. - @return the pid number + Get the subprocess for the flow graph. + @return the subprocess object """ - return self.pid + return self.process - def set_pid(self, pid): + def set_proc(self, process): """ - Set the pid number. - @param pid the new pid number + Set the subprocess object. + @param process the new subprocess """ - self.pid = pid + self.process = process def get_flow_graph(self): """ diff --git a/grc/python/Generator.py b/grc/python/Generator.py index d53802bef..b669fa65a 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -90,18 +90,20 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') imports = self._flow_graph.get_imports() variables = self._flow_graph.get_variables() parameters = self._flow_graph.get_parameters() - #list of variables with controls - controls = filter(lambda v: v.get_make(), variables) #list of blocks not including variables and imports and parameters and disabled - blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) - probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list - #get a list of notebooks and sort them according dependencies - notebooks = expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'notebook', blocks), - lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), + def _get_block_sort_text(block): + code = block.get_make().replace(block.get_id(), ' ') + try: code += block.get_param('notebook').get_value() #older gui markup w/ wxgui + except: pass + try: code += block.get_param('gui_hint').get_value() #newer gui markup w/ qtgui + except: pass + return code + blocks = expr_utils.sort_objects( + self._flow_graph.get_enabled_blocks(), + lambda b: b.get_id(), _get_block_sort_text ) #list of regular blocks (all blocks minus the special ones) - blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes + blocks = filter(lambda b: b not in (imports + parameters), blocks) #list of connections where each endpoint is enabled connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections()) messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections()) @@ -125,8 +127,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') 'imports': imports, 'flow_graph': self._flow_graph, 'variables': variables, - 'notebooks': notebooks, - 'controls': controls, 'parameters': parameters, 'blocks': blocks, 'connections': connections, diff --git a/grc/python/Param.py b/grc/python/Param.py index 6dd008d1d..303ab3ed8 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -99,7 +99,7 @@ class Param(_Param, _GUIParam): 'hex', 'string', 'bool', 'file_open', 'file_save', 'id', 'stream_id', - 'grid_pos', 'notebook', + 'grid_pos', 'notebook', 'gui_hint', 'import', ) @@ -354,6 +354,29 @@ class Param(_Param, _GUIParam): except: raise Exception, 'Stream ID "%s" is not found.'%v return v ######################### + # GUI Position/Hint + ######################### + elif t == 'gui_hint': + if ':' in v: tab, pos = v.split(':') + elif '@' in v: tab, pos = v, '' + else: tab, pos = '', v + + if '@' in tab: tab, index = tab.split('@') + else: index = '?' + + widget_str = ({ + (True, True): 'self.%(tab)s_grid_layout_%(index)s.addWidget(%(widget)s, %(pos)s)', + (True, False): 'self.%(tab)s_layout_%(index)s.addWidget(%(widget)s)', + (False, True): 'self.top_grid_layout.addWidget(%(widget)s, %(pos)s)', + (False, False): 'self.top_layout.addWidget(%(widget)s)', + }[bool(tab), bool(pos)])%{'tab': tab, 'index': index, 'widget': '%s', 'pos': pos} + + def gui_hint(ws, w): + if 'layout' in w: ws = ws.replace('addWidget', 'addLayout') + return ws%w + + return lambda w: gui_hint(widget_str, w) + ######################### # Grid Position Type ######################### elif t == 'grid_pos': diff --git a/grc/python/Platform.py b/grc/python/Platform.py index 04db0b9b0..ec3f94096 100644 --- a/grc/python/Platform.py +++ b/grc/python/Platform.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index a1a9308aa..5aaa99793 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -5,8 +5,6 @@ ##@param imports the import statements ##@param flow_graph the flow_graph ##@param variables the variable blocks -##@param notebooks a list of notebook blocks -##@param controls the variables with gui controls ##@param parameters the paramater blocks ##@param blocks the signal blocks ##@param connections the connections @@ -59,6 +57,17 @@ class $(class_name)(grc_wxgui.top_block_gui): _icon_path = "$icon.get_filename()" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #end if +#elif $generate_options == 'qt_gui' +class $(class_name)(gr.top_block, Qt.QWidget): + + def __init__($param_str): + gr.top_block.__init__(self, "$title") + Qt.QWidget.__init__(self) + self.setWindowTitle("$title") + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + self.top_layout = Qt.QVBoxLayout(self) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -112,30 +121,6 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $indent($var.get_var_make()) #end for ######################################################## -##Create Notebooks -######################################################## -#if $notebooks - - $DIVIDER - # Notebooks - $DIVIDER -#end if -#for $notebook in $notebooks - $indent($notebook.get_make()) -#end for -######################################################## -##Create Controls -######################################################## -#if $controls - - $DIVIDER - # Controls - $DIVIDER -#end if -#for $ctrl in $controls - $indent($ctrl.get_make()) -#end for -######################################################## ##Create Message Queues ######################################################## #if $messages @@ -157,7 +142,11 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $DIVIDER #end if #for $blk in filter(lambda b: b.get_make(), $blocks) + #if $blk in $variables + $indent($blk.get_make()) + #else self.$blk.get_id() = $indent($blk.get_make()) + #end if #end for ######################################################## ##Create Connections @@ -196,6 +185,9 @@ self.$port.get_parent().get_id()#slurp ######################################################## #for $var in $parameters + $variables #set $id = $var.get_id() + def get_$(id)(self): + return self.$id + def set_$(id)(self, $id): self.$id = $id #for $callback in $var_id2cbs[$id] @@ -239,12 +231,21 @@ if __name__ == '__main__': if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable realtime scheduling." #end if - tb = $(class_name)($(', '.join($params_eq_list))) #if $generate_options == 'wx_gui' + tb = $(class_name)($(', '.join($params_eq_list))) tb.Run($flow_graph.get_option('run')) + #elif $generate_options == 'qt_gui' + qapp = Qt.QApplication(sys.argv) + tb = $(class_name)($(', '.join($params_eq_list))) + #if $flow_graph.get_option('run') + tb.start() + #end if + tb.show() + qapp.exec_() #elif $generate_options == 'no_gui' #set $run_options = $flow_graph.get_option('run_options') #if $run_options == 'prompt' + tb = $(class_name)($(', '.join($params_eq_list))) tb.start() raw_input('Press Enter to quit: ') tb.stop() diff --git a/grc/scripts/Makefile.am b/grc/scripts/Makefile.am index 9019ec5cc..84e2759dc 100644 --- a/grc/scripts/Makefile.am +++ b/grc/scripts/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,4 +21,4 @@ include $(top_srcdir)/Makefile.common -dist_bin_SCRIPTS = gnuradio-companion usrp2_probe usrp_probe +dist_bin_SCRIPTS = gnuradio-companion diff --git a/gruel/src/include/gruel/Makefile.am b/gruel/src/include/gruel/Makefile.am index d7ac3d332..89a9da7f0 100644 --- a/gruel/src/include/gruel/Makefile.am +++ b/gruel/src/include/gruel/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008,2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,7 @@ EXTRA_DIST += inet.h.in gruelincludedir = $(prefix)/include/gruel gruelinclude_HEADERS = \ + attributes.h \ inet.h \ msg_accepter.h \ msg_accepter_msgq.h \ diff --git a/gruel/src/include/gruel/attributes.h b/gruel/src/include/gruel/attributes.h new file mode 100644 index 000000000..fdf48c977 --- /dev/null +++ b/gruel/src/include/gruel/attributes.h @@ -0,0 +1,56 @@ +/* + * Copyright 2010 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_GRUEL_ATTRIBUTES_H +#define INCLUDED_GRUEL_ATTRIBUTES_H + +//////////////////////////////////////////////////////////////////////// +// Cross-platform attribute macros +//////////////////////////////////////////////////////////////////////// +#if defined __GNUC__ +# define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) +# define __GR_ATTR_UNUSED __attribute__((unused)) +# define __GR_ATTR_INLINE __attribute__((always_inline)) +# define __GR_ATTR_DEPRECATED __attribute__((deprecated)) +# if __GNUC__ >= 4 +# define __GR_ATTR_EXPORT __attribute__((visibility("default"))) +# define __GR_ATTR_IMPORT __attribute__((visibility("default"))) +# else +# define __GR_ATTR_EXPORT +# define __GR_ATTR_IMPORT +# endif +#elif _MSC_VER +# define __GR_ATTR_ALIGNED(x) __declspec(align(x)) +# define __GR_ATTR_UNUSED +# define __GR_ATTR_INLINE __forceinline +# define __GR_ATTR_DEPRECATED __declspec(deprecated) +# define __GR_ATTR_EXPORT __declspec(dllexport) +# define __GR_ATTR_IMPORT __declspec(dllimport) +#else +# define __GR_ATTR_ALIGNED(x) +# define __GR_ATTR_UNUSED +# define __GR_ATTR_INLINE +# define __GR_ATTR_DEPRECATED +# define __GR_ATTR_EXPORT +# define __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_GRUEL_ATTRIBUTES_H */ diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h index d72e5520c..5a8ab1876 100644 --- a/gruel/src/include/gruel/thread.h +++ b/gruel/src/include/gruel/thread.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009,2010 Free Software Foundation, Inc. + * Copyright 2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,21 +21,17 @@ #ifndef INCLUDED_THREAD_H #define INCLUDED_THREAD_H -#include <boost/thread.hpp> -#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/thread/thread.hpp> +#include <boost/thread/mutex.hpp> +#include <boost/thread/locks.hpp> +#include <boost/thread/condition_variable.hpp> namespace gruel { typedef boost::thread thread; typedef boost::mutex mutex; - typedef boost::unique_lock<boost::mutex> scoped_lock; + typedef boost::mutex::scoped_lock scoped_lock; typedef boost::condition_variable condition_variable; - typedef boost::posix_time::time_duration duration; - - /*! - * Returns absolute time 'secs' into the future - */ - boost::system_time get_new_timeout(double secs); } /* namespace gruel */ diff --git a/gruel/src/lib/Makefile.am b/gruel/src/lib/Makefile.am index b9b35ae10..f37ab27a1 100644 --- a/gruel/src/lib/Makefile.am +++ b/gruel/src/lib/Makefile.am @@ -45,7 +45,6 @@ MSG_LIB = msg/libmsg.la libgruel_la_SOURCES = \ realtime.cc \ sys_pri.cc \ - thread.cc \ thread_body_wrapper.cc \ thread_group.cc diff --git a/gruel/src/lib/thread.cc b/gruel/src/lib/thread.cc deleted file mode 100644 index d8f77b506..000000000 --- a/gruel/src/lib/thread.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 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 this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <gruel/thread.h> - -namespace gruel { - - boost::system_time - get_new_timeout(double secs) - { - return boost::get_system_time() + boost::posix_time::milliseconds(long(secs*1e3)); - } - -} diff --git a/usrp2/host/lib/control.cc b/usrp2/host/lib/control.cc index 33a95c078..3b5533eb8 100644 --- a/usrp2/host/lib/control.cc +++ b/usrp2/host/lib/control.cc @@ -27,6 +27,9 @@ #include <iostream> #include <gruel/thread.h> +#include <boost/date_time/posix_time/posix_time.hpp> +namespace pt = boost::posix_time; + namespace usrp2 { pending_reply::pending_reply(unsigned int rid, void *buffer, size_t len) @@ -44,10 +47,9 @@ namespace usrp2 { pending_reply::wait_for_completion(double secs) { gruel::scoped_lock l(d_mutex); - boost::system_time to(gruel::get_new_timeout(secs)); while (!d_complete) { - if (!d_cond.timed_wait(l, to)) + if (!d_cond.timed_wait(l, pt::milliseconds(long(secs*1e3)))) return 0; // timed out } diff --git a/volk/lib/qa_utils.cc b/volk/lib/qa_utils.cc index e85e2c1bc..b0f63d2b5 100644 --- a/volk/lib/qa_utils.cc +++ b/volk/lib/qa_utils.cc @@ -1,13 +1,14 @@ #include "qa_utils.h" -#include <stdlib.h> +#include <cstring> #include <boost/foreach.hpp> #include <boost/assign/list_of.hpp> #include <boost/tokenizer.hpp> //#include <boost/test/unit_test.hpp> #include <iostream> #include <vector> -#include <time.h> -#include <math.h> +#include <list> +#include <ctime> +#include <cmath> #include <boost/lexical_cast.hpp> //#include <volk/volk_runtime.h> #include <volk/volk_registry.h> @@ -61,22 +62,6 @@ void load_random_data(void *data, volk_type_t type, unsigned int n) { } } -void *make_aligned_buffer(unsigned int len, unsigned int size) { - void *buf; - int ret; - ret = posix_memalign((void**)&buf, 16, len * size); - assert(ret == 0); - memset(buf, 0x00, len*size); - return buf; -} - -void make_buffer_for_signature(std::vector<void *> &buffs, std::vector<volk_type_t> inputsig, unsigned int vlen) { - BOOST_FOREACH(volk_type_t sig, inputsig) { - if(!sig.is_scalar) //we don't make buffers for scalars - buffs.push_back(make_aligned_buffer(vlen, sig.size*(sig.is_complex ? 2 : 1))); - } -} - static std::vector<std::string> get_arch_list(const int archs[]) { std::vector<std::string> archlist; int num_archs = archs[0]; @@ -282,6 +267,16 @@ bool icompare(t *in1, t *in2, unsigned int vlen, unsigned int tol) { return fail; } +class volk_qa_aligned_mem_pool{ +public: + void *get_new(size_t size, size_t alignment = 16){ + _mems.push_back(std::vector<char>(size + alignment-1, 0)); + size_t ptr = size_t(&_mems.back().front()); + return (void *)((ptr + alignment-1) & ~(alignment-1)); + } +private: std::list<std::vector<char> > _mems; +}; + bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, float tol, float scalar, int vlen, int iter) { std::cout << "RUN_VOLK_TESTS: " << name << std::endl; @@ -292,7 +287,10 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, std::cout << "no architectures to test" << std::endl; return false; } - + + //something that can hang onto memory and cleanup when this function exits + volk_qa_aligned_mem_pool mem_pool; + //now we have to get a function signature by parsing the name std::vector<volk_type_t> inputsig, outputsig; get_signatures_from_name(inputsig, outputsig, name); @@ -309,12 +307,12 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, //for(int i=0; i<inputsig.size(); i++) std::cout << "Input: " << inputsig[i].str << std::endl; //for(int i=0; i<outputsig.size(); i++) std::cout << "Output: " << outputsig[i].str << std::endl; std::vector<void *> inbuffs; - std::vector<void *> free_buffs; //this is just a list of void*'s that i'll have to free later. - //we need it because we dupe void*s in test_data below. - make_buffer_for_signature(inbuffs, inputsig, vlen); + BOOST_FOREACH(volk_type_t sig, inputsig) { + if(!sig.is_scalar) //we don't make buffers for scalars + inbuffs.push_back(mem_pool.get_new(vlen*sig.size*(sig.is_complex ? 2 : 1))); + } for(int i=0; i<inbuffs.size(); i++) { - load_random_data(inbuffs[i], inputsig[i], vlen); - free_buffs.push_back(inbuffs[i]); + load_random_data(inbuffs[i], inputsig[i], vlen); } //ok let's make a vector of vector of void buffers, which holds the input/output vectors for each arch @@ -322,8 +320,7 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, for(int i=0; i<arch_list.size(); i++) { std::vector<void *> arch_buffs; for(int j=0; j<outputsig.size(); j++) { - arch_buffs.push_back(make_aligned_buffer(vlen, outputsig[j].size*(outputsig[j].is_complex ? 2 : 1))); - free_buffs.push_back(arch_buffs.back()); + arch_buffs.push_back(mem_pool.get_new(vlen*outputsig[j].size*(outputsig[j].is_complex ? 2 : 1))); } for(int j=0; j<inputsig.size(); j++) { arch_buffs.push_back(inbuffs[j]); @@ -437,10 +434,6 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, } } - BOOST_FOREACH(void *buf, free_buffs) { - free(buf); - } - return fail_global; } diff --git a/volk/lib/qa_utils.h b/volk/lib/qa_utils.h index e2539060a..1b64bacaa 100644 --- a/volk/lib/qa_utils.h +++ b/volk/lib/qa_utils.h @@ -1,7 +1,7 @@ #ifndef VOLK_QA_UTILS_H #define VOLK_QA_UTILS_H -#include <stdlib.h> +#include <cstdlib> #include <string> struct volk_type_t { |