From 425f41c77dcf1616c36e678b9201c87f582efbde Mon Sep 17 00:00:00 2001 From: gregory guy Date: Mon, 24 May 2021 17:04:53 +0200 Subject: some updates on cmake stuff in order to build aRts with optional backend (alsa, jack...) Rename gslconfig.h.in into gslconfig.h.cmake for consistency with the other modules. Add man3 pages (gsl). Add Network Audio System (Nas) support. Add Open Sound System (OSS) support. Signed-off-by: gregory guy --- CMakeLists.txt | 284 ++++----------- ConfigureChecks.cmake | 319 +++++++++++++++++ config.h.cmake | 92 ++++- doc/CMakeLists.txt | 1 + doc/man/CMakeLists.txt | 1 + doc/man/man3/CMakeLists.txt | 10 + doc/man/man3/gsl.3 | 822 ++++++++++++++++++++++++++++++++++++++++++++ flow/CMakeLists.txt | 104 ++++-- flow/audioiooss.cpp | 13 +- flow/copy of CMakeLists.txt | 87 +++++ flow/gsl/CMakeLists.txt | 176 +++------- flow/gsl/gsl.3 | 822 -------------------------------------------- flow/gsl/gslconfig.h.cmake | 11 + flow/gsl/gslconfig.h.in | 11 - mcop/dispatcher.cpp | 19 +- mcop/md5auth.cpp | 16 +- 16 files changed, 1534 insertions(+), 1254 deletions(-) create mode 100644 ConfigureChecks.cmake create mode 100644 doc/CMakeLists.txt create mode 100644 doc/man/CMakeLists.txt create mode 100644 doc/man/man3/CMakeLists.txt create mode 100644 doc/man/man3/gsl.3 create mode 100644 flow/copy of CMakeLists.txt delete mode 100644 flow/gsl/gsl.3 create mode 100644 flow/gsl/gslconfig.h.cmake delete mode 100644 flow/gsl/gslconfig.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 282ff29..d0426a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,34 +1,18 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# +########################################### +# # +# (C) 2010 Serghei Amelian # +# serghei (DOT) amelian (AT) gmail.com # +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 2 # +# # +########################################### cmake_minimum_required( VERSION 2.8.12 ) -##### include essential cmake modules ########### - -include( CheckCXXSourceCompiles ) -include( CheckFunctionExists ) -include( CheckSymbolExists ) -include( CheckPrototypeDefinition ) -include( CheckIncludeFile ) -include( CheckLibraryExists ) -include( FindPkgConfig ) - - -##### include our cmake modules ################# -set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) -include( TDEMacros ) - - -##### project settings ########################## +##### general package setup project( arts ) @@ -38,20 +22,24 @@ set( ARTS_MICRO_VERSION 10 ) set( ARTS_VERSION "${ARTS_MAJOR_VERSION}.${ARTS_MINOR_VERSION}.${ARTS_MICRO_VERSION}" ) -##### user requested options #################### +##### include essential cmake modules -option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) -option( WITH_ALSA "Enable ALSA support" ON ) -option( WITH_AUDIOFILE "Enable audiofile (wav) support" ON ) -option( WITH_VORBIS "Enable Ogg/Vorbis support" ON ) -option( WITH_MAD "Enable MAD mp3 decoder support" ON ) -option( WITH_ESOUND "Enable ESOUND support" ${WITH_ALL_OPTIONS} ) -option( WITH_JACK "Enable JACK support" ${WITH_ALL_OPTIONS} ) -option( WITH_SNDIO "Enable SNDIO support" OFF ) -option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +include( FindPkgConfig ) +include( CheckFunctionExists ) +include( CheckSymbolExists ) +include( CheckIncludeFile ) +include( CheckIncludeFiles ) +include( CheckLibraryExists ) +include( CheckPrototypeDefinition ) +include( CheckCSourceCompiles ) + +##### include our cmake modules + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) -##### paths setup ############################### +##### setup install paths tde_setup_install_path( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ) tde_setup_install_path( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" ) @@ -60,184 +48,60 @@ tde_setup_install_path( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/$ tde_setup_install_path( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" ) -##### setup architecture flags ################## - -tde_setup_architecture_flags( ) - -include(TestBigEndian) -test_big_endian(WORDS_BIGENDIAN) - -tde_setup_largefiles( ) - - -##### check for include files ################### - -check_include_file( "sys/time.h" HAVE_SYS_TIME_H ) -check_include_file( "time.h" TIME_WITH_SYS_TIME ) -check_include_file( "stdio.h" HAVE_STDIO_H ) -check_include_file( "stdlib.h" HAVE_STDLIB_H ) -check_include_file( "string.h" HAVE_STRING_H ) -check_include_file( "strings.h" HAVE_STRINGS_H ) -check_include_file( "ctype.h" HAVE_CTYPE_H ) -check_include_file( "malloc.h" HAVE_MALLOC_H ) -check_include_file( "memory.h" HAVE_MEMORY_H ) -check_include_file( "dlfcn.h" HAVE_DLFCN_H ) -check_include_file( "sys/soundcard.h" HAVE_SYS_SOUNDCARD_H ) -check_include_file( "pthread.h" HAVE_LIBPTHREAD ) - - -##### check for system libraries ################ - -set( DL_LIBRARIES dl ) -check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL ) -if( NOT HAVE_LIBDL ) - unset( DL_LIBRARIES ) - check_function_exists( dlopen HAVE_DLOPEN ) - if( HAVE_DLOPEN ) - set( HAVE_LIBDL 1 ) - endif( HAVE_DLOPEN ) -endif( NOT HAVE_LIBDL ) - -find_package( Threads ) - - -##### check for functions ####################### - -set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) -set( CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES} ) -check_function_exists( dlerror HAVE_DLERROR ) -check_function_exists( strcmp HAVE_STRCMP ) -check_function_exists( strchr HAVE_STRCHR ) -check_function_exists( index HAVE_INDEX ) -check_function_exists( strrchr HAVE_STRRCHR ) -check_function_exists( rindex HAVE_RINDEX ) -check_function_exists( memcpy HAVE_MEMCPY ) -check_function_exists( bcopy HAVE_BCOPY ) -set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) -unset( bak_CMAKE_REQUIRED_LIBRARIES ) -check_prototype_definition( ioctl "int ioctl(int d, int request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_INT_DOTS ) -check_prototype_definition( ioctl "int ioctl(int d, unsigned long request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_ULONG_DOTS ) - - -##### check for audiofile ####################### - -set( HAVE_LIBAUDIOFILE 0 ) -if( WITH_AUDIOFILE ) - - pkg_search_module( AUDIOFILE audiofile ) - if( AUDIOFILE_FOUND ) - set( HAVE_LIBAUDIOFILE 1 ) - else( AUDIOFILE_FOUND ) - message(FATAL_ERROR "\naudiofile (wav) support are requested, but `libaudiofile` not found" ) - endif( AUDIOFILE_FOUND ) - -endif( WITH_AUDIOFILE ) - - -##### check for alsa ############################ - -set( HAVE_LIBASOUND2 0 ) -if( WITH_ALSA ) - - pkg_search_module( ALSA alsa ) - - if( ALSA_FOUND ) - - # there is support only for ALSA 1.x - - set( HAVE_LIBASOUND2 1 ) - set( ALSA_PCM_OLD_SW_PARAMS_API 1 ) - set( ALSA_PCM_OLD_HW_PARAMS_API 1 ) - - check_include_file( "alsa/asoundlib.h" HAVE_ALSA_ASOUNDLIB_H ) - if( NOT HAVE_ALSA_ASOUNDLIB_H ) - check_include_file( "sys/asoundlib.h" HAVE_SYS_ASOUNDLIB_H ) - endif( NOT HAVE_ALSA_ASOUNDLIB_H ) - - set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) - set( CMAKE_REQUIRED_LIBRARIES ${ALSA_LIBRARIES} ) - check_function_exists( snd_pcm_resume HAVE_SND_PCM_RESUME ) - set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) - unset( bak_CMAKE_REQUIRED_LIBRARIES ) - - else( ALSA_FOUND ) - - message(FATAL_ERROR "\nALSA support are requested, but not found on your system" ) - - endif( ALSA_FOUND ) - -endif( WITH_ALSA ) - - -##### check for esound ####################### - -set( HAVE_LIBESD 0 ) -if( WITH_ESOUND ) +##### optional stuff - pkg_search_module( ESOUND esound ) - if( ESOUND_FOUND ) - set( HAVE_LIBESD 1 ) - else( ESOUND_FOUND ) - message(FATAL_ERROR "\nESOUND support is requested, but `libesd` not found" ) - endif( ESOUND_FOUND ) - -endif( WITH_ESOUND ) +option( WITH_ALL_OPTIONS "Enable all optional support" ON ) +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +option( WITH_ALSA "Enable ALSA support" ${WITH_ALL_OPTIONS} ) +option( WITH_AUDIOFILE "Enable audiofile (wav) support" ${WITH_ALL_OPTIONS} ) +option( WITH_VORBIS "Enable Ogg/Vorbis support" ${WITH_ALL_OPTIONS} ) +option( WITH_MAD "Enable MAD mp3 decoder support" ${WITH_ALL_OPTIONS} ) +option( WITH_ESOUND "Enable ESOUND support" ${WITH_ALL_OPTIONS} ) +option( WITH_JACK "Enable JACK support" ${WITH_ALL_OPTIONS} ) +option( WITH_SNDIO "Enable SNDIO support" OFF ) +option( WITH_NAS "Enable Network Audio System support" ${WITH_ALL_OPTIONS} ) +option( WITH_OSS "Enable Open Sound System support" OFF ) +option( WITH_TOSS "Enable Threaded Open Sound System support" OFF ) -##### check for JACK ############################ +##### user requested modules -set( HAVE_LIBJACK 0 ) -if( WITH_JACK ) - pkg_search_module( LIBJACK jack ) - if( LIBJACK_FOUND ) - set( HAVE_LIBJACK 1 ) - else( LIBJACK_FOUND ) - message(FATAL_ERROR "\nJACK support is requested, but `jack.pc` was not found" ) - endif( LIBJACK_FOUND ) -endif( WITH_JACK ) +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) -##### check for SNDIO ########################### +##### configure checks -set( HAVE_LIBSNDIO 0 ) -if( WITH_SNDIO ) - check_include_file( "sndio.h" HAVE_SNDIO_H ) - if( HAVE_SNDIO_H ) - set( HAVE_LIBSNDIO 1 ) - set( LIBSNDIO_LIBRARIES "sndio" ) - else( HAVE_SNDIO_H ) - tde_message_fatal( "SNDIO support is requested, but `sndio.h` was not found" ) - endif( HAVE_SNDIO_H ) -endif( WITH_SNDIO ) +include( ConfigureChecks.cmake ) -##### check for glib/gthread modules ############ +###### global compiler settings -pkg_search_module( GLIB2 glib-2.0 ) +add_definitions( -DHAVE_CONFIG_H ) -if( GLIB2_FOUND ) - pkg_search_module( GTHREAD2 gthread-2.0 ) - if( NOT GTHREAD2_FOUND ) - message(FATAL_ERROR "\ngthread-2.0 are required, but not found on your system" ) - endif( NOT GTHREAD2_FOUND ) -else( GLIB2_FOUND ) - message(FATAL_ERROR "\nglib-2.0 are required, but not found on your system" ) -endif( GLIB2_FOUND ) - - -##### check for TQt ############################# +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) -find_package( TQt ) +##### directories -##### check for gcc visibility support ######### +add_subdirectory( libltdl ) +add_subdirectory( mcop ) +add_subdirectory( mcopidl ) +add_subdirectory( flow ) +#add_subdirectory( mcop_mt ) +#add_subdirectory( soundserver ) +#add_subdirectory( artsc ) +#add_subdirectory( gmcop ) +#add_subdirectory( qtmcop ) -if( WITH_GCC_VISIBILITY ) - tde_setup_gcc_visibility( ) -endif( ) +tde_conditional_add_subdirectory( BUILD_DOC doc ) +#tde_conditional_add_subdirectory( BUILD_TRANSLATIONS translations ) -##### write config.h file ####################### +##### write configure files configure_file( config.h.cmake config.h @ONLY ) @@ -277,25 +141,3 @@ string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${I string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} ) configure_file( arts.pc.cmake arts.pc @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/arts.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} ) - - -##### global compiler settings ################## - -add_definitions( - -DHAVE_CONFIG_H -) - -set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) - - -##### project subdirectories #################### - -add_subdirectory( libltdl ) -add_subdirectory( mcop ) -add_subdirectory( mcopidl ) -add_subdirectory( flow ) -add_subdirectory( mcop_mt ) -add_subdirectory( soundserver ) -add_subdirectory( artsc ) -add_subdirectory( gmcop ) -add_subdirectory( qtmcop ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..9095e9e --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,319 @@ +########################################### +# # +# (C) 2010 Serghei Amelian # +# serghei (DOT) amelian (AT) gmail.com # +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 2 # +# # +########################################### + +# required stuff + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + + +##### check for gcc visibility support + +if( WITH_GCC_VISIBILITY ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) + + +find_package( Threads ) + + +##### check for include files + +check_include_file( "stdio.h" HAVE_STDIO_H ) +check_include_file( "stdlib.h" HAVE_STDLIB_H ) +check_include_file( "string.h" HAVE_STRING_H ) +check_include_file( "strings.h" HAVE_STRINGS_H ) +check_include_file( "ctype.h" HAVE_CTYPE_H ) +check_include_file( "malloc.h" HAVE_MALLOC_H ) +check_include_file( "memory.h" HAVE_MEMORY_H ) +check_include_file( "dlfcn.h" HAVE_DLFCN_H ) +check_include_file( "sys/select.h" HAVE_SYS_SELECT_H ) +check_include_file( "csl/csl.h" HAVE_LIBCSL ) +check_include_file( "libaudioio.h" HAVE_LIBAUDIOIO ) +check_include_file( "mas/mas.h" HAVE_LIBMAS ) +check_include_file( "pthread.h" HAVE_LIBPTHREAD ) + +check_include_file( "sys/time.h" HAVE_SYS_TIME_H ) +check_include_files( "sys/time.h;time.h" TIME_WITH_SYS_TIME ) + +check_include_file( "sys/soundcard.h" HAVE_SYS_SOUNDCARD_H ) +check_include_files( "sys/soundcard.h;soundcard.h" HAVE_SOUNDCARD_H ) + + +##### check for system library dl + +set( DL_LIBRARIES dl ) +check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL ) + +if( NOT HAVE_LIBDL ) + unset( DL_LIBRARIES ) + check_function_exists( dlopen HAVE_DLOPEN ) + if( HAVE_DLOPEN ) + set( HAVE_LIBDL 1 ) + endif( HAVE_DLOPEN ) +endif( NOT HAVE_LIBDL ) + + +##### check for functions ####################### + +set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) +set( CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES} ) +check_function_exists( dlerror HAVE_DLERROR ) +check_function_exists( strcmp HAVE_STRCMP ) +check_function_exists( strchr HAVE_STRCHR ) +check_function_exists( index HAVE_INDEX ) +check_function_exists( strrchr HAVE_STRRCHR ) +check_function_exists( rindex HAVE_RINDEX ) +check_function_exists( memcpy HAVE_MEMCPY ) +check_function_exists( bcopy HAVE_BCOPY ) +set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) +unset( bak_CMAKE_REQUIRED_LIBRARIES ) +check_prototype_definition( ioctl "int ioctl(int d, int request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_INT_DOTS ) +check_prototype_definition( ioctl "int ioctl(int d, unsigned long request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_ULONG_DOTS ) + + +##### check for audiofile + +set( HAVE_LIBAUDIOFILE 0 ) + +if( WITH_AUDIOFILE ) + pkg_search_module( AUDIOFILE audiofile ) + if( AUDIOFILE_FOUND ) + set( HAVE_LIBAUDIOFILE 1 ) + else() + tde_message_fatal( "audiofile (wav) support has been requested, but was not found" ) + endif() +endif( WITH_AUDIOFILE ) + + +##### check for alsa + +set( HAVE_LIBASOUND2 0 ) + +if( WITH_ALSA ) + pkg_search_module( ALSA alsa ) + if( ALSA_FOUND ) # there is support only for ALSA 1.x + set( HAVE_LIBASOUND2 1 ) + set( ALSA_PCM_OLD_SW_PARAMS_API 1 ) # where is It neded? + set( ALSA_PCM_OLD_HW_PARAMS_API 1 ) # where is It neded? + + check_include_file( "alsa/asoundlib.h" HAVE_ALSA_ASOUNDLIB_H ) + if( NOT HAVE_ALSA_ASOUNDLIB_H ) + check_include_file( "sys/asoundlib.h" HAVE_SYS_ASOUNDLIB_H ) + endif() + + set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) + set( CMAKE_REQUIRED_LIBRARIES ${ALSA_LIBRARIES} ) + check_function_exists( snd_pcm_resume HAVE_SND_PCM_RESUME ) + set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) + unset( bak_CMAKE_REQUIRED_LIBRARIES ) + else() + tde_message_fatal( "ALSA support has been requested, but was not found" ) + endif() +endif( WITH_ALSA ) + + +##### check for esound + +set( HAVE_LIBESD 0 ) + +if( WITH_ESOUND ) + pkg_search_module( ESOUND esound ) + if( ESOUND_FOUND ) + set( HAVE_LIBESD 1 ) + else() + tde_message_fatal( "ESOUND support has been requested, but was not found" ) + endif() +endif( WITH_ESOUND ) + + +##### check for JACK + +set( HAVE_LIBJACK 0 ) + +if( WITH_JACK ) + pkg_search_module( LIBJACK jack ) + if( LIBJACK_FOUND ) + set( HAVE_LIBJACK 1 ) + else() + tde_message_fatal( "JACK support has been requested, but was not found" ) + endif( LIBJACK_FOUND ) +endif( WITH_JACK ) + + +##### check for Network Audio System + +if( WITH_NAS ) + find_path( NAS_HEADER "audio/audiolib.h" ) + find_library( NAS_LIBRARY audio ) + + if( NAS_HEADER AND NAS_LIBRARY ) + set( HAVE_LIBAUDIONAS 1 ) + set( NAS_INCLUDE_DIR "${NAS_HEADER}" ) + set( NAS_LIBRARIES ${NAS_LIBRARY} ) + message( STATUS "Looking for Nas - found" ) + else() + tde_message_fatal( "Nas support has been requested, but was not found" ) + endif() +endif( WITH_NAS ) + + +##### check for Open Sound System + +if( WITH_OSS OR WITH_TOSS ) + find_path( OSS_HEADER "sys/soundcard.h" + NO_DEFAULT_PATH + HINTS /usr/lib/oss/include + /usr/lib64/oss/include + ) + find_library( OSS_LIBRARY OSSlib + NO_DEFAULT_PATH + HINTS /usr/lib/oss/lib + /usr/lib64/oss/lib + ) + if( OSS_HEADER AND OSS_LIBRARY ) + set( OSS_INCLUDE_DIR "${OSS_HEADER}" ) + set( OSS_LIBRARIES "${OSS_LIBRARY}" ) + else() + tde_message_fatal( "OSS support has been requested, but was not found" ) + endif() +endif( WITH_OSS OR WITH_TOSS ) + + +##### check for SNDIO ########################### + +set( HAVE_LIBSNDIO 0 ) +if( WITH_SNDIO ) + check_include_file( "sndio.h" HAVE_SNDIO_H ) + if( HAVE_SNDIO_H ) + set( HAVE_LIBSNDIO 1 ) + set( LIBSNDIO_LIBRARIES "sndio" ) + else( HAVE_SNDIO_H ) + tde_message_fatal( "SNDIO support is requested, but `sndio.h` was not found" ) + endif( HAVE_SNDIO_H ) +endif( WITH_SNDIO ) + + +##### check for glib/gthread + +pkg_search_module( GLIB2 glib-2.0 ) + +if( GLIB2_FOUND ) + pkg_search_module( GTHREAD2 gthread-2.0 ) + if( NOT GTHREAD2_FOUND ) + tde_message_fatal( "gthread-2.0 is required, but was not found on your system" ) + endif() + else() + tde_message_fatal( "glib-2.0 is required, but was not found on your system" ) +endif( GLIB2_FOUND ) + + +##### check for ogg/vorbis + +set( GSL_HAVE_OGGVORBIS 0 ) + +if( WITH_VORBIS ) + pkg_search_module( VORBIS vorbis ) + if( VORBIS_FOUND ) + pkg_search_module( LIBOGG ogg ) + if( NOT LIBOGG_FOUND ) + tde_message_fatal( "Ogg/Vorbis support has been requested, but Ogg was not found" ) + endif() + pkg_search_module( LIBVORBISENC vorbisenc ) + pkg_search_module( VORBISFILE vorbisfile ) + if( VORBISFILE_FOUND ) + set( GSL_HAVE_OGGVORBIS 1 ) + + set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) + set( CMAKE_REQUIRED_LIBRARIES ${VORBISFILE_LIBRARIES} ) + check_c_source_compiles(" + #include + int main() + { + ov_read_float(0,0,0); + return 0; + }" GSL_HAVE_OGGVORBIS_RC3 + ) + if( NOT GSL_HAVE_OGGVORBIS_RC3 ) + set( GSL_HAVE_OGGVORBIS_RC3 0 ) + endif() + set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) + else() + tde_message_fatal( "Ogg/Vorbis support has been requested, but `libvorbisfile` was not found" ) + endif() + else() + tde_message_fatal( "Ogg/Vorbis support has been requested, but `libvorbis` was not found" ) + endif() +endif( WITH_VORBIS ) + + +##### check for libmad + +set( GSL_HAVE_LIBMAD 0 ) + +if( WITH_MAD ) + pkg_search_module( MAD mad ) + if( MAD_FOUND ) + set( GSL_HAVE_LIBMAD 1 ) + else() + find_library( MAD_LIBRARIES NAMES mad ) + find_path( MAD_INCLUDE_DIRS mad.h ) + if( NOT MAD_LIBRARIES ) + tde_message_fatal( "Mad support has been requested, but `libmad` was not found" ) + endif() + endif() +endif( WITH_MAD ) + + +##### check for some type sizes ################# + +include( CheckTypeSize ) + +check_type_size( pthread_mutex_t GSL_SIZEOF_PTH_MUTEX_T ) +check_type_size( pthread_cond_t GSL_SIZEOF_PTH_COND_T ) +check_type_size( intmax_t GSL_SIZEOF_STD_INTMAX_T ) + +set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) +set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ) +check_c_source_compiles( + "#define _XOPEN_SOURCE 500 + #include + int main() + { + int (*attr_settype) (pthread_mutexattr_t *__attr, int __kind) = pthread_mutexattr_settype; + int val = PTHREAD_MUTEX_RECURSIVE; attr_settype = 0; val = 0; + return 0; + }" + GSL_HAVE_MUTEXATTR_SETTYPE ) + if( NOT GSL_HAVE_MUTEXATTR_SETTYPE ) + set( GSL_HAVE_MUTEXATTR_SETTYPE 0 ) + endif( NOT GSL_HAVE_MUTEXATTR_SETTYPE ) +set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) + +set( GSL_USE_GSL_GLIB 1 ) +set( GSL_USE_ARTS_THREADS 1 ) + + +##### check for sse on x86 cpus + +if( ${CMAKE_ARCHITECTURE} MATCHES "i.86" ) + check_c_source_compiles(" + int main() + { + __asm__(\"movups %xmm0, (%esp)\"); + return 0; + }" HAVE_X86_SSE + ) +endif( ${CMAKE_ARCHITECTURE} MATCHES "i.86" ) diff --git a/config.h.cmake b/config.h.cmake index 7c2f7c8..404d8d3 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -5,18 +5,89 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ #cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ -#cmakedefine HAVE_SYS_TIME_H 1 -#cmakedefine TIME_WITH_SYS_TIME 1 + +/* Defined if you have header */ #cmakedefine HAVE_STDIO_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_STDLIB_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_STRING_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_STRINGS_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_CTYPE_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_MALLOC_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_MEMORY_H 1 + +/* Defined if you have header */ #cmakedefine HAVE_DLFCN_H 1 +/* Defined if you have both and headers */ +#cmakedefine TIME_WITH_SYS_TIME 1 + +/* Defined if you have either or header */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Defined with system library dl */ #cmakedefine HAVE_LIBDL 1 + +/* Defined if you have libaudiofile */ +#cmakedefine HAVE_LIBAUDIOFILE 1 + +/* defined if you have Alsa library */ +#cmakedefine HAVE_LIBASOUND2 1 + +/* Defined if you have header */ +#cmakedefine HAVE_ALSA_ASOUNDLIB_H 1 + +/* Defined if you have snd_pcm_resume() (Alsa) */ +#cmakedefine HAVE_SND_PCM_RESUME 1 + +#cmakedefine ALSA_PCM_OLD_SW_PARAMS_API 1 +#cmakedefine ALSA_PCM_OLD_HW_PARAMS_API 1 + +/* Defined if you have header */ +#cmakedefine HAVE_SYS_SELECT_H 1 + +/* Defined if you have header */ +#cmakedefine HAVE_LIBCSL 1 + +/* Defined if you have esound (Enlightened Sound Daemon) */ +#cmakedefine HAVE_LIBESD 1 + +/* Defined if you have Jack Audio Connection Kit */ +#cmakedefine HAVE_LIBJACK 1 + +/* Defined if you have header */ +#cmakedefine HAVE_LIBAUDIOIO 1 + +/* Defined if you have header */ +#cmakedefine HAVE_LIBMAS 1 + +/* Defined if you have Network Audio System (Nas) */ +#cmakedefine HAVE_LIBAUDIONAS 1 + +/* Defined if you have both and headers */ +#cmakedefine HAVE_SOUNDCARD_H 1 + +/* Defined if you have either or header */ +#cmakedefine HAVE_SYS_SOUNDCARD_H 1 + +/* Defined if you have header */ +#cmakedefine HAVE_LIBPTHREAD 1 + +/* Defined for x86 cpus with sse instructions */ +#cmakedefine HAVE_X86_SSE 1 + + #define LTDL_OBJDIR "." #cmakedefine HAVE_DLERROR 1 @@ -28,20 +99,17 @@ #cmakedefine HAVE_MEMCPY 1 #cmakedefine HAVE_BCOPY 1 -#cmakedefine HAVE_LIBAUDIOFILE 1 -#cmakedefine HAVE_LIBESD 1 -#cmakedefine HAVE_LIBASOUND2 1 -#cmakedefine HAVE_ALSA_ASOUNDLIB_H 1 -#cmakedefine HAVE_SND_PCM_RESUME 1 -#cmakedefine ALSA_PCM_OLD_SW_PARAMS_API 1 -#cmakedefine ALSA_PCM_OLD_HW_PARAMS_API 1 -#cmakedefine HAVE_SYS_SOUNDCARD_H 1 -#cmakedefine HAVE_LIBPTHREAD 1 + + + + + + #cmakedefine HAVE_IOCTL_INT_INT_DOTS 1 #cmakedefine HAVE_IOCTL_INT_ULONG_DOTS 2 -#cmakedefine HAVE_LIBJACK 1 + #cmakedefine HAVE_LIBSNDIO 1 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..b0bb74c --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory( man ) diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt new file mode 100644 index 0000000..b647036 --- /dev/null +++ b/doc/man/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory( man3 ) diff --git a/doc/man/man3/CMakeLists.txt b/doc/man/man3/CMakeLists.txt new file mode 100644 index 0000000..fc204c3 --- /dev/null +++ b/doc/man/man3/CMakeLists.txt @@ -0,0 +1,10 @@ +file( GLOB _man_files *.3 ) + +if( _man_files ) + INSTALL( + FILES ${_man_files} + DESTINATION ${MAN_INSTALL_DIR}/man3 + COMPONENT doc + ) +endif() + diff --git a/doc/man/man3/gsl.3 b/doc/man/man3/gsl.3 new file mode 100644 index 0000000..2f7bb31 --- /dev/null +++ b/doc/man/man3/gsl.3 @@ -0,0 +1,822 @@ +.TH "GSL-Functions" 3 "17 May 2002" "BEAST-0.4.1" "BEAST-0.4.1" +.SH NAME +GSL-Functions \- GSL Function Reference +.SH SYNOPSIS +\fBgsl_thread_wakeup\fP (\fIthread\fP); +.br +\fBgsl_thread_abort\fP (\fIthread\fP); +.br +\fBgsl_thread_queue_abort\fP (\fIthread\fP); +.br +\fBgsl_thread_aborted\fP (); +.br +\fBgsl_thread_sleep\fP (\fImax_msec\fP); +.br +\fBgsl_thread_awake_after\fP (\fItick_stamp\fP); +.br +\fBgsl_thread_awake_before\fP (\fItick_stamp\fP); +.br +\fBgsl_tick_stamp\fP (); +.br +\fBgsl_data_find_block\fP (\fIhandle\fP, \fIn_values\fP, \fIvalues\fP, \fIepsilon\fP); +.br +\fBgsl_module_tick_stamp\fP (\fImodule\fP); +.br +\fBgsl_job_integrate\fP (\fImodule\fP); +.br +\fBgsl_job_discard\fP (\fImodule\fP); +.br +\fBgsl_job_connect\fP (\fIsrc_module\fP, \fIsrc_ostream\fP, \fIdest_module\fP, \fIdest_istream\fP); +.br +\fBgsl_job_disconnect\fP (\fIdest_module\fP, \fIdest_istream\fP); +.br +\fBGslAccessFunc\fP (\fImodule\fP, \fIdata\fP); +.br +\fBgsl_job_access\fP (\fImodule\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); +.br +\fBgsl_flow_job_access\fP (\fImodule\fP, \fItick_stamp\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); +.br +\fBGslPollFunc\fP (\fIdata\fP, \fIn_values\fP, \fItimeout_p\fP, \fIn_fds\fP, \fIfds\fP, \fIrevents_filled\fP); +.br +\fBgsl_job_add_poll\fP (\fIpoll_func\fP, \fIdata\fP, \fIfree_func\fP, \fIn_fds\fP, \fIfds\fP); +.br +\fBgsl_job_remove_poll\fP (\fIpoll_func\fP, \fIdata\fP); +.br +\fBgsl_job_debug\fP (\fIdebug\fP); +.br +\fBgsl_trans_open\fP (); +.br +\fBgsl_trans_add\fP (\fItrans\fP, \fIjob\fP); +.br +\fBgsl_trans_commit\fP (\fItrans\fP); +.br +\fBgsl_trans_dismiss\fP (\fItrans\fP); +.br +\fBgsl_transact\fP (\fIjob\fP, \fI...\fP); +.br +\fBgsl_engine_init\fP (\fIrun_threaded\fP, \fIblock_size\fP, \fIsample_freq\fP, \fIsub_sample_mask\fP); +.br +\fBgsl_engine_wait_on_trans\fP (); +.br +\fBgsl_power2_fftac\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); +.br +\fBgsl_power2_fftsc\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); +.br +\fBgsl_power2_fftar\fP (\fIn_values\fP, \fIr_values_in\fP, \fIri_values_out\fP); +.br +\fBgsl_power2_fftsr\fP (\fIn_values\fP, \fIri_values_in\fP, \fIr_values_out\fP); +.br +\fBgsl_filter_tscheb2_steepness_db\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIstopband_db\fP); +.br +\fBgsl_filter_tscheb2_steepness\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIresidue\fP); +.br +\fBgsl_filter_butter_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb1_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb2_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_butter_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb1_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb2_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_butter_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb1_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb2_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_butter_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb1_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_tscheb2_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.br +\fBgsl_filter_fir_approx\fP (\fIiorder\fP, \fIfreq\fP, \fIvalue\fP); +.br +\fBgsl_filter_sine_scan\fP (\fIorder\fP, \fIa\fP, \fIb\fP, \fIfreq\fP, \fIn_values\fP); +.br +\fBgsl_engine_garbage_collect\fP (); +.br +\fBgsl_signal_exp2\fP (); +.br +\fBgsl_approx_exp2\fP (\fIex\fP); +.br +\fBgsl_approx_atan1\fP (\fIx\fP); +.br +\fBgsl_approx_atan1_prescale\fP (\fIboost_amount\fP); +.br +\fBgsl_approx_qcircle1\fP (\fIx\fP); +.br +\fBgsl_approx_qcircle2\fP (\fIx\fP); +.br +\fBgsl_approx_qcircle3\fP (\fIx\fP); +.br +\fBgsl_approx_qcircle4\fP (\fIx\fP); +.br +.SH DESCRIPTION +.SS \fBgsl_thread_wakeup\fP (\fIthread\fP); +.PD 0 +.IP \fIGslThread*\ thread\fP 19 +thread to wake up +.PD 1 +.PP +Wake up a currently sleeping thread. In practice, this function simply causes the next call to \fBgsl_thread_sleep()\fP within \fIthread\fP to last for 0 seconds. +.PD +.SS \fBgsl_thread_abort\fP (\fIthread\fP); +.PD 0 +.IP \fIGslThread*\ thread\fP 19 +thread to abort +.PD 1 +.PP +Abort a currently running thread. This function does not return until the thread in question terminated execution. Note that the thread handle gets invalidated with invocation of \fBgsl_thread_abort()\fP or \fBgsl_thread_queue_abort()\fP. +.PD +.SS \fBgsl_thread_queue_abort\fP (\fIthread\fP); +.PD 0 +.IP \fIGslThread*\ thread\fP 19 +thread to abort +.PD 1 +.PP +Same as \fBgsl_thread_abort()\fP, but returns as soon as possible, even if thread hasn't stopped execution yet. Note that the thread handle gets invalidated with invocation of \fBgsl_thread_abort()\fP or \fBgsl_thread_queue_abort()\fP. +.PD +.SS \fBgsl_thread_aborted\fP (); +.PD 0 +.IP \fIRETURNS:\fP 11 +\fITRUE\fP if the thread should abort execution +.PD 1 +.PP +Find out if the currently running thread should be aborted (the thread is supposed to return from its main thread function). +.PD +.SS \fBgsl_thread_sleep\fP (\fImax_msec\fP); +.PD 0 +.IP \fIglong\ \ max_msec\fP 17 +maximum amount of milli seconds to sleep (-1 for infinite time) +.IP \fIRETURNS:\fP 17 +\fITRUE\fP if the thread should continue execution +.PD 1 +.PP +Sleep for the amount of time given. This function may get interrupted by wakeup or abort requests, it returns whether the thread is supposed to continue execution after waking up. +.PD +.SS \fBgsl_thread_awake_after\fP (\fItick_stamp\fP); +.PD 0 +.IP \fIguint64\ \ tick_stamp\fP 21 +tick stamp update to trigger wakeup +.PD 1 +.PP +Wakeup the currently running thread after the global tick stamp (see \fBgsl_tick_stamp()\fP) has been updated to \fItick_stamp\fP. (If the moment of wakeup has already passed by, the thread is woken up at the next global tick stamp update.) +.PD +.SS \fBgsl_thread_awake_before\fP (\fItick_stamp\fP); +.PD 0 +.IP \fIguint64\ \ tick_stamp\fP 21 +tick stamp update to trigger wakeup +.PD 1 +.PP +Wakeup the currently running thread upon the last global tick stamp update (see \fBgsl_tick_stamp()\fP) that happens prior to updating the global tick stamp to \fItick_stamp\fP. (If the moment of wakeup has already passed by, the thread is woken up at the next global tick stamp update.) +.PD +.SS \fBgsl_tick_stamp\fP (); +.PD 0 +.IP \fIRETURNS:\fP 11 +GSL's execution tick stamp as unsigned 64bit integer +.PD 1 +.PP +Retrive the GSL global tick stamp. GSL increments its global tick stamp at certain intervals, by specific amounts (refer to \fBgsl_engine_init()\fP for further details). The tick stamp is a non-wrapping, unsigned 64bit integer greater than 0. Threads can schedule sleep interruptions at certain tick stamps with \fBgsl_thread_awake_after()\fP and \fBgsl_thread_awake_before()\fP. Tick stamp updating occours at GSL engine block processing boundaries, so code that can guarantee to not run across those boundaries (for instance \fBGslProcessFunc()\fP functions) may use the macro \fIGSL_TICK_STAMP\fP to retrive the current tick in a faster manner (not involving mutex locking). See also \fBgsl_module_tick_stamp()\fP. +.PD +.SS \fBgsl_data_find_block\fP (\fIhandle\fP, \fIn_values\fP, \fIvalues\fP, \fIepsilon\fP); +.PD 0 +.IP \fIGslDataHandle*\ handle\fP 25 +an open GslDataHandle +.IP \fIguint\ \ \ \ \ \ \ \ \ \ n_values\fP 25 +amount of values to look for +.IP \fIconst\ gfloat*\ \ values\fP 25 +values to find +.IP \fIgfloat\ \ \ \ \ \ \ \ \ epsilon\fP 25 +maximum difference upon comparisions +.IP \fIRETURNS:\fP 25 +position of values in data handle or -1 +.PD 1 +.PP +Find the position of a block of values within a data handle, where all values compare to the reference values with a delta smaller than epsilon. +.PD +.SS \fBgsl_module_tick_stamp\fP (\fImodule\fP); +.PD 0 +.IP \fIGslModule*\ module\fP 19 +a GSL engine module +.IP \fIRETURNS:\fP 19 +the module's tick stamp, indicating its process status +.PD 1 +.PP +Any thread may call this function on a valid engine module. The module specific tick stamp is updated to \fBgsl_tick_stamp()\fP + \fIn_values\fP every time its \fBGslProcessFunc()\fP function was called. See also \fBgsl_tick_stamp()\fP. +.PD +.SS \fBgsl_job_integrate\fP (\fImodule\fP); +.PD 0 +.IP \fIGslModule*\ module\fP 19 +The module to integrate +.IP \fIRETURNS:\fP 19 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job to integrate \fImodule\fP into the engine. +.PD +.SS \fBgsl_job_discard\fP (\fImodule\fP); +.PD 0 +.IP \fIGslModule*\ module\fP 19 +The module to discard +.IP \fIRETURNS:\fP 19 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which removes \fImodule\fP from the engine and destroys it. +.PD +.SS \fBgsl_job_connect\fP (\fIsrc_module\fP, \fIsrc_ostream\fP, \fIdest_module\fP, \fIdest_istream\fP); +.PD 0 +.IP \fIGslModule*\ src_module\fP 25 +Module with output stream +.IP \fIguint\ \ \ \ \ \ src_ostream\fP 25 +Index of output stream of \fIsrc_module\fP +.IP \fIGslModule*\ dest_module\fP 25 +Module with unconnected input stream +.IP \fIguint\ \ \ \ \ \ dest_istream\fP 25 +Index of input stream of \fIdest_module\fP +.IP \fIRETURNS:\fP 25 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which connects the ouput stream \fIsrc_ostream\fP of module \fIsrc_module\fP to the input stream \fIdest_istream\fP of module \fIdest_module\fP (it is an error if the input stream is already connected by the time the job is executed). +.PD +.SS \fBgsl_job_disconnect\fP (\fIdest_module\fP, \fIdest_istream\fP); +.PD 0 +.IP \fIGslModule*\ dest_module\fP 25 +Module with connected input stream +.IP \fIguint\ \ \ \ \ \ dest_istream\fP 25 +Index of input stream of \fIdest_module\fP +.IP \fIRETURNS:\fP 25 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which causes the input stream \fIdest_istream\fP of \fIdest_module\fP to be disconnected (it is an error if the input stream isn't connected by the time the job is executed). +.PD +.SS \fBGslAccessFunc\fP (\fImodule\fP, \fIdata\fP); +.PD 0 +.IP \fI\ module\fP 9 +Module to operate on +.IP \fI\ data\fP 9 +Accessor data +.PD 1 +.PP +The GslAccessFunc is a user supplied callback function which can access a module in times it is not processing. Accessors are usually used to either read out a module's current state, or to modify its state. An accessor may only operate on the \fIdata\fP and the \fImodule\fP passed in to it. +.PD +.SS \fBgsl_job_access\fP (\fImodule\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); +.PD 0 +.IP \fIGslModule*\ \ \ \ \ module\fP 28 +The module to access +.IP \fIGslAccessFunc\ \ access_func\fP 28 +The accessor function +.IP \fIgpointer\ \ \ \ \ \ \ data\fP 28 +Data passed in to the accessor +.IP \fIGslFreeFunc\ \ \ \ free_func\fP 28 +Function to free \fIdata\fP +.IP \fIRETURNS:\fP 28 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which will invoke \fIaccess_func\fP on \fImodule\fP with \fIdata\fP when the transaction queue is processed to modify the module's state. +.PD +.SS \fBgsl_flow_job_access\fP (\fImodule\fP, \fItick_stamp\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); +.PD 0 +.IP \fIGslModule*\ \ \ \ \ module\fP 28 + +.IP \fIguint64\ \ \ \ \ \ \ \ tick_stamp\fP 28 + +.IP \fIGslAccessFunc\ \ access_func\fP 28 + +.IP \fIgpointer\ \ \ \ \ \ \ data\fP 28 + +.IP \fIGslFreeFunc\ \ \ \ free_func\fP 28 + +.PD 1 +.PP + +.PD +.SS \fBGslPollFunc\fP (\fIdata\fP, \fIn_values\fP, \fItimeout_p\fP, \fIn_fds\fP, \fIfds\fP, \fIrevents_filled\fP); +.PD 0 +.IP \fI\ data\fP 17 +Data of poll function +.IP \fI\ n_values\fP 17 +Minimum number of values the engine wants to process +.IP \fI\ timeout_p\fP 17 +Location of timeout value +.IP \fI\ n_fds\fP 17 +Number of file descriptors used for polling +.IP \fI\ fds\fP 17 +File descriptors to be used for polling +.IP \fI\ revents_filled\fP 17 +Indicates whether \fIfds\fP actually have their ->revents field filled with valid data. +.IP \fIRETURNS:\fP 17 +A boolean value indicating whether the engine should process data right now +.PD 1 +.PP +The GslPollFunc is a user supplied callback function which can be hooked into the GSL engine. The engine uses the poll functions to determine whether processing of \fIn_values\fP in its module network is necessary. In order for the poll functions to react to extern events, such as device driver status changes, the engine will \fBpoll(2)\fP the \fIfds\fP of the poll function and invoke the callback with \fIrevents_filled\fP==\fITRUE\fP if any of its \fIfds\fP changed state. The callback may also be invoked at other random times with \fIrevents_filled\fP=\fIFALSE\fP. It is supposed to return \fITRUE\fP if network processing is currently necessary, and \fIFALSE\fP if not. If \fIFALSE\fP is returned, \fItimeout_p\fP may be filled with the number of milliseconds the engine should use for polling at maximum. +.PD +.SS \fBgsl_job_add_poll\fP (\fIpoll_func\fP, \fIdata\fP, \fIfree_func\fP, \fIn_fds\fP, \fIfds\fP); +.PD 0 +.IP \fIGslPollFunc\ \ \ \ \ \ poll_func\fP 28 +Poll function to add +.IP \fIgpointer\ \ \ \ \ \ \ \ \ data\fP 28 +Data of poll function +.IP \fIGslFreeFunc\ \ \ \ \ \ free_func\fP 28 +Function to free \fIdata\fP +.IP \fIguint\ \ \ \ \ \ \ \ \ \ \ \ n_fds\fP 28 +Number of poll file descriptors +.IP \fIconst\ GslPollFD*\ fds\fP 28 +File descriptors to \fBselect(2)\fP or \fBpoll(2)\fP on +.IP \fIRETURNS:\fP 28 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which adds a poll function to the engine. The poll function is used by the engine to determine whether processing is currently necessary. +.PD +.SS \fBgsl_job_remove_poll\fP (\fIpoll_func\fP, \fIdata\fP); +.PD 0 +.IP \fIGslPollFunc\ \ poll_func\fP 24 +Poll function to remove +.IP \fIgpointer\ \ \ \ \ data\fP 24 +Data of poll function +.IP \fIRETURNS:\fP 24 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which removes a previously inserted poll function from the engine. +.PD +.SS \fBgsl_job_debug\fP (\fIdebug\fP); +.PD 0 +.IP \fIconst\ gchar*\ debug\fP 20 +Debug message +.IP \fIRETURNS:\fP 20 +New job suitable for \fBgsl_trans_add()\fP +.PD 1 +.PP +Create a new transaction job which issues \fIdebug\fP message when the job is executed. This function is meant for debugging purposes during development phase only and shouldn't be used in production code. +.PD +.SS \fBgsl_trans_open\fP (); +.PD 0 +.IP \fIRETURNS:\fP 11 +Newly opened empty transaction +.PD 1 +.PP +Open up a new transaction to commit jobs to the GSL engine. This function may cause garbage collection (see \fBgsl_engine_garbage_collect()\fP). +.PD +.SS \fBgsl_trans_add\fP (\fItrans\fP, \fIjob\fP); +.PD 0 +.IP \fIGslTrans*\ trans\fP 17 +Opened transaction +.IP \fIGslJob*\ \ \ job\fP 17 +Job to add +.PD 1 +.PP +Append a job to an opened transaction. +.PD +.SS \fBgsl_trans_commit\fP (\fItrans\fP); +.PD 0 +.IP \fIGslTrans*\ trans\fP 17 +Opened transaction +.PD 1 +.PP +Close the transaction and commit it to the engine. The engine will execute the jobs contained in this transaction as soon as it has completed its current processing cycle. The jobs will be executed in the exact order they were added to the transaction. +.PD +.SS \fBgsl_trans_dismiss\fP (\fItrans\fP); +.PD 0 +.IP \fIGslTrans*\ trans\fP 17 +Opened transaction +.PD 1 +.PP +Close and discard the transaction, destroy all jobs currently contained in it and do not execute them. This function may cause garbage collection (see \fBgsl_engine_garbage_collect()\fP). +.PD +.SS \fBgsl_transact\fP (\fIjob\fP, \fI...\fP); +.PD 0 +.IP \fI\ job\fP 6 +First job +.IP \fI\ ...\fP 6 +\fINULL\fP terminated job list +.PD 1 +.PP +Convenience function which openes up a new transaction, collects the \fINULL\fP terminated job list passed to the function, and commits the transaction. +.PD +.SS \fBgsl_engine_init\fP (\fIrun_threaded\fP, \fIblock_size\fP, \fIsample_freq\fP, \fIsub_sample_mask\fP); +.PD 0 +.IP \fIgboolean\ \ run_threaded\fP 27 + +.IP \fIguint\ \ \ \ \ block_size\fP 27 +number of values to process block wise +.IP \fIguint\ \ \ \ \ sample_freq\fP 27 + +.IP \fIguint\ \ \ \ \ sub_sample_mask\fP 27 + +.PD 1 +.PP +Initialize the GSL engine, this function must be called prior to any other engine related function and can only be invoked once. The \fIblock_size\fP determines the amount by which the global tick stamp (see \fBgsl_tick_stamp()\fP) is updated everytime the whole module network completed processing \fIblock_size\fP values. +.PD +.SS \fBgsl_engine_wait_on_trans\fP (); +.PD 0 +.PD 1 +.PP +Wait until all pending transactions have been processed by the GSL Engine. This function may cause garbage collection (see \fBgsl_engine_garbage_collect()\fP). +.PD +.SS \fBgsl_power2_fftac\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); +.PD 0 +.IP \fI\ n_values\fP 16 +Number of complex values +.IP \fI\ ri_values_in\fP 16 +Complex sample values [0..n_values*2-1] +.IP \fI\ ri_values_out\fP 16 +Complex frequency values [0..n_values*2-1] +.PD 1 +.PP +This function performs a decimation in time fourier transformation in forward direction, where the input values are equidistant sampled data, and the output values contain the frequency proportions of the input. The input and output arrays are complex values with real and imaginery portions interleaved, adressable in the range [0..2*n_values-1], where n_values must be a power of two. Frequencies are stored in-order, the K-th output corresponds to the frequency K/n_values. (If you want to interpret negative frequencies, note that the frequencies -K/n_values and (n_values-K)/n_values are equivalent). Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. +.PD +.SS \fBgsl_power2_fftsc\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); +.PD 0 +.IP \fI\ n_values\fP 16 +Number of complex values +.IP \fI\ ri_values_in\fP 16 +Complex frequency values [0..n_values*2-1] +.IP \fI\ ri_values_out\fP 16 +Complex sample values [0..n_values*2-1] +.PD 1 +.PP +This function performs a decimation in time fourier transformation in backwards direction with normalization. As such, this function represents the counterpart to \fBgsl_power2_fftac()\fP, that is, a value array which is transformed into the frequency domain with \fBgsl_power2_fftac()\fP can be reconstructed by issuing \fBgsl_power2_fftsc()\fP on the transform. Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. +.PD +.SS \fBgsl_power2_fftar\fP (\fIn_values\fP, \fIr_values_in\fP, \fIri_values_out\fP); +.PD 0 +.IP \fI\ n_values\fP 16 +Number of complex values +.IP \fI\ r_values_in\fP 16 +Real sample values [0..n_values-1] +.IP \fI\ ri_values_out\fP 16 +Complex frequency values [0..n_values-1] +.PD 1 +.PP +Real valued variant of \fBgsl_power2_fftac()\fP, the input array contains real valued equidistant sampled data [0..n_values-1], and the output array contains the positive frequency half of the complex valued fourier transform. Note, that the complex valued fourier transform H of a purely real valued set of data, satisfies \fBH(-f)\fP = Conj(\fBH(f)\fP), where \fBConj()\fP denotes the complex conjugate, so that just the positive frequency half suffices to describe the entire frequency spectrum. Even so, the resulting n_values/2 complex frequencies are one value off in storage size, but the resulting frequencies \fBH(0)\fP and \fBH(n_values/2)\fP are both real valued, so the real portion of \fBH(n_values/2)\fP is stored in ri_values_out[1] (the imaginery part of \fBH(0)\fP), so that both r_values_in and ri_values_out can be of size n_values. Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. +.PD +.SS \fBgsl_power2_fftsr\fP (\fIn_values\fP, \fIri_values_in\fP, \fIr_values_out\fP); +.PD 0 +.IP \fI\ n_values\fP 15 +Number of complex values +.IP \fI\ ri_values_in\fP 15 +Complex frequency values [0..n_values-1] +.IP \fI\ r_values_out\fP 15 +Real sample values [0..n_values-1] +.PD 1 +.PP +Real valued variant of \fBgsl_power2_fftsc()\fP, counterpart to \fBgsl_power2_fftar()\fP, using the same frequency storage format. A real valued data set transformed into the frequency domain with \fBgsl_power2_fftar()\fP can be reconstructed using this function. Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. +.PD +.SS \fBgsl_filter_tscheb2_steepness_db\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIstopband_db\fP); +.PD 0 +.IP \fIunsigned\ int\ \ iorder\fP 27 +filter order +.IP \fIdouble\ \ \ \ \ \ \ \ c_freq\fP 27 +passband cutoff frequency (0..pi) +.IP \fIdouble\ \ \ \ \ \ \ \ epsilon\fP 27 +fall off at passband frequency (0..1) +.IP \fIdouble\ \ \ \ \ \ \ \ stopband_db\fP 27 +reduction in stopband in dB (>= 0) +.PD 1 +.PP +Calculates the steepness parameter for Tschebyscheff type 2 lowpass filter, based on the ripple residue in the stop band. +.PD +.SS \fBgsl_filter_tscheb2_steepness\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIresidue\fP); +.PD 0 +.IP \fIunsigned\ int\ \ iorder\fP 23 +filter order +.IP \fIdouble\ \ \ \ \ \ \ \ c_freq\fP 23 +passband cutoff frequency (0..pi) +.IP \fIdouble\ \ \ \ \ \ \ \ epsilon\fP 23 +fall off at passband frequency (0..1) +.IP \fIdouble\ \ \ \ \ \ \ \ residue\fP 23 +maximum of transfer function in stopband (0..1) +.PD 1 +.PP +Calculates the steepness parameter for Tschebyscheff type 2 lowpass filter, based on ripple residue in the stop band. +.PD +.SS \fBgsl_filter_butter_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order +.IP \fI\ freq\fP 10 +cutoff frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at cutoff frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Butterworth lowpass filter. +.PD +.SS \fBgsl_filter_tscheb1_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order +.IP \fI\ freq\fP 10 +cutoff frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at cutoff frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 1 lowpass filter. +.PD +.SS \fBgsl_filter_tscheb2_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 12 +filter order +.IP \fI\ freq\fP 12 +passband cutoff frequency (0..pi) +.IP \fI\ steepness\fP 12 +frequency steepness (c_freq * steepness < pi) +.IP \fI\ epsilon\fP 12 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 12 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 12 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 2 lowpass filter. To gain a transition band between freq1 and freq2, pass arguements \fIfreq\fP=freq1 and \fIsteepness\fP=freq2/freq1. To specify the transition band width in fractions of octaves, pass \fIsteepness\fP=2^octave_fraction. +.PD +.SS \fBgsl_filter_butter_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order +.IP \fI\ freq\fP 10 +passband frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Butterworth highpass filter. +.PD +.SS \fBgsl_filter_tscheb1_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order +.IP \fI\ freq\fP 10 +passband frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 1 highpass filter. +.PD +.SS \fBgsl_filter_tscheb2_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 12 +filter order +.IP \fI\ freq\fP 12 +stopband frequency (0..pi) +.IP \fI\ steepness\fP 12 +frequency steepness +.IP \fI\ epsilon\fP 12 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 12 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 12 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 2 highpass filter. +.PD +.SS \fBgsl_filter_butter_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order (must be even) +.IP \fI\ freq1\fP 10 +stopband end frequency (0..pi) +.IP \fI\ freq2\fP 10 +passband end frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Butterworth bandpass filter. +.PD +.SS \fBgsl_filter_tscheb1_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order (must be even) +.IP \fI\ freq1\fP 10 +stopband end frequency (0..pi) +.IP \fI\ freq2\fP 10 +passband end frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 1 bandpass filter. +.PD +.SS \fBgsl_filter_tscheb2_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 12 +filter order (must be even) +.IP \fI\ freq1\fP 12 +stopband end frequency (0..pi) +.IP \fI\ freq2\fP 12 +passband end frequency (0..pi) +.IP \fI\ steepness\fP 12 +frequency steepness factor +.IP \fI\ epsilon\fP 12 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 12 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 12 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 2 bandpass filter. +.PD +.SS \fBgsl_filter_butter_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order (must be even) +.IP \fI\ freq1\fP 10 +passband end frequency (0..pi) +.IP \fI\ freq2\fP 10 +stopband end frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Butterworth bandstop filter. +.PD +.SS \fBgsl_filter_tscheb1_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 10 +filter order (must be even) +.IP \fI\ freq1\fP 10 +passband end frequency (0..pi) +.IP \fI\ freq2\fP 10 +stopband end frequency (0..pi) +.IP \fI\ epsilon\fP 10 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 10 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 10 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 1 bandstop filter. +.PD +.SS \fBgsl_filter_tscheb2_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); +.PD 0 +.IP \fI\ iorder\fP 12 +filter order (must be even) +.IP \fI\ freq1\fP 12 +passband end frequency (0..pi) +.IP \fI\ freq2\fP 12 +stopband end frequency (0..pi) +.IP \fI\ steepness\fP 12 +frequency steepness factor +.IP \fI\ epsilon\fP 12 +fall off at passband frequency (0..1) +.IP \fI\ a\fP 12 +root polynomial coefficients a[0..iorder] +.IP \fI\ b\fP 12 +pole polynomial coefficients b[0..iorder] +.PD 1 +.PP +Tschebyscheff type 2 bandstop filter. +.PD +.SS \fBgsl_filter_fir_approx\fP (\fIiorder\fP, \fIfreq\fP, \fIvalue\fP); +.PD 0 +.IP \fI\ iorder\fP 9 +order of the filter (must be oven, >= 2) +.IP \fI\ freq\fP 9 +the frequencies of the transfer function +.IP \fI\ value\fP 9 +the desired value of the transfer function +.PD 1 +.PP +Approximates a given transfer function with an iorder-coefficient FIR filter. It is recommended to provide enough frequency values, so that \fIn_points\fP >= \fIiorder\fP. +.PD +.SS \fBgsl_filter_sine_scan\fP (\fIorder\fP, \fIa\fP, \fIb\fP, \fIfreq\fP, \fIn_values\fP); +.PD 0 +.IP \fIguint\ \ \ \ \ \ \ \ \ \ order\fP 25 +order of the iir filter +.IP \fIconst\ gdouble*\ a\fP 25 +root polynomial coefficients of the filter a[0..order] +.IP \fIconst\ gdouble*\ b\fP 25 +pole polynomial coefficients of the filter b[0..order] +.IP \fIgdouble\ \ \ \ \ \ \ \ freq\fP 25 +frequency to test +.IP \fIguint\ \ \ \ \ \ \ \ \ \ n_values\fP 25 +number of samples +.PD 1 +.PP +This function sends a sine signal of the desired frequency through an IIR filter, to test the value of the transfer function at a given point. It uses gsl_iir_filter_eval to do so. Compared to a "mathematical approach" of finding the transfer function, this function makes it possible to see the effects of finite arithmetic during filter evaluation. The first half of the output signal is not considered, since a lot of IIR filters have a transient phase where also overshoot is possible. For n_values, you should specify a reasonable large value. It should be a lot larger than the filter order, and large enough to let the input signal become (close to) 1.0 multiple times. +.PD +.SS \fBgsl_engine_garbage_collect\fP (); +.PD 0 +.PD 1 +.PP +GSL Engine user thread function. Collects processed jobs and transactions from the engine and frees them, this involves callback invocation of \fBGslFreeFunc()\fP functions, e.g. from \fBgsl_job_access()\fP or \fBgsl_flow_job_access()\fP jobs. This function may only be called from the user thread, as \fBGslFreeFunc()\fP functions are guranteed to be executed in the user thread. +.PD +.SS \fBgsl_signal_exp2\fP (); +.PD 0 +.PD 1 +.PP +Deprecated in favour of \fBgsl_approx_exp2()\fP. +.PD +.SS \fBgsl_approx_exp2\fP (\fIex\fP); +.PD 0 +.IP \fIfloat\ \ ex\fP 11 +exponent within [-127..127] +.IP \fIRETURNS:\fP 11 +y approximating 2^x +.PD 1 +.PP +Fast approximation of 2 raised to the power of x. Multiplicative error stays below 8e-6 and aproaches zero for integer values of x (i.e. x - floor (x) = 0). +.PD +.SS \fBgsl_approx_atan1\fP (\fIx\fP); +.PD 0 +.IP \fIregister\ double\ \ x\fP 20 + +.PD 1 +.PP +Fast \fBatan(x)\fP/(PI/2) approximation, with maximum error < 0.01 and \fBgsl_approx_atan1(0)\fP==0, according to the formula: n1 = -0.41156875521951602506487246309908; n2 = -1.0091272542790025586079663559158; d1 = 0.81901156857081841441890603235599; d2 = 1.0091272542790025586079663559158; \fBpositive_atan1(x)\fP = 1 + (n1 * x + n2) / ((1 + d1 * x) * x + d2); +.PD +.SS \fBgsl_approx_atan1_prescale\fP (\fIboost_amount\fP); +.PD 0 +.IP \fI\ boost_amount\fP 15 +boost amount between [0..1] +.IP \fIRETURNS:\fP 15 +prescale factor for \fBgsl_approx_atan1()\fP +.PD 1 +.PP +Calculate the prescale factor for \fBgsl_approx_atan1(x*prescale)\fP from a linear boost factor, where 0.5 amounts to prescale=1.0, 1.0 results in maximum boost and 0.0 results in maximum attenuation. +.PD +.SS \fBgsl_approx_qcircle1\fP (\fIx\fP); +.PD 0 +.IP \fIregister\ double\ \ x\fP 20 +x within [0..1] +.IP \fIRETURNS:\fP 20 +y for circle approximation within [0..1] +.PD 1 +.PP +Fast approximation of the upper right quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. +.PD +.SS \fBgsl_approx_qcircle2\fP (\fIx\fP); +.PD 0 +.IP \fIregister\ double\ \ x\fP 20 +x within [0..1] +.IP \fIRETURNS:\fP 20 +y for circle approximation within [0..1] +.PD 1 +.PP +Fast approximation of the upper left quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. +.PD +.SS \fBgsl_approx_qcircle3\fP (\fIx\fP); +.PD 0 +.IP \fIregister\ double\ \ x\fP 20 +x within [0..1] +.IP \fIRETURNS:\fP 20 +y for circle approximation within [0..1] +.PD 1 +.PP +Fast approximation of the lower left quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. +.PD +.SS \fBgsl_approx_qcircle4\fP (\fIx\fP); +.PD 0 +.IP \fIregister\ double\ \ x\fP 20 +x within [0..1] +.IP \fIRETURNS:\fP 20 +y for circle approximation within [0..1] +.PD 1 +.PP +Fast approximation of the lower right quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. +.PD + diff --git a/flow/CMakeLists.txt b/flow/CMakeLists.txt index 48fb330..0839666 100644 --- a/flow/CMakeLists.txt +++ b/flow/CMakeLists.txt @@ -1,18 +1,19 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# +########################################### +# # +# (C) 2010 Serghei Amelian # +# serghei (DOT) amelian (AT) gmail.com # +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 2 # +# # +########################################### add_subdirectory( mcopclass ) add_subdirectory( gsl ) add_subdirectory( gslpp ) + include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/artsc @@ -21,29 +22,16 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${GLIB2_INCLUDE_DIRS} + ${AUDIOFILE_INCLUDE_DIRS} + ${ALSA_INCLUDE_DIRS} + ${ESOUND_INCLUDE_DIRS} + ${LIBJACK_INCLUDE_DIRS} + ${NAS_INCLUDE_DIR} + ${OSS_INCLUDE_DIR} ) -##### headers ################################### - -install( FILES - audiosubsys.h cache.h cachedwav.h convert.h - pipebuffer.h stdsynthmodule.h synthschedule.h - fft.h artsflow.idl audioio.h resample.h cpuinfo.h - bufferqueue.h gslschedule.h - ${CMAKE_CURRENT_BINARY_DIR}/artsflow.h - DESTINATION ${INCLUDE_INSTALL_DIR} ) - - -##### other data ################################ - -install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/artsflow.mcoptype - ${CMAKE_CURRENT_BINARY_DIR}/artsflow.mcopclass - DESTINATION ${LIB_INSTALL_DIR}/mcop ) - - -##### artsflow (shared lib) ##################### +##### artsflow (shared ) set( target artsflow ) @@ -64,24 +52,68 @@ set( ${target}_SRCS ) tde_add_library( ${target} SHARED - SOURCES ${${target}_SRCS} + + SOURCES + ${${target}_SRCS} + LINK + artsgsl-static + artsgslpp-static + artsflow_idl-shared + ${AUDIOFILE_LIBRARIES} + ${LIBJACK_LIBRARIES} + ${LIBSNDIO_LIBRARIES} + ${ESOUND_LIBRARIES} + ${NAS_LIBRARIES} + ${OSS_LIBRARIES} + VERSION 1.0.0 - LINK artsgsl-static artsgslpp-static artsflow_idl-shared ${AUDIOFILE_LIBRARIES} ${LIBJACK_LIBRARIES} ${LIBSNDIO_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR} ) -##### artsflow_idl (shared lib) ################# + +##### artsflow_idl (shared ) add_custom_command( OUTPUT artsflow.cpp COMMAND ../mcopidl/mcopidl - ARGS -t ${CMAKE_CURRENT_SOURCE_DIR}/artsflow.idl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/artsflow.idl + ARGS -t ${CMAKE_CURRENT_SOURCE_DIR}/artsflow.idl + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/artsflow.idl ) tde_add_library( artsflow_idl SHARED - SOURCES artsflow.cpp + + SOURCES + artsflow.cpp + LINK + mcop-shared + ${ALSA_LIBRARIES} + VERSION 1.0.0 - LINK mcop-shared ${ALSA_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR} + DEPENDENCIES mcopidl ) + + +##### headers + +install( + FILES audiosubsys.h cache.h cachedwav.h convert.h gslschedule.h + pipebuffer.h stdsynthmodule.h synthschedule.h bufferqueue.h + fft.h artsflow.idl audioio.h resample.h cpuinfo.h + ${CMAKE_CURRENT_BINARY_DIR}/artsflow.h + + DESTINATION ${INCLUDE_INSTALL_DIR} +) + + +##### other data + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/artsflow.mcoptype + ${CMAKE_CURRENT_BINARY_DIR}/artsflow.mcopclass + + DESTINATION ${LIB_INSTALL_DIR}/mcop +) diff --git a/flow/audioiooss.cpp b/flow/audioiooss.cpp index 21ce41d..0108108 100644 --- a/flow/audioiooss.cpp +++ b/flow/audioiooss.cpp @@ -21,15 +21,16 @@ */ #ifdef HAVE_CONFIG_H - #include + #include "config.h" #endif +#if defined(HAVE_SOUNDCARD_H) +#include +#define COMPILE_AUDIOIO_OSS 1 +#endif #if defined(HAVE_SYS_SOUNDCARD_H) - #include - #define COMPILE_AUDIOIO_OSS 1 -#elif defined(HAVE_SOUNDCARD_H) - #include - #define COMPILE_AUDIOIO_OSS 1 +#include +#define COMPILE_AUDIOIO_OSS 1 #endif /** diff --git a/flow/copy of CMakeLists.txt b/flow/copy of CMakeLists.txt new file mode 100644 index 0000000..48fb330 --- /dev/null +++ b/flow/copy of CMakeLists.txt @@ -0,0 +1,87 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( mcopclass ) +add_subdirectory( gsl ) +add_subdirectory( gslpp ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/artsc + ${CMAKE_BINARY_DIR}/mcop + ${CMAKE_SOURCE_DIR}/mcop + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${GLIB2_INCLUDE_DIRS} +) + + +##### headers ################################### + +install( FILES + audiosubsys.h cache.h cachedwav.h convert.h + pipebuffer.h stdsynthmodule.h synthschedule.h + fft.h artsflow.idl audioio.h resample.h cpuinfo.h + bufferqueue.h gslschedule.h + ${CMAKE_CURRENT_BINARY_DIR}/artsflow.h + DESTINATION ${INCLUDE_INSTALL_DIR} ) + + +##### other data ################################ + +install( FILES + ${CMAKE_CURRENT_BINARY_DIR}/artsflow.mcoptype + ${CMAKE_CURRENT_BINARY_DIR}/artsflow.mcopclass + DESTINATION ${LIB_INSTALL_DIR}/mcop ) + + +##### artsflow (shared lib) ##################### + +set( target artsflow ) + +set( ${target}_SRCS + synth_play_impl.cpp gslschedule.cpp audiosubsys.cpp + pipebuffer.cpp convert.cpp synth_wave_sin_impl.cpp + synth_frequency_impl.cpp synth_multi_add_impl.cpp + synth_add_impl.cpp synth_mul_impl.cpp synth_play_wav_impl.cpp + stdsynthmodule.cpp cache.cpp asyncschedule.cpp bytestreamtoaudio_impl.cpp + stereovolumecontrol_impl.cpp stereoeffectstack_impl.cpp + fft.c stereofftscope_impl.cpp virtualports.cpp bus.cpp + audiomanager_impl.cpp synth_record_impl.cpp resample.cpp + audioio.cpp audioiooss.cpp audioioalsa.cpp audioioalsa9.cpp + audioionull.cpp audioiolibaudioio.cpp audioioesd.cpp audioiosndio.cpp + audioiojack.cpp audioiosun.cpp audioioaix.cpp audioionas.cpp + cpuinfo.cpp audioioossthreaded.cpp audiotobytestream_impl.cpp + audioiosgi.cpp audioiocsl.cpp audioiomas.cpp datahandle_impl.cpp +) + +tde_add_library( ${target} SHARED + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK artsgsl-static artsgslpp-static artsflow_idl-shared ${AUDIOFILE_LIBRARIES} ${LIBJACK_LIBRARIES} ${LIBSNDIO_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR} +) + +##### artsflow_idl (shared lib) ################# + +add_custom_command( + OUTPUT artsflow.cpp + COMMAND ../mcopidl/mcopidl + ARGS -t ${CMAKE_CURRENT_SOURCE_DIR}/artsflow.idl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/artsflow.idl +) + +tde_add_library( artsflow_idl SHARED + SOURCES artsflow.cpp + VERSION 1.0.0 + LINK mcop-shared ${ALSA_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR} + DEPENDENCIES mcopidl +) diff --git a/flow/gsl/CMakeLists.txt b/flow/gsl/CMakeLists.txt index e8e9576..851d69a 100644 --- a/flow/gsl/CMakeLists.txt +++ b/flow/gsl/CMakeLists.txt @@ -1,138 +1,26 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include( CheckCSourceCompiles ) - - -##### check for ogg/vorbis ###################### - -set( GSL_HAVE_OGGVORBIS 0 ) -if( WITH_VORBIS ) - - pkg_search_module( VORBIS vorbis ) - - if( VORBIS_FOUND ) - - pkg_search_module( VORBISFILE vorbisfile ) - - if( VORBISFILE_FOUND ) - - set( GSL_HAVE_OGGVORBIS 1 ) - - set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) - set( CMAKE_REQUIRED_LIBRARIES ${VORBISFILE_LIBRARIES} ) - check_c_source_compiles( - "#include - int main() { ov_read_float(0,0,0); return 0; } " - GSL_HAVE_OGGVORBIS_RC3 ) - if( NOT GSL_HAVE_OGGVORBIS_RC3 ) - set( GSL_HAVE_OGGVORBIS_RC3 0 ) - endif( NOT GSL_HAVE_OGGVORBIS_RC3 ) - set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) - - else( VORBISFILE_FOUND ) - - message(FATAL_ERROR "\nOgg/Vorbis support are requested, but `libvorbisfile` not found" ) - - endif( VORBISFILE_FOUND ) - - else( VORBIS_FOUND ) - - message(FATAL_ERROR "\nOgg/Vorbis support are requested, but `libvorbis` but found" ) - - endif( VORBIS_FOUND ) - -endif( WITH_VORBIS ) - - -##### check for libmad MPEG decoder ############# - -set( GSL_HAVE_LIBMAD 0 ) -if( WITH_MAD ) - - pkg_search_module( MAD mad ) - - if( MAD_FOUND ) - set( GSL_HAVE_LIBMAD 1 ) - else( MAD_FOUND ) - find_library( MAD_LIBRARIES NAMES mad ) - find_path( MAD_INCLUDE_DIRS mad.h ) - if( NOT MAD_LIBRARIES ) - message(FATAL_ERROR "\nMAD support is requested, but `libmad` not found" ) - endif( NOT MAD_LIBRARIES ) - endif( MAD_FOUND ) - -endif( WITH_MAD ) - - -##### check for some type sizes ################# - -include( CheckTypeSize ) - -check_type_size( pthread_mutex_t GSL_SIZEOF_PTH_MUTEX_T ) -check_type_size( pthread_cond_t GSL_SIZEOF_PTH_COND_T ) -check_type_size( intmax_t GSL_SIZEOF_STD_INTMAX_T ) - -set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) -set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ) -check_c_source_compiles( - "#define _XOPEN_SOURCE 500 - #include - int main() - { - int (*attr_settype) (pthread_mutexattr_t *__attr, int __kind) = pthread_mutexattr_settype; - int val = PTHREAD_MUTEX_RECURSIVE; attr_settype = 0; val = 0; - return 0; - }" - GSL_HAVE_MUTEXATTR_SETTYPE ) - if( NOT GSL_HAVE_MUTEXATTR_SETTYPE ) - set( GSL_HAVE_MUTEXATTR_SETTYPE 0 ) - endif( NOT GSL_HAVE_MUTEXATTR_SETTYPE ) -set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) - -set( GSL_USE_GSL_GLIB 1 ) -set( GSL_USE_ARTS_THREADS 1 ) - - -##### write configuration ####################### - -configure_file( gslconfig.h.in gslconfig.h @ONLY ) - - -##### include paths ############################# +########################################### +# # +# (C) 2010 Serghei Amelian # +# serghei (DOT) amelian (AT) gmail.com # +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 2 # +# # +########################################### include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/mcop - ${CMAKE_SOURCE_DIR}/mcop # for thread.h - ${CMAKE_CURRENT_BINARY_DIR}/.. # for gsl/gslconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/.. # for gsl/gslcommon.h + ${CMAKE_SOURCE_DIR}/mcop # for thread.h + ${CMAKE_CURRENT_BINARY_DIR}/.. # for gsl/gslconfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/.. # for gsl/gslcommon.h ${GLIB2_INCLUDE_DIRS} + ${MAD_INCLUDE_DIRS} ) -##### headers ################################### - -install( FILES - gslcommon.h gsldatacache.h gsldatahandle.h - gsldefs.h gslloader.h gslmath.h gslfilter.h - gsldatautils.h gsldatahandle-vorbis.h gslconvert.h - gslfft.h gslieee754.h gslsignal.h gslmagic.h - gslengine.h gslwaveosc.h gslwavechunk.h - gsldatahandle-mad.h gslosctable.h gsloscillator.h - ${CMAKE_CURRENT_BINARY_DIR}/gslconfig.h - DESTINATION ${INCLUDE_INSTALL_DIR}/gsl ) - - -##### gsl (static lib) ########################## +##### gsl (static ) set( target artsgsl ) @@ -147,9 +35,39 @@ set( ${target}_SRCS gsloscillator.c gslfilehash.c gslartsthreads.cpp ) + tde_add_library( ${target} STATIC_PIC - SOURCES ${${target}_SRCS} - LINK ${GLIB2_LIBRARIES} ${GTHREAD2_LIBRARIES} ${VORBISFILE_LIBRARIES} ${VORBIS_LIBRARIES} ${MAD_LIBRARIES} + + SOURCES + ${${target}_SRCS} + LINK + ${GLIB2_LIBRARIES} + ${GTHREAD2_LIBRARIES} + ${VORBISFILE_LIBRARIES} + ${VORBIS_LIBRARIES} + ${LIBOGG_LIBRARIES} + ${LIBVORBISENC_LIBRARIES} + ${MAD_LIBRARIES} + DESTINATION ${LIB_INSTALL_DIR} ) + +##### write configuration + +configure_file( gslconfig.h.cmake gslconfig.h @ONLY ) + + +##### headers + +install( + FILES gslcommon.h gsldatacache.h gsldatahandle.h + gsldefs.h gslloader.h gslmath.h gslfilter.h + gsldatautils.h gsldatahandle-vorbis.h gslconvert.h + gslfft.h gslieee754.h gslsignal.h gslmagic.h + gslengine.h gslwaveosc.h gslwavechunk.h + gsldatahandle-mad.h gslosctable.h gsloscillator.h + ${CMAKE_CURRENT_BINARY_DIR}/gslconfig.h + + DESTINATION ${INCLUDE_INSTALL_DIR}/gsl +) diff --git a/flow/gsl/gsl.3 b/flow/gsl/gsl.3 deleted file mode 100644 index 2f7bb31..0000000 --- a/flow/gsl/gsl.3 +++ /dev/null @@ -1,822 +0,0 @@ -.TH "GSL-Functions" 3 "17 May 2002" "BEAST-0.4.1" "BEAST-0.4.1" -.SH NAME -GSL-Functions \- GSL Function Reference -.SH SYNOPSIS -\fBgsl_thread_wakeup\fP (\fIthread\fP); -.br -\fBgsl_thread_abort\fP (\fIthread\fP); -.br -\fBgsl_thread_queue_abort\fP (\fIthread\fP); -.br -\fBgsl_thread_aborted\fP (); -.br -\fBgsl_thread_sleep\fP (\fImax_msec\fP); -.br -\fBgsl_thread_awake_after\fP (\fItick_stamp\fP); -.br -\fBgsl_thread_awake_before\fP (\fItick_stamp\fP); -.br -\fBgsl_tick_stamp\fP (); -.br -\fBgsl_data_find_block\fP (\fIhandle\fP, \fIn_values\fP, \fIvalues\fP, \fIepsilon\fP); -.br -\fBgsl_module_tick_stamp\fP (\fImodule\fP); -.br -\fBgsl_job_integrate\fP (\fImodule\fP); -.br -\fBgsl_job_discard\fP (\fImodule\fP); -.br -\fBgsl_job_connect\fP (\fIsrc_module\fP, \fIsrc_ostream\fP, \fIdest_module\fP, \fIdest_istream\fP); -.br -\fBgsl_job_disconnect\fP (\fIdest_module\fP, \fIdest_istream\fP); -.br -\fBGslAccessFunc\fP (\fImodule\fP, \fIdata\fP); -.br -\fBgsl_job_access\fP (\fImodule\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); -.br -\fBgsl_flow_job_access\fP (\fImodule\fP, \fItick_stamp\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); -.br -\fBGslPollFunc\fP (\fIdata\fP, \fIn_values\fP, \fItimeout_p\fP, \fIn_fds\fP, \fIfds\fP, \fIrevents_filled\fP); -.br -\fBgsl_job_add_poll\fP (\fIpoll_func\fP, \fIdata\fP, \fIfree_func\fP, \fIn_fds\fP, \fIfds\fP); -.br -\fBgsl_job_remove_poll\fP (\fIpoll_func\fP, \fIdata\fP); -.br -\fBgsl_job_debug\fP (\fIdebug\fP); -.br -\fBgsl_trans_open\fP (); -.br -\fBgsl_trans_add\fP (\fItrans\fP, \fIjob\fP); -.br -\fBgsl_trans_commit\fP (\fItrans\fP); -.br -\fBgsl_trans_dismiss\fP (\fItrans\fP); -.br -\fBgsl_transact\fP (\fIjob\fP, \fI...\fP); -.br -\fBgsl_engine_init\fP (\fIrun_threaded\fP, \fIblock_size\fP, \fIsample_freq\fP, \fIsub_sample_mask\fP); -.br -\fBgsl_engine_wait_on_trans\fP (); -.br -\fBgsl_power2_fftac\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); -.br -\fBgsl_power2_fftsc\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); -.br -\fBgsl_power2_fftar\fP (\fIn_values\fP, \fIr_values_in\fP, \fIri_values_out\fP); -.br -\fBgsl_power2_fftsr\fP (\fIn_values\fP, \fIri_values_in\fP, \fIr_values_out\fP); -.br -\fBgsl_filter_tscheb2_steepness_db\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIstopband_db\fP); -.br -\fBgsl_filter_tscheb2_steepness\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIresidue\fP); -.br -\fBgsl_filter_butter_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb1_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb2_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_butter_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb1_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb2_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_butter_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb1_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb2_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_butter_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb1_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_tscheb2_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.br -\fBgsl_filter_fir_approx\fP (\fIiorder\fP, \fIfreq\fP, \fIvalue\fP); -.br -\fBgsl_filter_sine_scan\fP (\fIorder\fP, \fIa\fP, \fIb\fP, \fIfreq\fP, \fIn_values\fP); -.br -\fBgsl_engine_garbage_collect\fP (); -.br -\fBgsl_signal_exp2\fP (); -.br -\fBgsl_approx_exp2\fP (\fIex\fP); -.br -\fBgsl_approx_atan1\fP (\fIx\fP); -.br -\fBgsl_approx_atan1_prescale\fP (\fIboost_amount\fP); -.br -\fBgsl_approx_qcircle1\fP (\fIx\fP); -.br -\fBgsl_approx_qcircle2\fP (\fIx\fP); -.br -\fBgsl_approx_qcircle3\fP (\fIx\fP); -.br -\fBgsl_approx_qcircle4\fP (\fIx\fP); -.br -.SH DESCRIPTION -.SS \fBgsl_thread_wakeup\fP (\fIthread\fP); -.PD 0 -.IP \fIGslThread*\ thread\fP 19 -thread to wake up -.PD 1 -.PP -Wake up a currently sleeping thread. In practice, this function simply causes the next call to \fBgsl_thread_sleep()\fP within \fIthread\fP to last for 0 seconds. -.PD -.SS \fBgsl_thread_abort\fP (\fIthread\fP); -.PD 0 -.IP \fIGslThread*\ thread\fP 19 -thread to abort -.PD 1 -.PP -Abort a currently running thread. This function does not return until the thread in question terminated execution. Note that the thread handle gets invalidated with invocation of \fBgsl_thread_abort()\fP or \fBgsl_thread_queue_abort()\fP. -.PD -.SS \fBgsl_thread_queue_abort\fP (\fIthread\fP); -.PD 0 -.IP \fIGslThread*\ thread\fP 19 -thread to abort -.PD 1 -.PP -Same as \fBgsl_thread_abort()\fP, but returns as soon as possible, even if thread hasn't stopped execution yet. Note that the thread handle gets invalidated with invocation of \fBgsl_thread_abort()\fP or \fBgsl_thread_queue_abort()\fP. -.PD -.SS \fBgsl_thread_aborted\fP (); -.PD 0 -.IP \fIRETURNS:\fP 11 -\fITRUE\fP if the thread should abort execution -.PD 1 -.PP -Find out if the currently running thread should be aborted (the thread is supposed to return from its main thread function). -.PD -.SS \fBgsl_thread_sleep\fP (\fImax_msec\fP); -.PD 0 -.IP \fIglong\ \ max_msec\fP 17 -maximum amount of milli seconds to sleep (-1 for infinite time) -.IP \fIRETURNS:\fP 17 -\fITRUE\fP if the thread should continue execution -.PD 1 -.PP -Sleep for the amount of time given. This function may get interrupted by wakeup or abort requests, it returns whether the thread is supposed to continue execution after waking up. -.PD -.SS \fBgsl_thread_awake_after\fP (\fItick_stamp\fP); -.PD 0 -.IP \fIguint64\ \ tick_stamp\fP 21 -tick stamp update to trigger wakeup -.PD 1 -.PP -Wakeup the currently running thread after the global tick stamp (see \fBgsl_tick_stamp()\fP) has been updated to \fItick_stamp\fP. (If the moment of wakeup has already passed by, the thread is woken up at the next global tick stamp update.) -.PD -.SS \fBgsl_thread_awake_before\fP (\fItick_stamp\fP); -.PD 0 -.IP \fIguint64\ \ tick_stamp\fP 21 -tick stamp update to trigger wakeup -.PD 1 -.PP -Wakeup the currently running thread upon the last global tick stamp update (see \fBgsl_tick_stamp()\fP) that happens prior to updating the global tick stamp to \fItick_stamp\fP. (If the moment of wakeup has already passed by, the thread is woken up at the next global tick stamp update.) -.PD -.SS \fBgsl_tick_stamp\fP (); -.PD 0 -.IP \fIRETURNS:\fP 11 -GSL's execution tick stamp as unsigned 64bit integer -.PD 1 -.PP -Retrive the GSL global tick stamp. GSL increments its global tick stamp at certain intervals, by specific amounts (refer to \fBgsl_engine_init()\fP for further details). The tick stamp is a non-wrapping, unsigned 64bit integer greater than 0. Threads can schedule sleep interruptions at certain tick stamps with \fBgsl_thread_awake_after()\fP and \fBgsl_thread_awake_before()\fP. Tick stamp updating occours at GSL engine block processing boundaries, so code that can guarantee to not run across those boundaries (for instance \fBGslProcessFunc()\fP functions) may use the macro \fIGSL_TICK_STAMP\fP to retrive the current tick in a faster manner (not involving mutex locking). See also \fBgsl_module_tick_stamp()\fP. -.PD -.SS \fBgsl_data_find_block\fP (\fIhandle\fP, \fIn_values\fP, \fIvalues\fP, \fIepsilon\fP); -.PD 0 -.IP \fIGslDataHandle*\ handle\fP 25 -an open GslDataHandle -.IP \fIguint\ \ \ \ \ \ \ \ \ \ n_values\fP 25 -amount of values to look for -.IP \fIconst\ gfloat*\ \ values\fP 25 -values to find -.IP \fIgfloat\ \ \ \ \ \ \ \ \ epsilon\fP 25 -maximum difference upon comparisions -.IP \fIRETURNS:\fP 25 -position of values in data handle or -1 -.PD 1 -.PP -Find the position of a block of values within a data handle, where all values compare to the reference values with a delta smaller than epsilon. -.PD -.SS \fBgsl_module_tick_stamp\fP (\fImodule\fP); -.PD 0 -.IP \fIGslModule*\ module\fP 19 -a GSL engine module -.IP \fIRETURNS:\fP 19 -the module's tick stamp, indicating its process status -.PD 1 -.PP -Any thread may call this function on a valid engine module. The module specific tick stamp is updated to \fBgsl_tick_stamp()\fP + \fIn_values\fP every time its \fBGslProcessFunc()\fP function was called. See also \fBgsl_tick_stamp()\fP. -.PD -.SS \fBgsl_job_integrate\fP (\fImodule\fP); -.PD 0 -.IP \fIGslModule*\ module\fP 19 -The module to integrate -.IP \fIRETURNS:\fP 19 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job to integrate \fImodule\fP into the engine. -.PD -.SS \fBgsl_job_discard\fP (\fImodule\fP); -.PD 0 -.IP \fIGslModule*\ module\fP 19 -The module to discard -.IP \fIRETURNS:\fP 19 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which removes \fImodule\fP from the engine and destroys it. -.PD -.SS \fBgsl_job_connect\fP (\fIsrc_module\fP, \fIsrc_ostream\fP, \fIdest_module\fP, \fIdest_istream\fP); -.PD 0 -.IP \fIGslModule*\ src_module\fP 25 -Module with output stream -.IP \fIguint\ \ \ \ \ \ src_ostream\fP 25 -Index of output stream of \fIsrc_module\fP -.IP \fIGslModule*\ dest_module\fP 25 -Module with unconnected input stream -.IP \fIguint\ \ \ \ \ \ dest_istream\fP 25 -Index of input stream of \fIdest_module\fP -.IP \fIRETURNS:\fP 25 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which connects the ouput stream \fIsrc_ostream\fP of module \fIsrc_module\fP to the input stream \fIdest_istream\fP of module \fIdest_module\fP (it is an error if the input stream is already connected by the time the job is executed). -.PD -.SS \fBgsl_job_disconnect\fP (\fIdest_module\fP, \fIdest_istream\fP); -.PD 0 -.IP \fIGslModule*\ dest_module\fP 25 -Module with connected input stream -.IP \fIguint\ \ \ \ \ \ dest_istream\fP 25 -Index of input stream of \fIdest_module\fP -.IP \fIRETURNS:\fP 25 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which causes the input stream \fIdest_istream\fP of \fIdest_module\fP to be disconnected (it is an error if the input stream isn't connected by the time the job is executed). -.PD -.SS \fBGslAccessFunc\fP (\fImodule\fP, \fIdata\fP); -.PD 0 -.IP \fI\ module\fP 9 -Module to operate on -.IP \fI\ data\fP 9 -Accessor data -.PD 1 -.PP -The GslAccessFunc is a user supplied callback function which can access a module in times it is not processing. Accessors are usually used to either read out a module's current state, or to modify its state. An accessor may only operate on the \fIdata\fP and the \fImodule\fP passed in to it. -.PD -.SS \fBgsl_job_access\fP (\fImodule\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); -.PD 0 -.IP \fIGslModule*\ \ \ \ \ module\fP 28 -The module to access -.IP \fIGslAccessFunc\ \ access_func\fP 28 -The accessor function -.IP \fIgpointer\ \ \ \ \ \ \ data\fP 28 -Data passed in to the accessor -.IP \fIGslFreeFunc\ \ \ \ free_func\fP 28 -Function to free \fIdata\fP -.IP \fIRETURNS:\fP 28 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which will invoke \fIaccess_func\fP on \fImodule\fP with \fIdata\fP when the transaction queue is processed to modify the module's state. -.PD -.SS \fBgsl_flow_job_access\fP (\fImodule\fP, \fItick_stamp\fP, \fIaccess_func\fP, \fIdata\fP, \fIfree_func\fP); -.PD 0 -.IP \fIGslModule*\ \ \ \ \ module\fP 28 - -.IP \fIguint64\ \ \ \ \ \ \ \ tick_stamp\fP 28 - -.IP \fIGslAccessFunc\ \ access_func\fP 28 - -.IP \fIgpointer\ \ \ \ \ \ \ data\fP 28 - -.IP \fIGslFreeFunc\ \ \ \ free_func\fP 28 - -.PD 1 -.PP - -.PD -.SS \fBGslPollFunc\fP (\fIdata\fP, \fIn_values\fP, \fItimeout_p\fP, \fIn_fds\fP, \fIfds\fP, \fIrevents_filled\fP); -.PD 0 -.IP \fI\ data\fP 17 -Data of poll function -.IP \fI\ n_values\fP 17 -Minimum number of values the engine wants to process -.IP \fI\ timeout_p\fP 17 -Location of timeout value -.IP \fI\ n_fds\fP 17 -Number of file descriptors used for polling -.IP \fI\ fds\fP 17 -File descriptors to be used for polling -.IP \fI\ revents_filled\fP 17 -Indicates whether \fIfds\fP actually have their ->revents field filled with valid data. -.IP \fIRETURNS:\fP 17 -A boolean value indicating whether the engine should process data right now -.PD 1 -.PP -The GslPollFunc is a user supplied callback function which can be hooked into the GSL engine. The engine uses the poll functions to determine whether processing of \fIn_values\fP in its module network is necessary. In order for the poll functions to react to extern events, such as device driver status changes, the engine will \fBpoll(2)\fP the \fIfds\fP of the poll function and invoke the callback with \fIrevents_filled\fP==\fITRUE\fP if any of its \fIfds\fP changed state. The callback may also be invoked at other random times with \fIrevents_filled\fP=\fIFALSE\fP. It is supposed to return \fITRUE\fP if network processing is currently necessary, and \fIFALSE\fP if not. If \fIFALSE\fP is returned, \fItimeout_p\fP may be filled with the number of milliseconds the engine should use for polling at maximum. -.PD -.SS \fBgsl_job_add_poll\fP (\fIpoll_func\fP, \fIdata\fP, \fIfree_func\fP, \fIn_fds\fP, \fIfds\fP); -.PD 0 -.IP \fIGslPollFunc\ \ \ \ \ \ poll_func\fP 28 -Poll function to add -.IP \fIgpointer\ \ \ \ \ \ \ \ \ data\fP 28 -Data of poll function -.IP \fIGslFreeFunc\ \ \ \ \ \ free_func\fP 28 -Function to free \fIdata\fP -.IP \fIguint\ \ \ \ \ \ \ \ \ \ \ \ n_fds\fP 28 -Number of poll file descriptors -.IP \fIconst\ GslPollFD*\ fds\fP 28 -File descriptors to \fBselect(2)\fP or \fBpoll(2)\fP on -.IP \fIRETURNS:\fP 28 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which adds a poll function to the engine. The poll function is used by the engine to determine whether processing is currently necessary. -.PD -.SS \fBgsl_job_remove_poll\fP (\fIpoll_func\fP, \fIdata\fP); -.PD 0 -.IP \fIGslPollFunc\ \ poll_func\fP 24 -Poll function to remove -.IP \fIgpointer\ \ \ \ \ data\fP 24 -Data of poll function -.IP \fIRETURNS:\fP 24 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which removes a previously inserted poll function from the engine. -.PD -.SS \fBgsl_job_debug\fP (\fIdebug\fP); -.PD 0 -.IP \fIconst\ gchar*\ debug\fP 20 -Debug message -.IP \fIRETURNS:\fP 20 -New job suitable for \fBgsl_trans_add()\fP -.PD 1 -.PP -Create a new transaction job which issues \fIdebug\fP message when the job is executed. This function is meant for debugging purposes during development phase only and shouldn't be used in production code. -.PD -.SS \fBgsl_trans_open\fP (); -.PD 0 -.IP \fIRETURNS:\fP 11 -Newly opened empty transaction -.PD 1 -.PP -Open up a new transaction to commit jobs to the GSL engine. This function may cause garbage collection (see \fBgsl_engine_garbage_collect()\fP). -.PD -.SS \fBgsl_trans_add\fP (\fItrans\fP, \fIjob\fP); -.PD 0 -.IP \fIGslTrans*\ trans\fP 17 -Opened transaction -.IP \fIGslJob*\ \ \ job\fP 17 -Job to add -.PD 1 -.PP -Append a job to an opened transaction. -.PD -.SS \fBgsl_trans_commit\fP (\fItrans\fP); -.PD 0 -.IP \fIGslTrans*\ trans\fP 17 -Opened transaction -.PD 1 -.PP -Close the transaction and commit it to the engine. The engine will execute the jobs contained in this transaction as soon as it has completed its current processing cycle. The jobs will be executed in the exact order they were added to the transaction. -.PD -.SS \fBgsl_trans_dismiss\fP (\fItrans\fP); -.PD 0 -.IP \fIGslTrans*\ trans\fP 17 -Opened transaction -.PD 1 -.PP -Close and discard the transaction, destroy all jobs currently contained in it and do not execute them. This function may cause garbage collection (see \fBgsl_engine_garbage_collect()\fP). -.PD -.SS \fBgsl_transact\fP (\fIjob\fP, \fI...\fP); -.PD 0 -.IP \fI\ job\fP 6 -First job -.IP \fI\ ...\fP 6 -\fINULL\fP terminated job list -.PD 1 -.PP -Convenience function which openes up a new transaction, collects the \fINULL\fP terminated job list passed to the function, and commits the transaction. -.PD -.SS \fBgsl_engine_init\fP (\fIrun_threaded\fP, \fIblock_size\fP, \fIsample_freq\fP, \fIsub_sample_mask\fP); -.PD 0 -.IP \fIgboolean\ \ run_threaded\fP 27 - -.IP \fIguint\ \ \ \ \ block_size\fP 27 -number of values to process block wise -.IP \fIguint\ \ \ \ \ sample_freq\fP 27 - -.IP \fIguint\ \ \ \ \ sub_sample_mask\fP 27 - -.PD 1 -.PP -Initialize the GSL engine, this function must be called prior to any other engine related function and can only be invoked once. The \fIblock_size\fP determines the amount by which the global tick stamp (see \fBgsl_tick_stamp()\fP) is updated everytime the whole module network completed processing \fIblock_size\fP values. -.PD -.SS \fBgsl_engine_wait_on_trans\fP (); -.PD 0 -.PD 1 -.PP -Wait until all pending transactions have been processed by the GSL Engine. This function may cause garbage collection (see \fBgsl_engine_garbage_collect()\fP). -.PD -.SS \fBgsl_power2_fftac\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); -.PD 0 -.IP \fI\ n_values\fP 16 -Number of complex values -.IP \fI\ ri_values_in\fP 16 -Complex sample values [0..n_values*2-1] -.IP \fI\ ri_values_out\fP 16 -Complex frequency values [0..n_values*2-1] -.PD 1 -.PP -This function performs a decimation in time fourier transformation in forward direction, where the input values are equidistant sampled data, and the output values contain the frequency proportions of the input. The input and output arrays are complex values with real and imaginery portions interleaved, adressable in the range [0..2*n_values-1], where n_values must be a power of two. Frequencies are stored in-order, the K-th output corresponds to the frequency K/n_values. (If you want to interpret negative frequencies, note that the frequencies -K/n_values and (n_values-K)/n_values are equivalent). Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. -.PD -.SS \fBgsl_power2_fftsc\fP (\fIn_values\fP, \fIri_values_in\fP, \fIri_values_out\fP); -.PD 0 -.IP \fI\ n_values\fP 16 -Number of complex values -.IP \fI\ ri_values_in\fP 16 -Complex frequency values [0..n_values*2-1] -.IP \fI\ ri_values_out\fP 16 -Complex sample values [0..n_values*2-1] -.PD 1 -.PP -This function performs a decimation in time fourier transformation in backwards direction with normalization. As such, this function represents the counterpart to \fBgsl_power2_fftac()\fP, that is, a value array which is transformed into the frequency domain with \fBgsl_power2_fftac()\fP can be reconstructed by issuing \fBgsl_power2_fftsc()\fP on the transform. Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. -.PD -.SS \fBgsl_power2_fftar\fP (\fIn_values\fP, \fIr_values_in\fP, \fIri_values_out\fP); -.PD 0 -.IP \fI\ n_values\fP 16 -Number of complex values -.IP \fI\ r_values_in\fP 16 -Real sample values [0..n_values-1] -.IP \fI\ ri_values_out\fP 16 -Complex frequency values [0..n_values-1] -.PD 1 -.PP -Real valued variant of \fBgsl_power2_fftac()\fP, the input array contains real valued equidistant sampled data [0..n_values-1], and the output array contains the positive frequency half of the complex valued fourier transform. Note, that the complex valued fourier transform H of a purely real valued set of data, satisfies \fBH(-f)\fP = Conj(\fBH(f)\fP), where \fBConj()\fP denotes the complex conjugate, so that just the positive frequency half suffices to describe the entire frequency spectrum. Even so, the resulting n_values/2 complex frequencies are one value off in storage size, but the resulting frequencies \fBH(0)\fP and \fBH(n_values/2)\fP are both real valued, so the real portion of \fBH(n_values/2)\fP is stored in ri_values_out[1] (the imaginery part of \fBH(0)\fP), so that both r_values_in and ri_values_out can be of size n_values. Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. -.PD -.SS \fBgsl_power2_fftsr\fP (\fIn_values\fP, \fIri_values_in\fP, \fIr_values_out\fP); -.PD 0 -.IP \fI\ n_values\fP 15 -Number of complex values -.IP \fI\ ri_values_in\fP 15 -Complex frequency values [0..n_values-1] -.IP \fI\ r_values_out\fP 15 -Real sample values [0..n_values-1] -.PD 1 -.PP -Real valued variant of \fBgsl_power2_fftsc()\fP, counterpart to \fBgsl_power2_fftar()\fP, using the same frequency storage format. A real valued data set transformed into the frequency domain with \fBgsl_power2_fftar()\fP can be reconstructed using this function. Note that the transformation is performed out of place, the input array is not modified, and may not overlap with the output array. -.PD -.SS \fBgsl_filter_tscheb2_steepness_db\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIstopband_db\fP); -.PD 0 -.IP \fIunsigned\ int\ \ iorder\fP 27 -filter order -.IP \fIdouble\ \ \ \ \ \ \ \ c_freq\fP 27 -passband cutoff frequency (0..pi) -.IP \fIdouble\ \ \ \ \ \ \ \ epsilon\fP 27 -fall off at passband frequency (0..1) -.IP \fIdouble\ \ \ \ \ \ \ \ stopband_db\fP 27 -reduction in stopband in dB (>= 0) -.PD 1 -.PP -Calculates the steepness parameter for Tschebyscheff type 2 lowpass filter, based on the ripple residue in the stop band. -.PD -.SS \fBgsl_filter_tscheb2_steepness\fP (\fIiorder\fP, \fIc_freq\fP, \fIepsilon\fP, \fIresidue\fP); -.PD 0 -.IP \fIunsigned\ int\ \ iorder\fP 23 -filter order -.IP \fIdouble\ \ \ \ \ \ \ \ c_freq\fP 23 -passband cutoff frequency (0..pi) -.IP \fIdouble\ \ \ \ \ \ \ \ epsilon\fP 23 -fall off at passband frequency (0..1) -.IP \fIdouble\ \ \ \ \ \ \ \ residue\fP 23 -maximum of transfer function in stopband (0..1) -.PD 1 -.PP -Calculates the steepness parameter for Tschebyscheff type 2 lowpass filter, based on ripple residue in the stop band. -.PD -.SS \fBgsl_filter_butter_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order -.IP \fI\ freq\fP 10 -cutoff frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at cutoff frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Butterworth lowpass filter. -.PD -.SS \fBgsl_filter_tscheb1_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order -.IP \fI\ freq\fP 10 -cutoff frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at cutoff frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 1 lowpass filter. -.PD -.SS \fBgsl_filter_tscheb2_lp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 12 -filter order -.IP \fI\ freq\fP 12 -passband cutoff frequency (0..pi) -.IP \fI\ steepness\fP 12 -frequency steepness (c_freq * steepness < pi) -.IP \fI\ epsilon\fP 12 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 12 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 12 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 2 lowpass filter. To gain a transition band between freq1 and freq2, pass arguements \fIfreq\fP=freq1 and \fIsteepness\fP=freq2/freq1. To specify the transition band width in fractions of octaves, pass \fIsteepness\fP=2^octave_fraction. -.PD -.SS \fBgsl_filter_butter_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order -.IP \fI\ freq\fP 10 -passband frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Butterworth highpass filter. -.PD -.SS \fBgsl_filter_tscheb1_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order -.IP \fI\ freq\fP 10 -passband frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 1 highpass filter. -.PD -.SS \fBgsl_filter_tscheb2_hp\fP (\fIiorder\fP, \fIfreq\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 12 -filter order -.IP \fI\ freq\fP 12 -stopband frequency (0..pi) -.IP \fI\ steepness\fP 12 -frequency steepness -.IP \fI\ epsilon\fP 12 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 12 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 12 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 2 highpass filter. -.PD -.SS \fBgsl_filter_butter_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order (must be even) -.IP \fI\ freq1\fP 10 -stopband end frequency (0..pi) -.IP \fI\ freq2\fP 10 -passband end frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Butterworth bandpass filter. -.PD -.SS \fBgsl_filter_tscheb1_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order (must be even) -.IP \fI\ freq1\fP 10 -stopband end frequency (0..pi) -.IP \fI\ freq2\fP 10 -passband end frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 1 bandpass filter. -.PD -.SS \fBgsl_filter_tscheb2_bp\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 12 -filter order (must be even) -.IP \fI\ freq1\fP 12 -stopband end frequency (0..pi) -.IP \fI\ freq2\fP 12 -passband end frequency (0..pi) -.IP \fI\ steepness\fP 12 -frequency steepness factor -.IP \fI\ epsilon\fP 12 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 12 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 12 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 2 bandpass filter. -.PD -.SS \fBgsl_filter_butter_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order (must be even) -.IP \fI\ freq1\fP 10 -passband end frequency (0..pi) -.IP \fI\ freq2\fP 10 -stopband end frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Butterworth bandstop filter. -.PD -.SS \fBgsl_filter_tscheb1_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 10 -filter order (must be even) -.IP \fI\ freq1\fP 10 -passband end frequency (0..pi) -.IP \fI\ freq2\fP 10 -stopband end frequency (0..pi) -.IP \fI\ epsilon\fP 10 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 10 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 10 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 1 bandstop filter. -.PD -.SS \fBgsl_filter_tscheb2_bs\fP (\fIiorder\fP, \fIfreq1\fP, \fIfreq2\fP, \fIsteepness\fP, \fIepsilon\fP, \fIa\fP, \fIb\fP); -.PD 0 -.IP \fI\ iorder\fP 12 -filter order (must be even) -.IP \fI\ freq1\fP 12 -passband end frequency (0..pi) -.IP \fI\ freq2\fP 12 -stopband end frequency (0..pi) -.IP \fI\ steepness\fP 12 -frequency steepness factor -.IP \fI\ epsilon\fP 12 -fall off at passband frequency (0..1) -.IP \fI\ a\fP 12 -root polynomial coefficients a[0..iorder] -.IP \fI\ b\fP 12 -pole polynomial coefficients b[0..iorder] -.PD 1 -.PP -Tschebyscheff type 2 bandstop filter. -.PD -.SS \fBgsl_filter_fir_approx\fP (\fIiorder\fP, \fIfreq\fP, \fIvalue\fP); -.PD 0 -.IP \fI\ iorder\fP 9 -order of the filter (must be oven, >= 2) -.IP \fI\ freq\fP 9 -the frequencies of the transfer function -.IP \fI\ value\fP 9 -the desired value of the transfer function -.PD 1 -.PP -Approximates a given transfer function with an iorder-coefficient FIR filter. It is recommended to provide enough frequency values, so that \fIn_points\fP >= \fIiorder\fP. -.PD -.SS \fBgsl_filter_sine_scan\fP (\fIorder\fP, \fIa\fP, \fIb\fP, \fIfreq\fP, \fIn_values\fP); -.PD 0 -.IP \fIguint\ \ \ \ \ \ \ \ \ \ order\fP 25 -order of the iir filter -.IP \fIconst\ gdouble*\ a\fP 25 -root polynomial coefficients of the filter a[0..order] -.IP \fIconst\ gdouble*\ b\fP 25 -pole polynomial coefficients of the filter b[0..order] -.IP \fIgdouble\ \ \ \ \ \ \ \ freq\fP 25 -frequency to test -.IP \fIguint\ \ \ \ \ \ \ \ \ \ n_values\fP 25 -number of samples -.PD 1 -.PP -This function sends a sine signal of the desired frequency through an IIR filter, to test the value of the transfer function at a given point. It uses gsl_iir_filter_eval to do so. Compared to a "mathematical approach" of finding the transfer function, this function makes it possible to see the effects of finite arithmetic during filter evaluation. The first half of the output signal is not considered, since a lot of IIR filters have a transient phase where also overshoot is possible. For n_values, you should specify a reasonable large value. It should be a lot larger than the filter order, and large enough to let the input signal become (close to) 1.0 multiple times. -.PD -.SS \fBgsl_engine_garbage_collect\fP (); -.PD 0 -.PD 1 -.PP -GSL Engine user thread function. Collects processed jobs and transactions from the engine and frees them, this involves callback invocation of \fBGslFreeFunc()\fP functions, e.g. from \fBgsl_job_access()\fP or \fBgsl_flow_job_access()\fP jobs. This function may only be called from the user thread, as \fBGslFreeFunc()\fP functions are guranteed to be executed in the user thread. -.PD -.SS \fBgsl_signal_exp2\fP (); -.PD 0 -.PD 1 -.PP -Deprecated in favour of \fBgsl_approx_exp2()\fP. -.PD -.SS \fBgsl_approx_exp2\fP (\fIex\fP); -.PD 0 -.IP \fIfloat\ \ ex\fP 11 -exponent within [-127..127] -.IP \fIRETURNS:\fP 11 -y approximating 2^x -.PD 1 -.PP -Fast approximation of 2 raised to the power of x. Multiplicative error stays below 8e-6 and aproaches zero for integer values of x (i.e. x - floor (x) = 0). -.PD -.SS \fBgsl_approx_atan1\fP (\fIx\fP); -.PD 0 -.IP \fIregister\ double\ \ x\fP 20 - -.PD 1 -.PP -Fast \fBatan(x)\fP/(PI/2) approximation, with maximum error < 0.01 and \fBgsl_approx_atan1(0)\fP==0, according to the formula: n1 = -0.41156875521951602506487246309908; n2 = -1.0091272542790025586079663559158; d1 = 0.81901156857081841441890603235599; d2 = 1.0091272542790025586079663559158; \fBpositive_atan1(x)\fP = 1 + (n1 * x + n2) / ((1 + d1 * x) * x + d2); -.PD -.SS \fBgsl_approx_atan1_prescale\fP (\fIboost_amount\fP); -.PD 0 -.IP \fI\ boost_amount\fP 15 -boost amount between [0..1] -.IP \fIRETURNS:\fP 15 -prescale factor for \fBgsl_approx_atan1()\fP -.PD 1 -.PP -Calculate the prescale factor for \fBgsl_approx_atan1(x*prescale)\fP from a linear boost factor, where 0.5 amounts to prescale=1.0, 1.0 results in maximum boost and 0.0 results in maximum attenuation. -.PD -.SS \fBgsl_approx_qcircle1\fP (\fIx\fP); -.PD 0 -.IP \fIregister\ double\ \ x\fP 20 -x within [0..1] -.IP \fIRETURNS:\fP 20 -y for circle approximation within [0..1] -.PD 1 -.PP -Fast approximation of the upper right quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. -.PD -.SS \fBgsl_approx_qcircle2\fP (\fIx\fP); -.PD 0 -.IP \fIregister\ double\ \ x\fP 20 -x within [0..1] -.IP \fIRETURNS:\fP 20 -y for circle approximation within [0..1] -.PD 1 -.PP -Fast approximation of the upper left quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. -.PD -.SS \fBgsl_approx_qcircle3\fP (\fIx\fP); -.PD 0 -.IP \fIregister\ double\ \ x\fP 20 -x within [0..1] -.IP \fIRETURNS:\fP 20 -y for circle approximation within [0..1] -.PD 1 -.PP -Fast approximation of the lower left quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. -.PD -.SS \fBgsl_approx_qcircle4\fP (\fIx\fP); -.PD 0 -.IP \fIregister\ double\ \ x\fP 20 -x within [0..1] -.IP \fIRETURNS:\fP 20 -y for circle approximation within [0..1] -.PD 1 -.PP -Fast approximation of the lower right quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092. -.PD - diff --git a/flow/gsl/gslconfig.h.cmake b/flow/gsl/gslconfig.h.cmake new file mode 100644 index 0000000..6e91bd5 --- /dev/null +++ b/flow/gsl/gslconfig.h.cmake @@ -0,0 +1,11 @@ +#define GSL_SIZEOF_PTH_MUTEX_T (@GSL_SIZEOF_PTH_MUTEX_T@) +#define GSL_SIZEOF_PTH_COND_T (@GSL_SIZEOF_PTH_COND_T@) +#define GSL_HAVE_MUTEXATTR_SETTYPE (@GSL_HAVE_MUTEXATTR_SETTYPE@ && \ + GSL_SIZEOF_PTH_MUTEX_T && \ + GSL_SIZEOF_PTH_COND_T) +#define GSL_SIZEOF_STD_INTMAX_T (@GSL_SIZEOF_STD_INTMAX_T@) +#define GSL_HAVE_LIBMAD (@GSL_HAVE_LIBMAD@) +#define GSL_HAVE_OGGVORBIS (@GSL_HAVE_OGGVORBIS@) +#define GSL_HAVE_OGGVORBIS_RC3 (@GSL_HAVE_OGGVORBIS_RC3@) +#define GSL_USE_GSL_GLIB (@GSL_USE_GSL_GLIB@) +#define GSL_USE_ARTS_THREADS (@GSL_USE_ARTS_THREADS@) diff --git a/flow/gsl/gslconfig.h.in b/flow/gsl/gslconfig.h.in deleted file mode 100644 index 6e91bd5..0000000 --- a/flow/gsl/gslconfig.h.in +++ /dev/null @@ -1,11 +0,0 @@ -#define GSL_SIZEOF_PTH_MUTEX_T (@GSL_SIZEOF_PTH_MUTEX_T@) -#define GSL_SIZEOF_PTH_COND_T (@GSL_SIZEOF_PTH_COND_T@) -#define GSL_HAVE_MUTEXATTR_SETTYPE (@GSL_HAVE_MUTEXATTR_SETTYPE@ && \ - GSL_SIZEOF_PTH_MUTEX_T && \ - GSL_SIZEOF_PTH_COND_T) -#define GSL_SIZEOF_STD_INTMAX_T (@GSL_SIZEOF_STD_INTMAX_T@) -#define GSL_HAVE_LIBMAD (@GSL_HAVE_LIBMAD@) -#define GSL_HAVE_OGGVORBIS (@GSL_HAVE_OGGVORBIS@) -#define GSL_HAVE_OGGVORBIS_RC3 (@GSL_HAVE_OGGVORBIS_RC3@) -#define GSL_USE_GSL_GLIB (@GSL_USE_GSL_GLIB@) -#define GSL_USE_ARTS_THREADS (@GSL_USE_ARTS_THREADS@) diff --git a/mcop/dispatcher.cpp b/mcop/dispatcher.cpp index 580a268..fc3763d 100644 --- a/mcop/dispatcher.cpp +++ b/mcop/dispatcher.cpp @@ -20,7 +20,10 @@ */ -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "dispatcher.h" #include "delayedreturn.h" #include "startupmanager.h" @@ -43,14 +46,12 @@ #include #include -#if TIME_WITH_SYS_TIME -# include -# include -#elif HAVE_SYS_TIME_H -# include -#else -# include -#endif +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#if defined(TIME_WITH_SYS_TIME) +#include +#endif /* Dispatcher private data class (to ensure binary compatibility) */ diff --git a/mcop/md5auth.cpp b/mcop/md5auth.cpp index 5278870..9811641 100644 --- a/mcop/md5auth.cpp +++ b/mcop/md5auth.cpp @@ -20,7 +20,9 @@ */ -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include @@ -32,13 +34,11 @@ #include #include -#if TIME_WITH_SYS_TIME -# include -# include -#elif HAVE_SYS_TIME_H -# include -#else -# include +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#if defined(TIME_WITH_SYS_TIME) +#include #endif #include "md5.h" -- cgit v1.2.3