diff --git a/CMakeLists.txt b/CMakeLists.txt index 51f5afd..796e6aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required (VERSION 2.8) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + macro(configure_files srcDir destDir) message(STATUS "Configuring directory ${destDir}") make_directory(${destDir}) @@ -50,8 +52,9 @@ SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}) find_package(OpenGL REQUIRED) + +find_package(wxWidgets REQUIRED gl core base) set(wxWidgets_CONFIGURATION mswu) -find_package(wxWidgets COMPONENTS gl core base REQUIRED) include(${wxWidgets_USE_FILE}) # include_directories ( ${PROJECT_SOURCE_DIR}/../CubicVR-2/build/include ) @@ -59,13 +62,14 @@ include(${wxWidgets_USE_FILE}) if (DEFINED WIN32) + set(wxWidgets_USE_STATIC ON) include_directories ( ${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll64 ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release ) link_directories ( ${PROJECT_SOURCE_DIR}/external/fftw-3.3.4-dll64 ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release/x64 ) set(FFTW_LIB fftw3-3) include_directories ( ${PROJECT_SOURCE_DIR}/external/portaudio/include ) - link_directories ( ${PROJECT_SOURCE_DIR}/external/portaudio/libs ) - SET (PORTAUDIO_LIBRARY portaudio.dll winmm) + link_directories ( ${PROJECT_SOURCE_DIR}/external/portaudio/libs/64 ) + SET (PORTAUDIO_LIBRARY libportaudio_x86.dll winmm) link_directories ( ${PROJECT_SOURCE_DIR}/external/liquid-dsp/lib/64 ) include_directories ( ${PROJECT_SOURCE_DIR}/external/liquid-dsp/include ) diff --git a/cmake/Modules/CMakeParseArguments.cmake b/cmake/Modules/CMakeParseArguments.cmake new file mode 100644 index 0000000..8553f38 --- /dev/null +++ b/cmake/Modules/CMakeParseArguments.cmake @@ -0,0 +1,161 @@ +#.rst: +# CMakeParseArguments +# ------------------- +# +# +# +# CMAKE_PARSE_ARGUMENTS( +# args...) +# +# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions +# for parsing the arguments given to that macro or function. It +# processes the arguments and defines a set of variables which hold the +# values of the respective options. +# +# The argument contains all options for the respective macro, +# i.e. keywords which can be used when calling the macro without any +# value following, like e.g. the OPTIONAL keyword of the install() +# command. +# +# The argument contains all keywords for this macro +# which are followed by one value, like e.g. DESTINATION keyword of the +# install() command. +# +# The argument contains all keywords for this +# macro which can be followed by more than one value, like e.g. the +# TARGETS or FILES keywords of the install() command. +# +# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the +# keywords listed in , and +# a variable composed of the given +# followed by "_" and the name of the respective keyword. These +# variables will then hold the respective value from the argument list. +# For the keywords this will be TRUE or FALSE. +# +# All remaining arguments are collected in a variable +# _UNPARSED_ARGUMENTS, this can be checked afterwards to see +# whether your macro was called with unrecognized parameters. +# +# As an example here a my_install() macro, which takes similar arguments +# as the real install() command: +# +# :: +# +# function(MY_INSTALL) +# set(options OPTIONAL FAST) +# set(oneValueArgs DESTINATION RENAME) +# set(multiValueArgs TARGETS CONFIGURATIONS) +# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" +# "${multiValueArgs}" ${ARGN} ) +# ... +# +# +# +# Assume my_install() has been called like this: +# +# :: +# +# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) +# +# +# +# After the cmake_parse_arguments() call the macro will have set the +# following variables: +# +# :: +# +# MY_INSTALL_OPTIONAL = TRUE +# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() +# MY_INSTALL_DESTINATION = "bin" +# MY_INSTALL_RENAME = "" (was not used) +# MY_INSTALL_TARGETS = "foo;bar" +# MY_INSTALL_CONFIGURATIONS = "" (was not used) +# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" +# +# +# +# You can then continue and process these variables. +# +# Keywords terminate lists of values, e.g. if directly after a +# one_value_keyword another recognized keyword follows, this is +# interpreted as the beginning of the new option. E.g. +# my_install(TARGETS foo DESTINATION OPTIONAL) would result in +# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION +# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor. + +#============================================================================= +# Copyright 2010 Alexander Neundorf +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + + +if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) + return() +endif() +set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) + + +function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) + # first set all result variables to empty/FALSE + foreach(arg_name ${_singleArgNames} ${_multiArgNames}) + set(${prefix}_${arg_name}) + endforeach() + + foreach(option ${_optionNames}) + set(${prefix}_${option} FALSE) + endforeach() + + set(${prefix}_UNPARSED_ARGUMENTS) + + set(insideValues FALSE) + set(currentArgName) + + # now iterate over all arguments and fill the result variables + foreach(currentArg ${ARGN}) + list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword + list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword + list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword + + if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) + if(insideValues) + if("${insideValues}" STREQUAL "SINGLE") + set(${prefix}_${currentArgName} ${currentArg}) + set(insideValues FALSE) + elseif("${insideValues}" STREQUAL "MULTI") + list(APPEND ${prefix}_${currentArgName} ${currentArg}) + endif() + else() + list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) + endif() + else() + if(NOT ${optionIndex} EQUAL -1) + set(${prefix}_${currentArg} TRUE) + set(insideValues FALSE) + elseif(NOT ${singleArgIndex} EQUAL -1) + set(currentArgName ${currentArg}) + set(${prefix}_${currentArgName}) + set(insideValues "SINGLE") + elseif(NOT ${multiArgIndex} EQUAL -1) + set(currentArgName ${currentArg}) + set(${prefix}_${currentArgName}) + set(insideValues "MULTI") + endif() + endif() + + endforeach() + + # propagate the result variables to the caller: + foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) + set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) + endforeach() + set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) + +endfunction() diff --git a/cmake/Modules/FindPackageHandleStandardArgs.cmake b/cmake/Modules/FindPackageHandleStandardArgs.cmake new file mode 100644 index 0000000..2de1fb3 --- /dev/null +++ b/cmake/Modules/FindPackageHandleStandardArgs.cmake @@ -0,0 +1,382 @@ +#.rst: +# FindPackageHandleStandardArgs +# ----------------------------- +# +# +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS( ... ) +# +# This function is intended to be used in FindXXX.cmake modules files. +# It handles the REQUIRED, QUIET and version-related arguments to +# find_package(). It also sets the _FOUND variable. The +# package is considered found if all variables ... listed contain +# valid results, e.g. valid filepaths. +# +# There are two modes of this function. The first argument in both +# modes is the name of the Find-module where it is called (in original +# casing). +# +# The first simple mode looks like this: +# +# :: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS( +# (DEFAULT_MSG|"Custom failure message") ... ) +# +# If the variables to are all valid, then +# _FOUND will be set to TRUE. If DEFAULT_MSG is given +# as second argument, then the function will generate itself useful +# success and error messages. You can also supply a custom error +# message for the failure case. This is not recommended. +# +# The second mode is more powerful and also supports version checking: +# +# :: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME +# [FOUND_VAR ] +# [REQUIRED_VARS ...] +# [VERSION_VAR ] +# [HANDLE_COMPONENTS] +# [CONFIG_MODE] +# [FAIL_MESSAGE "Custom failure message"] ) +# +# In this mode, the name of the result-variable can be set either to +# either _FOUND or _FOUND using the +# FOUND_VAR option. Other names for the result-variable are not +# allowed. So for a Find-module named FindFooBar.cmake, the two +# possible names are FooBar_FOUND and FOOBAR_FOUND. It is recommended +# to use the original case version. If the FOUND_VAR option is not +# used, the default is _FOUND. +# +# As in the simple mode, if through are all valid, +# _FOUND will be set to TRUE. After REQUIRED_VARS the +# variables which are required for this package are listed. Following +# VERSION_VAR the name of the variable can be specified which holds the +# version of the package which has been found. If this is done, this +# version will be checked against the (potentially) specified required +# version used in the find_package() call. The EXACT keyword is also +# handled. The default messages include information about the required +# version and the version which has been actually found, both if the +# version is ok or not. If the package supports components, use the +# HANDLE_COMPONENTS option to enable handling them. In this case, +# find_package_handle_standard_args() will report which components have +# been found and which are missing, and the _FOUND variable +# will be set to FALSE if any of the required components (i.e. not the +# ones listed after OPTIONAL_COMPONENTS) are missing. Use the option +# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a +# find_package(... NO_MODULE) call. In this case VERSION_VAR will be +# set to _VERSION and the macro will automatically check whether +# the Config module was found. Via FAIL_MESSAGE a custom failure +# message can be specified, if this is not used, the default message +# will be displayed. +# +# Example for mode 1: +# +# :: +# +# find_package_handle_standard_args(LibXml2 DEFAULT_MSG +# LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) +# +# +# +# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and +# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to +# TRUE. If it is not found and REQUIRED was used, it fails with +# FATAL_ERROR, independent whether QUIET was used or not. If it is +# found, success will be reported, including the content of . On +# repeated Cmake runs, the same message won't be printed again. +# +# Example for mode 2: +# +# :: +# +# find_package_handle_standard_args(LibXslt +# FOUND_VAR LibXslt_FOUND +# REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS +# VERSION_VAR LibXslt_VERSION_STRING) +# +# In this case, LibXslt is considered to be found if the variable(s) +# listed after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and +# LibXslt_INCLUDE_DIRS in this case. The result will then be stored in +# LibXslt_FOUND . Also the version of LibXslt will be checked by using +# the version contained in LibXslt_VERSION_STRING. Since no +# FAIL_MESSAGE is given, the default messages will be printed. +# +# Another example for mode 2: +# +# :: +# +# find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) +# find_package_handle_standard_args(Automoc4 CONFIG_MODE) +# +# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 +# NO_MODULE) and adds an additional search directory for automoc4. Here +# the result will be stored in AUTOMOC4_FOUND. The following +# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper +# success/error message. + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake) + +# internal helper macro +macro(_FPHSA_FAILURE_MESSAGE _msg) + if (${_NAME}_FIND_REQUIRED) + message(FATAL_ERROR "${_msg}") + else () + if (NOT ${_NAME}_FIND_QUIETLY) + message(STATUS "${_msg}") + endif () + endif () +endmacro() + + +# internal helper macro to generate the failure message when used in CONFIG_MODE: +macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) + # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: + if(${_NAME}_CONFIG) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") + else() + # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. + # List them all in the error message: + if(${_NAME}_CONSIDERED_CONFIGS) + set(configsText "") + list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) + math(EXPR configsCount "${configsCount} - 1") + foreach(currentConfigIndex RANGE ${configsCount}) + list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) + list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) + set(configsText "${configsText} ${filename} (version ${version})\n") + endforeach() + if (${_NAME}_NOT_FOUND_MESSAGE) + set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n") + endif() + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") + + else() + # Simple case: No Config-file was found at all: + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") + endif() + endif() +endmacro() + + +function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) + +# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in +# new extended or in the "old" mode: + set(options CONFIG_MODE HANDLE_COMPONENTS) + set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR) + set(multiValueArgs REQUIRED_VARS) + set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) + list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) + + if(${INDEX} EQUAL -1) + set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) + set(FPHSA_REQUIRED_VARS ${ARGN}) + set(FPHSA_VERSION_VAR) + else() + + CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) + + if(FPHSA_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") + endif() + + if(NOT FPHSA_FAIL_MESSAGE) + set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") + endif() + endif() + +# now that we collected all arguments, process them + + if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG") + set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") + endif() + + # In config-mode, we rely on the variable _CONFIG, which is set by find_package() + # when it successfully found the config-file, including version checking: + if(FPHSA_CONFIG_MODE) + list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) + list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) + set(FPHSA_VERSION_VAR ${_NAME}_VERSION) + endif() + + if(NOT FPHSA_REQUIRED_VARS) + message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") + endif() + + list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) + + string(TOUPPER ${_NAME} _NAME_UPPER) + string(TOLOWER ${_NAME} _NAME_LOWER) + + if(FPHSA_FOUND_VAR) + if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$") + set(_FOUND_VAR ${FPHSA_FOUND_VAR}) + else() + message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.") + endif() + else() + set(_FOUND_VAR ${_NAME_UPPER}_FOUND) + endif() + + # collect all variables which were not found, so they can be printed, so the + # user knows better what went wrong (#6375) + set(MISSING_VARS "") + set(DETAILS "") + # check if all passed variables are valid + unset(${_FOUND_VAR}) + foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) + if(NOT ${_CURRENT_VAR}) + set(${_FOUND_VAR} FALSE) + set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") + else() + set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") + endif() + endforeach() + if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE") + set(${_FOUND_VAR} TRUE) + endif() + + # component handling + unset(FOUND_COMPONENTS_MSG) + unset(MISSING_COMPONENTS_MSG) + + if(FPHSA_HANDLE_COMPONENTS) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(${_NAME}_${comp}_FOUND) + + if(NOT DEFINED FOUND_COMPONENTS_MSG) + set(FOUND_COMPONENTS_MSG "found components: ") + endif() + set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") + + else() + + if(NOT DEFINED MISSING_COMPONENTS_MSG) + set(MISSING_COMPONENTS_MSG "missing components: ") + endif() + set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") + + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_FOUND_VAR} FALSE) + set(MISSING_VARS "${MISSING_VARS} ${comp}") + endif() + + endif() + endforeach() + set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") + set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") + endif() + + # version handling: + set(VERSION_MSG "") + set(VERSION_OK TRUE) + set(VERSION ${${FPHSA_VERSION_VAR}}) + + # check with DEFINED here as the requested or found version may be "0" + if (DEFINED ${_NAME}_FIND_VERSION) + if(DEFINED ${FPHSA_VERSION_VAR}) + + if(${_NAME}_FIND_VERSION_EXACT) # exact version required + # count the dots in the version string + string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${VERSION}") + # add one dot because there is one dot more than there are components + string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS) + if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT) + # Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT + # is at most 4 here. Therefore a simple lookup table is used. + if (${_NAME}_FIND_VERSION_COUNT EQUAL 1) + set(_VERSION_REGEX "[^.]*") + elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2) + set(_VERSION_REGEX "[^.]*\\.[^.]*") + elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3) + set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*") + else () + set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*") + endif () + string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${VERSION}") + unset(_VERSION_REGEX) + if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD) + set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") + set(VERSION_OK FALSE) + else () + set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") + endif () + unset(_VERSION_HEAD) + else () + if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL VERSION) + set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") + set(VERSION_OK FALSE) + else () + set(VERSION_MSG "(found suitable exact version \"${VERSION}\")") + endif () + endif () + unset(_VERSION_DOTS) + + else() # minimum version specified: + if (${_NAME}_FIND_VERSION VERSION_GREATER VERSION) + set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") + set(VERSION_OK FALSE) + else () + set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")") + endif () + endif() + + else() + + # if the package was not found, but a version was given, add that to the output: + if(${_NAME}_FIND_VERSION_EXACT) + set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") + else() + set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") + endif() + + endif() + else () + if(VERSION) + set(VERSION_MSG "(found version \"${VERSION}\")") + endif() + endif () + + if(VERSION_OK) + set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") + else() + set(${_FOUND_VAR} FALSE) + endif() + + + # print the result: + if (${_FOUND_VAR}) + FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") + else () + + if(FPHSA_CONFIG_MODE) + _FPHSA_HANDLE_FAILURE_CONFIG_MODE() + else() + if(NOT VERSION_OK) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") + else() + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") + endif() + endif() + + endif () + + set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE) + +endfunction() diff --git a/cmake/Modules/FindPackageMessage.cmake b/cmake/Modules/FindPackageMessage.cmake new file mode 100644 index 0000000..a0349d3 --- /dev/null +++ b/cmake/Modules/FindPackageMessage.cmake @@ -0,0 +1,57 @@ +#.rst: +# FindPackageMessage +# ------------------ +# +# +# +# FIND_PACKAGE_MESSAGE( "message for user" "find result details") +# +# This macro is intended to be used in FindXXX.cmake modules files. It +# will print a message once for each unique find result. This is useful +# for telling the user where a package was found. The first argument +# specifies the name (XXX) of the package. The second argument +# specifies the message to display. The third argument lists details +# about the find result so that if they change the message will be +# displayed again. The macro also obeys the QUIET argument to the +# find_package command. +# +# Example: +# +# :: +# +# if(X11_FOUND) +# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}" +# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") +# else() +# ... +# endif() + +#============================================================================= +# Copyright 2008-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +function(FIND_PACKAGE_MESSAGE pkg msg details) + # Avoid printing a message repeatedly for the same find result. + if(NOT ${pkg}_FIND_QUIETLY) + string(REPLACE "\n" "" details "${details}") + set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg}) + if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") + # The message has not yet been printed. + message(STATUS "${msg}") + + # Save the find details in the cache to avoid printing the same + # message again. + set("${DETAILS_VAR}" "${details}" + CACHE INTERNAL "Details about finding ${pkg}") + endif() + endif() +endfunction() diff --git a/cmake/Modules/FindwxWidgets.cmake b/cmake/Modules/FindwxWidgets.cmake new file mode 100644 index 0000000..7ef06a8 --- /dev/null +++ b/cmake/Modules/FindwxWidgets.cmake @@ -0,0 +1,1082 @@ +#.rst: +# FindwxWidgets +# ------------- +# +# Find a wxWidgets (a.k.a., wxWindows) installation. +# +# This module finds if wxWidgets is installed and selects a default +# configuration to use. wxWidgets is a modular library. To specify the +# modules that you will use, you need to name them as components to the +# package: +# +# find_package(wxWidgets COMPONENTS core base ...) +# +# There are two search branches: a windows style and a unix style. For +# windows, the following variables are searched for and set to defaults +# in case of multiple choices. Change them if the defaults are not +# desired (i.e., these are the only variables you should change to +# select a configuration): +# +# :: +# +# wxWidgets_ROOT_DIR - Base wxWidgets directory +# (e.g., C:/wxWidgets-2.6.3). +# wxWidgets_LIB_DIR - Path to wxWidgets libraries +# (e.g., C:/wxWidgets-2.6.3/lib/vc_lib). +# wxWidgets_CONFIGURATION - Configuration to use +# (e.g., msw, mswd, mswu, mswunivud, etc.) +# wxWidgets_EXCLUDE_COMMON_LIBRARIES +# - Set to TRUE to exclude linking of +# commonly required libs (e.g., png tiff +# jpeg zlib regex expat). +# +# +# +# For unix style it uses the wx-config utility. You can select between +# debug/release, unicode/ansi, universal/non-universal, and +# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF +# the following variables: +# +# :: +# +# wxWidgets_USE_DEBUG +# wxWidgets_USE_UNICODE +# wxWidgets_USE_UNIVERSAL +# wxWidgets_USE_STATIC +# +# +# +# There is also a wxWidgets_CONFIG_OPTIONS variable for all other +# options that need to be passed to the wx-config utility. For example, +# to use the base toolkit found in the /usr/local path, set the variable +# (before calling the FIND_PACKAGE command) as such: +# +# :: +# +# set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr) +# +# +# +# The following are set after the configuration is done for both windows +# and unix style: +# +# :: +# +# wxWidgets_FOUND - Set to TRUE if wxWidgets was found. +# wxWidgets_INCLUDE_DIRS - Include directories for WIN32 +# i.e., where to find "wx/wx.h" and +# "wx/setup.h"; possibly empty for unices. +# wxWidgets_LIBRARIES - Path to the wxWidgets libraries. +# wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for +# rpath on UNIX. Typically an empty string +# in WIN32 environment. +# wxWidgets_DEFINITIONS - Contains defines required to compile/link +# against WX, e.g. WXUSINGDLL +# wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link +# against WX debug builds, e.g. __WXDEBUG__ +# wxWidgets_CXX_FLAGS - Include dirs and compiler flags for +# unices, empty on WIN32. Essentially +# "`wx-config --cxxflags`". +# wxWidgets_USE_FILE - Convenience include file. +# +# +# +# Sample usage: +# +# :: +# +# # Note that for MinGW users the order of libs is important! +# find_package(wxWidgets COMPONENTS net gl core base) +# if(wxWidgets_FOUND) +# include(${wxWidgets_USE_FILE}) +# # and for each of your dependent executable/library targets: +# target_link_libraries( ${wxWidgets_LIBRARIES}) +# endif() +# +# +# +# If wxWidgets is required (i.e., not an optional part): +# +# :: +# +# find_package(wxWidgets REQUIRED net gl core base) +# include(${wxWidgets_USE_FILE}) +# # and for each of your dependent executable/library targets: +# target_link_libraries( ${wxWidgets_LIBRARIES}) + +#============================================================================= +# Copyright 2004-2009 Kitware, Inc. +# Copyright 2007-2009 Miguel A. Figueroa-Villanueva +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# FIXME: check this and provide a correct sample usage... +# Remember to connect back to the upper text. +# Sample usage with monolithic wx build: +# +# find_package(wxWidgets COMPONENTS mono) +# ... + +# NOTES +# +# This module has been tested on the WIN32 platform with wxWidgets +# 2.6.2, 2.6.3, and 2.5.3. However, it has been designed to +# easily extend support to all possible builds, e.g., static/shared, +# debug/release, unicode, universal, multilib/monolithic, etc.. +# +# If you want to use the module and your build type is not supported +# out-of-the-box, please contact me to exchange information on how +# your system is setup and I'll try to add support for it. +# +# AUTHOR +# +# Miguel A. Figueroa-Villanueva (miguelf at ieee dot org). +# Jan Woetzel (jw at mip.informatik.uni-kiel.de). +# +# Based on previous works of: +# Jan Woetzel (FindwxWindows.cmake), +# Jorgen Bodde and Jerry Fath (FindwxWin.cmake). + +# TODO/ideas +# +# (1) Option/Setting to use all available wx libs +# In contrast to expert developer who lists the +# minimal set of required libs in wxWidgets_USE_LIBS +# there is the newbie user: +# - who just wants to link against WX with more 'magic' +# - doesn't know the internal structure of WX or how it was built, +# in particular if it is monolithic or not +# - want to link against all available WX libs +# Basically, the intent here is to mimic what wx-config would do by +# default (i.e., `wx-config --libs`). +# +# Possible solution: +# Add a reserved keyword "std" that initializes to what wx-config +# would default to. If the user has not set the wxWidgets_USE_LIBS, +# default to "std" instead of "base core" as it is now. To implement +# "std" will basically boil down to a FOR_EACH lib-FOUND, but maybe +# checking whether a minimal set was found. + + +# FIXME: This and all the DBG_MSG calls should be removed after the +# module stabilizes. +# +# Helper macro to control the debugging output globally. There are +# two versions for controlling how verbose your output should be. +macro(DBG_MSG _MSG) +# message(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +endmacro() +macro(DBG_MSG_V _MSG) +# message(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +endmacro() + +# Clear return values in case the module is loaded more than once. +set(wxWidgets_FOUND FALSE) +set(wxWidgets_INCLUDE_DIRS "") +set(wxWidgets_LIBRARIES "") +set(wxWidgets_LIBRARY_DIRS "") +set(wxWidgets_CXX_FLAGS "") + +# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on +# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM +# to prevent UsewxWidgets.cmake from using SYSTEM. +# +# See cmake mailing list discussions for more info: +# http://www.cmake.org/pipermail/cmake/2008-April/021115.html +# http://www.cmake.org/pipermail/cmake/2008-April/021146.html +# +if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") + set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) +endif() + +# DEPRECATED: This is a patch to support the DEPRECATED use of +# wxWidgets_USE_LIBS. +# +# If wxWidgets_USE_LIBS is set: +# - if using , then override wxWidgets_USE_LIBS +# - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS +if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) + set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS}) +endif() +DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}") + +# Add the convenience use file if available. +# +# Get dir of this file which may reside in: +# - CMAKE_MAKE_ROOT/Modules on CMake installation +# - CMAKE_MODULE_PATH if user prefers his own specialized version +set(wxWidgets_USE_FILE "") +get_filename_component( + wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) +# Prefer an existing customized version, but the user might override +# the FindwxWidgets module and not the UsewxWidgets one. +if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") + set(wxWidgets_USE_FILE + "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") +else() + set(wxWidgets_USE_FILE UsewxWidgets) +endif() + +#===================================================================== +# Determine whether unix or win32 paths should be used +#===================================================================== +if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING) + set(wxWidgets_FIND_STYLE "win32") +else() + set(wxWidgets_FIND_STYLE "unix") +endif() + +#===================================================================== +# WIN32_FIND_STYLE +#===================================================================== +if(wxWidgets_FIND_STYLE STREQUAL "win32") + # Useful common wx libs needed by almost all components. + set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat) + + # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead. + if(NOT wxWidgets_FIND_COMPONENTS) + if(wxWidgets_USE_MONOLITHIC) + set(wxWidgets_FIND_COMPONENTS mono) + else() + set(wxWidgets_FIND_COMPONENTS core base) # this is default + endif() + endif() + + # Add the common (usually required libs) unless + # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set. + if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES) + list(APPEND wxWidgets_FIND_COMPONENTS + ${wxWidgets_COMMON_LIBRARIES}) + endif() + + #------------------------------------------------------------------- + # WIN32: Helper MACROS + #------------------------------------------------------------------- + # + # Get filename components for a configuration. For example, + # if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d + # if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG="" + # + macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG) + string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}") + string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}") + if(${_UCD} STREQUAL ${_CONFIGURATION}) + set(${_UCD} "") + endif() + string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}") + endmacro() + + # + # Find libraries associated to a configuration. + # + macro(WX_FIND_LIBS _UNV _UCD _DBG) + DBG_MSG_V("m_unv = ${_UNV}") + DBG_MSG_V("m_ucd = ${_UCD}") + DBG_MSG_V("m_dbg = ${_DBG}") + + # FIXME: What if both regex libs are available. regex should be + # found outside the loop and only wx${LIB}${_UCD}${_DBG}. + # Find wxWidgets common libraries. + foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) + find_library(WX_${LIB}${_DBG} + NAMES + wx${LIB}${_UCD}${_DBG} # for regex + wx${LIB}${_DBG} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + mark_as_advanced(WX_${LIB}${_DBG}) + endforeach() + + # Find wxWidgets multilib base libraries. + find_library(WX_base${_DBG} + NAMES + wxbase30${_UCD}${_DBG} + wxbase29${_UCD}${_DBG} + wxbase28${_UCD}${_DBG} + wxbase27${_UCD}${_DBG} + wxbase26${_UCD}${_DBG} + wxbase25${_UCD}${_DBG} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + mark_as_advanced(WX_base${_DBG}) + foreach(LIB net odbc xml) + find_library(WX_${LIB}${_DBG} + NAMES + wxbase30${_UCD}${_DBG}_${LIB} + wxbase29${_UCD}${_DBG}_${LIB} + wxbase28${_UCD}${_DBG}_${LIB} + wxbase27${_UCD}${_DBG}_${LIB} + wxbase26${_UCD}${_DBG}_${LIB} + wxbase25${_UCD}${_DBG}_${LIB} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + mark_as_advanced(WX_${LIB}${_DBG}) + endforeach() + + # Find wxWidgets monolithic library. + find_library(WX_mono${_DBG} + NAMES + wxmsw${_UNV}30${_UCD}${_DBG} + wxmsw${_UNV}29${_UCD}${_DBG} + wxmsw${_UNV}28${_UCD}${_DBG} + wxmsw${_UNV}27${_UCD}${_DBG} + wxmsw${_UNV}26${_UCD}${_DBG} + wxmsw${_UNV}25${_UCD}${_DBG} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + mark_as_advanced(WX_mono${_DBG}) + + # Find wxWidgets multilib libraries. + foreach(LIB core adv aui html media xrc dbgrid gl qa richtext + stc ribbon propgrid webview) + find_library(WX_${LIB}${_DBG} + NAMES + wxmsw${_UNV}30${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}29${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}28${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}27${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}26${_UCD}${_DBG}_${LIB} + wxmsw${_UNV}25${_UCD}${_DBG}_${LIB} + PATHS ${WX_LIB_DIR} + NO_DEFAULT_PATH + ) + mark_as_advanced(WX_${LIB}${_DBG}) + endforeach() + endmacro() + + # + # Clear all library paths, so that FIND_LIBRARY refinds them. + # + # Clear a lib, reset its found flag, and mark as advanced. + macro(WX_CLEAR_LIB _LIB) + set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE) + set(${_LIB}_FOUND FALSE) + mark_as_advanced(${_LIB}) + endmacro() + # Clear all debug or release library paths (arguments are "d" or ""). + macro(WX_CLEAR_ALL_LIBS _DBG) + # Clear wxWidgets common libraries. + foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) + WX_CLEAR_LIB(WX_${LIB}${_DBG}) + endforeach() + + # Clear wxWidgets multilib base libraries. + WX_CLEAR_LIB(WX_base${_DBG}) + foreach(LIB net odbc xml) + WX_CLEAR_LIB(WX_${LIB}${_DBG}) + endforeach() + + # Clear wxWidgets monolithic library. + WX_CLEAR_LIB(WX_mono${_DBG}) + + # Clear wxWidgets multilib libraries. + foreach(LIB core adv aui html media xrc dbgrid gl qa richtext + stc ribbon propgrid) + WX_CLEAR_LIB(WX_${LIB}${_DBG}) + endforeach() + endmacro() + # Clear all wxWidgets debug libraries. + macro(WX_CLEAR_ALL_DBG_LIBS) + WX_CLEAR_ALL_LIBS("d") + endmacro() + # Clear all wxWidgets release libraries. + macro(WX_CLEAR_ALL_REL_LIBS) + WX_CLEAR_ALL_LIBS("") + endmacro() + + # + # Set the wxWidgets_LIBRARIES variable. + # Also, Sets output variable wxWidgets_FOUND to FALSE if it fails. + # + macro(WX_SET_LIBRARIES _LIBS _DBG) + DBG_MSG_V("Looking for ${${_LIBS}}") + if(WX_USE_REL_AND_DBG) + foreach(LIB ${${_LIBS}}) + DBG_MSG_V("Searching for ${LIB} and ${LIB}d") + DBG_MSG_V("WX_${LIB} : ${WX_${LIB}}") + DBG_MSG_V("WX_${LIB}d : ${WX_${LIB}d}") + if(WX_${LIB} AND WX_${LIB}d) + DBG_MSG_V("Found ${LIB} and ${LIB}d") + list(APPEND wxWidgets_LIBRARIES + debug ${WX_${LIB}d} optimized ${WX_${LIB}} + ) + else() + DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") + set(wxWidgets_FOUND FALSE) + endif() + endforeach() + else() + foreach(LIB ${${_LIBS}}) + DBG_MSG_V("Searching for ${LIB}${_DBG}") + DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}") + if(WX_${LIB}${_DBG}) + DBG_MSG_V("Found ${LIB}${_DBG}") + list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}}) + else() + DBG_MSG_V( + "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") + set(wxWidgets_FOUND FALSE) + endif() + endforeach() + endif() + + DBG_MSG_V("OpenGL") + list(FIND ${_LIBS} gl WX_USE_GL) + if(NOT WX_USE_GL EQUAL -1) + DBG_MSG_V("- is required.") + list(APPEND wxWidgets_LIBRARIES opengl32 glu32) + endif() + + list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32) + endmacro() + + #------------------------------------------------------------------- + # WIN32: Start actual work. + #------------------------------------------------------------------- + + # Look for an installation tree. + find_path(wxWidgets_ROOT_DIR + NAMES include/wx/wx.h + PATHS + ENV wxWidgets_ROOT_DIR + ENV WXWIN + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x + C:/ + D:/ + ENV ProgramFiles + PATH_SUFFIXES + wxWidgets-3.0.0 + wxWidgets-2.9.5 + wxWidgets-2.9.4 + wxWidgets-2.9.3 + wxWidgets-2.9.2 + wxWidgets-2.9.1 + wxWidgets-2.9.0 + wxWidgets-2.8.9 + wxWidgets-2.8.8 + wxWidgets-2.8.7 + wxWidgets-2.8.6 + wxWidgets-2.8.5 + wxWidgets-2.8.4 + wxWidgets-2.8.3 + wxWidgets-2.8.2 + wxWidgets-2.8.1 + wxWidgets-2.8.0 + wxWidgets-2.7.4 + wxWidgets-2.7.3 + wxWidgets-2.7.2 + wxWidgets-2.7.1 + wxWidgets-2.7.0 + wxWidgets-2.7.0-1 + wxWidgets-2.6.4 + wxWidgets-2.6.3 + wxWidgets-2.6.2 + wxWidgets-2.6.1 + wxWidgets-2.5.4 + wxWidgets-2.5.3 + wxWidgets-2.5.2 + wxWidgets-2.5.1 + wxWidgets + DOC "wxWidgets base/installation directory" + ) + + # If wxWidgets_ROOT_DIR changed, clear lib dir. + if(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) + set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR} + CACHE INTERNAL "wxWidgets_ROOT_DIR") + set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND" + CACHE PATH "Cleared." FORCE) + endif() + + if(WX_ROOT_DIR) + # Select one default tree inside the already determined wx tree. + # Prefer static/shared order usually consistent with build + # settings. + if(MINGW) + set(WX_LIB_DIR_PREFIX gcc) + elseif(CMAKE_CL_64) + set(WX_LIB_DIR_PREFIX vc_x64) + else() + set(WX_LIB_DIR_PREFIX vc) + endif() + if(BUILD_SHARED_LIBS) + find_path(wxWidgets_LIB_DIR + NAMES + msw/wx/setup.h + mswd/wx/setup.h + mswu/wx/setup.h + mswud/wx/setup.h + mswuniv/wx/setup.h + mswunivd/wx/setup.h + mswunivu/wx/setup.h + mswunivud/wx/setup.h + PATHS + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll # prefer shared + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib + DOC "Path to wxWidgets libraries" + NO_DEFAULT_PATH + ) + else() + find_path(wxWidgets_LIB_DIR + NAMES + msw/wx/setup.h + mswd/wx/setup.h + mswu/wx/setup.h + mswud/wx/setup.h + mswuniv/wx/setup.h + mswunivd/wx/setup.h + mswunivu/wx/setup.h + mswunivud/wx/setup.h + PATHS + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib # prefer static + ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll + DOC "Path to wxWidgets libraries" + NO_DEFAULT_PATH + ) + endif() + + # If wxWidgets_LIB_DIR changed, clear all libraries. + if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) + set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR") + WX_CLEAR_ALL_DBG_LIBS() + WX_CLEAR_ALL_REL_LIBS() + endif() + + if(WX_LIB_DIR) + # If building shared libs, define WXUSINGDLL to use dllimport. + if(WX_LIB_DIR MATCHES "[dD][lL][lL]") + set(wxWidgets_DEFINITIONS WXUSINGDLL) + DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") + endif() + + # Search for available configuration types. + foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw) + set(WX_${CFG}_FOUND FALSE) + if(EXISTS ${WX_LIB_DIR}/${CFG}) + list(APPEND WX_CONFIGURATION_LIST ${CFG}) + set(WX_${CFG}_FOUND TRUE) + set(WX_CONFIGURATION ${CFG}) + endif() + endforeach() + DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}") + + if(WX_CONFIGURATION) + set(wxWidgets_FOUND TRUE) + + # If the selected configuration wasn't found force the default + # one. Otherwise, use it but still force a refresh for + # updating the doc string with the current list of available + # configurations. + if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) + set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING + "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) + else() + set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING + "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) + endif() + + # If release config selected, and both release/debug exist. + if(WX_${wxWidgets_CONFIGURATION}d_FOUND) + option(wxWidgets_USE_REL_AND_DBG + "Use release and debug configurations?" TRUE) + set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG}) + else() + # If the option exists (already in cache), force it false. + if(wxWidgets_USE_REL_AND_DBG) + set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL + "No ${wxWidgets_CONFIGURATION}d found." FORCE) + endif() + set(WX_USE_REL_AND_DBG FALSE) + endif() + + # Get configuration parameters from the name. + WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) + + # Set wxWidgets lib setup include directory. + if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + set(wxWidgets_INCLUDE_DIRS + ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) + else() + DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") + set(wxWidgets_FOUND FALSE) + endif() + + # Set wxWidgets main include directory. + if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) + list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) + else() + DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h") + set(wxWidgets_FOUND FALSE) + endif() + + # Find wxWidgets libraries. + WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") + if(WX_USE_REL_AND_DBG) + WX_FIND_LIBS("${UNV}" "${UCD}" "d") + endif() + + # Settings for requested libs (i.e., include dir, libraries, etc.). + WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}") + + # Add necessary definitions for unicode builds + if("${UCD}" STREQUAL "u") + list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE) + endif() + + # Add necessary definitions for debug builds + set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__) + + endif() + endif() + endif() + +#===================================================================== +# UNIX_FIND_STYLE +#===================================================================== +else() + if(wxWidgets_FIND_STYLE STREQUAL "unix") + #----------------------------------------------------------------- + # UNIX: Helper MACROS + #----------------------------------------------------------------- + # + # Set the default values based on "wx-config --selected-config". + # + macro(WX_CONFIG_SELECT_GET_DEFAULT) + execute_process( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --selected-config + OUTPUT_VARIABLE _wx_selected_config + RESULT_VARIABLE _wx_result + ERROR_QUIET + ) + if(_wx_result EQUAL 0) + foreach(_opt_name debug static unicode universal) + string(TOUPPER ${_opt_name} _upper_opt_name) + if(_wx_selected_config MATCHES "${_opt_name}") + set(wxWidgets_DEFAULT_${_upper_opt_name} ON) + else() + set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) + endif() + endforeach() + else() + foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL) + set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) + endforeach() + endif() + endmacro() + + # + # Query a boolean configuration option to determine if the system + # has both builds available. If so, provide the selection option + # to the user. + # + macro(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP) + execute_process( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes + RESULT_VARIABLE _wx_result_yes + OUTPUT_QUIET + ERROR_QUIET + ) + execute_process( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no + RESULT_VARIABLE _wx_result_no + OUTPUT_QUIET + ERROR_QUIET + ) + string(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME) + if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) + option(wxWidgets_USE_${_UPPER_OPT_NAME} + ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}}) + else() + # If option exists (already in cache), force to available one. + if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME}) + if(_wx_result_yes EQUAL 0) + set(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE) + else() + set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE) + endif() + endif() + endif() + endmacro() + + # + # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting + # among multiple builds. + # + macro(WX_CONFIG_SELECT_SET_OPTIONS) + set(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS}) + foreach(_opt_name debug static unicode universal) + string(TOUPPER ${_opt_name} _upper_opt_name) + if(DEFINED wxWidgets_USE_${_upper_opt_name}) + if(wxWidgets_USE_${_upper_opt_name}) + list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes) + else() + list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no) + endif() + endif() + endforeach() + endmacro() + + #----------------------------------------------------------------- + # UNIX: Start actual work. + #----------------------------------------------------------------- + # Support cross-compiling, only search in the target platform. + find_program(wxWidgets_CONFIG_EXECUTABLE wx-config + DOC "Location of wxWidgets library configuration provider binary (wx-config)." + ONLY_CMAKE_FIND_ROOT_PATH + ) + + if(wxWidgets_CONFIG_EXECUTABLE) + set(wxWidgets_FOUND TRUE) + + # get defaults based on "wx-config --selected-config" + WX_CONFIG_SELECT_GET_DEFAULT() + + # for each option: if both builds are available, provide option + WX_CONFIG_SELECT_QUERY_BOOL(debug "Use debug build?") + WX_CONFIG_SELECT_QUERY_BOOL(unicode "Use unicode build?") + WX_CONFIG_SELECT_QUERY_BOOL(universal "Use universal build?") + WX_CONFIG_SELECT_QUERY_BOOL(static "Link libraries statically?") + + # process selection to set wxWidgets_SELECT_OPTIONS + WX_CONFIG_SELECT_SET_OPTIONS() + DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}") + + # run the wx-config program to get cxxflags + execute_process( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_SELECT_OPTIONS} --cxxflags + OUTPUT_VARIABLE wxWidgets_CXX_FLAGS + RESULT_VARIABLE RET + ERROR_QUIET + ) + if(RET EQUAL 0) + string(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS) + separate_arguments(wxWidgets_CXX_FLAGS) + + DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") + + # parse definitions from cxxflags; + # drop -D* from CXXFLAGS and the -D prefix + string(REGEX MATCHALL "-D[^;]+" + wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}") + string(REGEX REPLACE "-D[^;]+(;|$)" "" + wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") + string(REGEX REPLACE ";$" "" + wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") + string(REPLACE "-D" "" + wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}") + + # parse include dirs from cxxflags; drop -I prefix + string(REGEX MATCHALL "-I[^;]+" + wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}") + string(REGEX REPLACE "-I[^;]+;" "" + wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") + string(REPLACE "-I" "" + wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") + + DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}") + DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") + DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") + + else() + set(wxWidgets_FOUND FALSE) + DBG_MSG_V( + "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}") + endif() + + # run the wx-config program to get the libs + # - NOTE: wx-config doesn't verify that the libs requested exist + # it just produces the names. Maybe a TRY_COMPILE would + # be useful here... + string(REPLACE ";" "," + wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}") + execute_process( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS} + OUTPUT_VARIABLE wxWidgets_LIBRARIES + RESULT_VARIABLE RET + ERROR_QUIET + ) + if(RET EQUAL 0) + string(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES) + separate_arguments(wxWidgets_LIBRARIES) + string(REPLACE "-framework;" "-framework " + wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") + string(REPLACE "-arch;" "-arch " + wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") + string(REPLACE "-isysroot;" "-isysroot " + wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") + + # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES) + string(REGEX MATCHALL "-L[^;]+" + wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}") + string(REPLACE "-L" "" + wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}") + + DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}") + DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}") + + else() + set(wxWidgets_FOUND FALSE) + DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}") + endif() + endif() + +#===================================================================== +# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE +#===================================================================== + else() + if(NOT wxWidgets_FIND_QUIETLY) + message(STATUS + "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n" + " Platform unknown/unsupported. It's neither WIN32 nor UNIX " + "find style." + ) + endif() + endif() +endif() + +# Debug output: +DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}") +DBG_MSG("wxWidgets_INCLUDE_DIRS : ${wxWidgets_INCLUDE_DIRS}") +DBG_MSG("wxWidgets_LIBRARY_DIRS : ${wxWidgets_LIBRARY_DIRS}") +DBG_MSG("wxWidgets_LIBRARIES : ${wxWidgets_LIBRARIES}") +DBG_MSG("wxWidgets_CXX_FLAGS : ${wxWidgets_CXX_FLAGS}") +DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}") + +#===================================================================== +#===================================================================== +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND) +# Maintain consistency with all other variables. +set(wxWidgets_FOUND ${WXWIDGETS_FOUND}) + +#===================================================================== +# Macros for use in wxWidgets apps. +# - This module will not fail to find wxWidgets based on the code +# below. Hence, it's required to check for validity of: +# +# wxWidgets_wxrc_EXECUTABLE +#===================================================================== + +# Resource file compiler. +find_program(wxWidgets_wxrc_EXECUTABLE wxrc + ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw + DOC "Location of wxWidgets resource file compiler binary (wxrc)" + ) + +# +# WX_SPLIT_ARGUMENTS_ON( ...) +# +# Sets and to contain arguments to the left and right, +# respectively, of . +# +# Example usage: +# function(WXWIDGETS_ADD_RESOURCES outfiles) +# WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN}) +# ... +# endfunction() +# +# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C) +# +# NOTE: This is a generic piece of code that should be renamed to +# SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as +# FindPackageStandardArgs.cmake. At the time of this writing +# FindQt4.cmake has a QT4_EXTRACT_OPTIONS, which I basically copied +# here a bit more generalized. So, there are already two find modules +# using this approach. +# +function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar) + # FIXME: Document that the input variables will be cleared. + #list(APPEND ${_leftvar} "") + #list(APPEND ${_rightvar} "") + set(${_leftvar} "") + set(${_rightvar} "") + + set(_doing_right FALSE) + foreach(element ${ARGN}) + if("${element}" STREQUAL "${_keyword}") + set(_doing_right TRUE) + else() + if(_doing_right) + list(APPEND ${_rightvar} "${element}") + else() + list(APPEND ${_leftvar} "${element}") + endif() + endif() + endforeach() + + set(${_leftvar} ${${_leftvar}} PARENT_SCOPE) + set(${_rightvar} ${${_rightvar}} PARENT_SCOPE) +endfunction() + +# +# WX_GET_DEPENDENCIES_FROM_XML( +# +# +# +# +# +# ) +# +# FIXME: Add documentation here... +# +function(WX_GET_DEPENDENCIES_FROM_XML + _depends + _match_patt + _clean_patt + _xml_contents + _depends_path + ) + + string(REGEX MATCHALL + ${_match_patt} + dep_file_list + "${${_xml_contents}}" + ) + foreach(dep_file ${dep_file_list}) + string(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}") + + # make the file have an absolute path + if(NOT IS_ABSOLUTE "${dep_file}") + set(dep_file "${${_depends_path}}/${dep_file}") + endif() + + # append file to dependency list + list(APPEND ${_depends} "${dep_file}") + endforeach() + + set(${_depends} ${${_depends}} PARENT_SCOPE) +endfunction() + +# +# WXWIDGETS_ADD_RESOURCES( +# OPTIONS [NO_CPP_CODE]) +# +# Adds a custom command for resource file compilation of the +# and appends the output files to . +# +# Example usages: +# WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc) +# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx) +# +function(WXWIDGETS_ADD_RESOURCES _outfiles) + WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN}) + + # Parse files for dependencies. + set(rc_file_list_abs "") + set(rc_depends "") + foreach(rc_file ${rc_file_list}) + get_filename_component(depends_path ${rc_file} PATH) + + get_filename_component(rc_file_abs ${rc_file} ABSOLUTE) + list(APPEND rc_file_list_abs "${rc_file_abs}") + + # All files have absolute paths or paths relative to the location + # of the rc file. + file(READ "${rc_file_abs}" rc_file_contents) + + # get bitmap/bitmap2 files + WX_GET_DEPENDENCIES_FROM_XML( + rc_depends + "]*>" + rc_file_contents + depends_path + ) + + # get url files + WX_GET_DEPENDENCIES_FROM_XML( + rc_depends + "]*>" + rc_file_contents + depends_path + ) + + # get wxIcon files + WX_GET_DEPENDENCIES_FROM_XML( + rc_depends + "]*class=\"wxIcon\"[^<]+" + "^]*>" + rc_file_contents + depends_path + ) + endforeach() + + # + # Parse options. + # + # If NO_CPP_CODE option specified, then produce .xrs file rather + # than a .cpp file (i.e., don't add the default --cpp-code option). + list(FIND rc_options NO_CPP_CODE index) + if(index EQUAL -1) + list(APPEND rc_options --cpp-code) + # wxrc's default output filename for cpp code. + set(outfile resource.cpp) + else() + list(REMOVE_AT rc_options ${index}) + # wxrc's default output filename for xrs file. + set(outfile resource.xrs) + endif() + + # Get output name for use in ADD_CUSTOM_COMMAND. + # - short option scanning + list(FIND rc_options -o index) + if(NOT index EQUAL -1) + math(EXPR filename_index "${index} + 1") + list(GET rc_options ${filename_index} outfile) + #list(REMOVE_AT rc_options ${index} ${filename_index}) + endif() + # - long option scanning + string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}") + if(outfile_opt) + string(REPLACE "--output=" "" outfile "${outfile_opt}") + endif() + #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}") + #string(REGEX REPLACE ";$" "" rc_options "${rc_options}") + + if(NOT IS_ABSOLUTE "${outfile}") + set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + endif() + add_custom_command( + OUTPUT "${outfile}" + COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs} + DEPENDS ${rc_file_list_abs} ${rc_depends} + ) + + # Add generated header to output file list. + list(FIND rc_options -e short_index) + list(FIND rc_options --extra-cpp-code long_index) + if(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1) + get_filename_component(outfile_ext ${outfile} EXT) + string(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}") + list(APPEND ${_outfiles} "${outfile_header}") + set_source_files_properties( + "${outfile_header}" PROPERTIES GENERATED TRUE + ) + endif() + + # Add generated file to output file list. + list(APPEND ${_outfiles} "${outfile}") + + set(${_outfiles} ${${_outfiles}} PARENT_SCOPE) +endfunction() diff --git a/external/portaudio/include/pa_allocation.h b/external/portaudio/include/pa_allocation.h deleted file mode 100644 index 811dd72..0000000 --- a/external/portaudio/include/pa_allocation.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef PA_ALLOCATION_H -#define PA_ALLOCATION_H -/* - * $Id: pa_allocation.h 1339 2008-02-15 07:50:33Z rossb $ - * Portable Audio I/O Library allocation context header - * memory allocation context for tracking allocation groups - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2008 Ross Bencina, Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Allocation Group prototypes. An Allocation Group makes it easy to - allocate multiple blocks of memory and free them all at once. - - An allocation group is useful for keeping track of multiple blocks - of memory which are allocated at the same time (such as during initialization) - and need to be deallocated at the same time. The allocation group maintains - a list of allocated blocks, and can free all allocations at once. This - can be usefull for cleaning up after a partially initialized object fails. - - The allocation group implementation is built on top of the lower - level allocation functions defined in pa_util.h -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -typedef struct -{ - long linkCount; - struct PaUtilAllocationGroupLink *linkBlocks; - struct PaUtilAllocationGroupLink *spareLinks; - struct PaUtilAllocationGroupLink *allocations; -}PaUtilAllocationGroup; - - - -/** Create an allocation group. -*/ -PaUtilAllocationGroup* PaUtil_CreateAllocationGroup( void ); - -/** Destroy an allocation group, but not the memory allocated through the group. -*/ -void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group ); - -/** Allocate a block of memory though an allocation group. -*/ -void* PaUtil_GroupAllocateMemory( PaUtilAllocationGroup* group, long size ); - -/** Free a block of memory that was previously allocated though an allocation - group. Calling this function is a relatively time consuming operation. - Under normal circumstances clients should call PaUtil_FreeAllAllocations to - free all allocated blocks simultaneously. - @see PaUtil_FreeAllAllocations -*/ -void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer ); - -/** Free all blocks of memory which have been allocated through the allocation - group. This function doesn't destroy the group itself. -*/ -void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group ); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_ALLOCATION_H */ diff --git a/external/portaudio/include/pa_converters.h b/external/portaudio/include/pa_converters.h deleted file mode 100644 index 7ddfcaa..0000000 --- a/external/portaudio/include/pa_converters.h +++ /dev/null @@ -1,263 +0,0 @@ -#ifndef PA_CONVERTERS_H -#define PA_CONVERTERS_H -/* - * $Id: pa_converters.h 1097 2006-08-26 08:27:53Z rossb $ - * Portable Audio I/O Library sample conversion mechanism - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Conversion functions used to convert buffers of samples from one - format to another. -*/ - - -#include "portaudio.h" /* for PaSampleFormat */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -struct PaUtilTriangularDitherGenerator; - - -/** Choose an available sample format which is most appropriate for - representing the requested format. If the requested format is not available - higher quality formats are considered before lower quality formates. - @param availableFormats A variable containing the logical OR of all available - formats. - @param format The desired format. - @return The most appropriate available format for representing the requested - format. -*/ -PaSampleFormat PaUtil_SelectClosestAvailableFormat( - PaSampleFormat availableFormats, PaSampleFormat format ); - - -/* high level conversions functions for use by implementations */ - - -/** The generic sample converter prototype. Sample converters convert count - samples from sourceBuffer to destinationBuffer. The actual type of the data - pointed to by these parameters varys for different converter functions. - @param destinationBuffer A pointer to the first sample of the destination. - @param destinationStride An offset between successive destination samples - expressed in samples (not bytes.) It may be negative. - @param sourceBuffer A pointer to the first sample of the source. - @param sourceStride An offset between successive source samples - expressed in samples (not bytes.) It may be negative. - @param count The number of samples to convert. - @param ditherState State information used to calculate dither. Converters - that do not perform dithering will ignore this parameter, in which case - NULL or invalid dither state may be passed. -*/ -typedef void PaUtilConverter( - void *destinationBuffer, signed int destinationStride, - void *sourceBuffer, signed int sourceStride, - unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ); - - -/** Find a sample converter function for the given source and destinations - formats and flags (clip and dither.) - @return - A pointer to a PaUtilConverter which will perform the requested - conversion, or NULL if the given format conversion is not supported. - For conversions where clipping or dithering is not necessary, the - clip and dither flags are ignored and a non-clipping or dithering - version is returned. - If the source and destination formats are the same, a function which - copies data of the appropriate size will be returned. -*/ -PaUtilConverter* PaUtil_SelectConverter( PaSampleFormat sourceFormat, - PaSampleFormat destinationFormat, PaStreamFlags flags ); - - -/** The generic buffer zeroer prototype. Buffer zeroers copy count zeros to - destinationBuffer. The actual type of the data pointed to varys for - different zeroer functions. - @param destinationBuffer A pointer to the first sample of the destination. - @param destinationStride An offset between successive destination samples - expressed in samples (not bytes.) It may be negative. - @param count The number of samples to zero. -*/ -typedef void PaUtilZeroer( - void *destinationBuffer, signed int destinationStride, unsigned int count ); - - -/** Find a buffer zeroer function for the given destination format. - @return - A pointer to a PaUtilZeroer which will perform the requested - zeroing. -*/ -PaUtilZeroer* PaUtil_SelectZeroer( PaSampleFormat destinationFormat ); - -/*----------------------------------------------------------------------------*/ -/* low level functions and data structures which may be used for - substituting conversion functions */ - - -/** The type used to store all sample conversion functions. - @see paConverters; -*/ -typedef struct{ - PaUtilConverter *Float32_To_Int32; - PaUtilConverter *Float32_To_Int32_Dither; - PaUtilConverter *Float32_To_Int32_Clip; - PaUtilConverter *Float32_To_Int32_DitherClip; - - PaUtilConverter *Float32_To_Int24; - PaUtilConverter *Float32_To_Int24_Dither; - PaUtilConverter *Float32_To_Int24_Clip; - PaUtilConverter *Float32_To_Int24_DitherClip; - - PaUtilConverter *Float32_To_Int16; - PaUtilConverter *Float32_To_Int16_Dither; - PaUtilConverter *Float32_To_Int16_Clip; - PaUtilConverter *Float32_To_Int16_DitherClip; - - PaUtilConverter *Float32_To_Int8; - PaUtilConverter *Float32_To_Int8_Dither; - PaUtilConverter *Float32_To_Int8_Clip; - PaUtilConverter *Float32_To_Int8_DitherClip; - - PaUtilConverter *Float32_To_UInt8; - PaUtilConverter *Float32_To_UInt8_Dither; - PaUtilConverter *Float32_To_UInt8_Clip; - PaUtilConverter *Float32_To_UInt8_DitherClip; - - PaUtilConverter *Int32_To_Float32; - PaUtilConverter *Int32_To_Int24; - PaUtilConverter *Int32_To_Int24_Dither; - PaUtilConverter *Int32_To_Int16; - PaUtilConverter *Int32_To_Int16_Dither; - PaUtilConverter *Int32_To_Int8; - PaUtilConverter *Int32_To_Int8_Dither; - PaUtilConverter *Int32_To_UInt8; - PaUtilConverter *Int32_To_UInt8_Dither; - - PaUtilConverter *Int24_To_Float32; - PaUtilConverter *Int24_To_Int32; - PaUtilConverter *Int24_To_Int16; - PaUtilConverter *Int24_To_Int16_Dither; - PaUtilConverter *Int24_To_Int8; - PaUtilConverter *Int24_To_Int8_Dither; - PaUtilConverter *Int24_To_UInt8; - PaUtilConverter *Int24_To_UInt8_Dither; - - PaUtilConverter *Int16_To_Float32; - PaUtilConverter *Int16_To_Int32; - PaUtilConverter *Int16_To_Int24; - PaUtilConverter *Int16_To_Int8; - PaUtilConverter *Int16_To_Int8_Dither; - PaUtilConverter *Int16_To_UInt8; - PaUtilConverter *Int16_To_UInt8_Dither; - - PaUtilConverter *Int8_To_Float32; - PaUtilConverter *Int8_To_Int32; - PaUtilConverter *Int8_To_Int24; - PaUtilConverter *Int8_To_Int16; - PaUtilConverter *Int8_To_UInt8; - - PaUtilConverter *UInt8_To_Float32; - PaUtilConverter *UInt8_To_Int32; - PaUtilConverter *UInt8_To_Int24; - PaUtilConverter *UInt8_To_Int16; - PaUtilConverter *UInt8_To_Int8; - - PaUtilConverter *Copy_8_To_8; /* copy without any conversion */ - PaUtilConverter *Copy_16_To_16; /* copy without any conversion */ - PaUtilConverter *Copy_24_To_24; /* copy without any conversion */ - PaUtilConverter *Copy_32_To_32; /* copy without any conversion */ -} PaUtilConverterTable; - - -/** A table of pointers to all required converter functions. - PaUtil_SelectConverter() uses this table to lookup the appropriate - conversion functions. The fields of this structure are initialized - with default conversion functions. Fields may be NULL, indicating that - no conversion function is available. User code may substitue optimised - conversion functions by assigning different function pointers to - these fields. - - @note - If the PA_NO_STANDARD_CONVERTERS preprocessor variable is defined, - PortAudio's standard converters will not be compiled, and all fields - of this structure will be initialized to NULL. In such cases, users - should supply their own conversion functions if the require PortAudio - to open a stream that requires sample conversion. - - @see PaUtilConverterTable, PaUtilConverter, PaUtil_SelectConverter -*/ -extern PaUtilConverterTable paConverters; - - -/** The type used to store all buffer zeroing functions. - @see paZeroers; -*/ -typedef struct{ - PaUtilZeroer *ZeroU8; /* unsigned 8 bit, zero == 128 */ - PaUtilZeroer *Zero8; - PaUtilZeroer *Zero16; - PaUtilZeroer *Zero24; - PaUtilZeroer *Zero32; -} PaUtilZeroerTable; - - -/** A table of pointers to all required zeroer functions. - PaUtil_SelectZeroer() uses this table to lookup the appropriate - conversion functions. The fields of this structure are initialized - with default conversion functions. User code may substitue optimised - conversion functions by assigning different function pointers to - these fields. - - @note - If the PA_NO_STANDARD_ZEROERS preprocessor variable is defined, - PortAudio's standard zeroers will not be compiled, and all fields - of this structure will be initialized to NULL. In such cases, users - should supply their own zeroing functions for the sample sizes which - they intend to use. - - @see PaUtilZeroerTable, PaUtilZeroer, PaUtil_SelectZeroer -*/ -extern PaUtilZeroerTable paZeroers; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_CONVERTERS_H */ diff --git a/external/portaudio/include/pa_cpuload.h b/external/portaudio/include/pa_cpuload.h deleted file mode 100644 index 4a59443..0000000 --- a/external/portaudio/include/pa_cpuload.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef PA_CPULOAD_H -#define PA_CPULOAD_H -/* - * $Id: pa_cpuload.h 1097 2006-08-26 08:27:53Z rossb $ - * Portable Audio I/O Library CPU Load measurement functions - * Portable CPU load measurement facility. - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 2002 Ross Bencina - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Functions to assist in measuring the CPU utilization of a callback - stream. Used to implement the Pa_GetStreamCpuLoad() function. -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -typedef struct { - double samplingPeriod; - double measurementStartTime; - double averageLoad; -} PaUtilCpuLoadMeasurer; /**< @todo need better name than measurer */ - -void PaUtil_InitializeCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer, double sampleRate ); -void PaUtil_BeginCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer ); -void PaUtil_EndCpuLoadMeasurement( PaUtilCpuLoadMeasurer* measurer, unsigned long framesProcessed ); -void PaUtil_ResetCpuLoadMeasurer( PaUtilCpuLoadMeasurer* measurer ); -double PaUtil_GetCpuLoad( PaUtilCpuLoadMeasurer* measurer ); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_CPULOAD_H */ diff --git a/external/portaudio/include/pa_debugprint.h b/external/portaudio/include/pa_debugprint.h deleted file mode 100644 index 5fba766..0000000 --- a/external/portaudio/include/pa_debugprint.h +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef PA_LOG_H -#define PA_LOG_H -/* - * Log file redirector function - * Copyright (c) 1999-2006 Ross Bencina, Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - - -void PaUtil_DebugPrint( const char *format, ... ); - - -/* - The basic format for log messages is described below. If you need to - add any log messages, please follow this format. - - Function entry (void function): - - "FunctionName called.\n" - - Function entry (non void function): - - "FunctionName called:\n" - "\tParam1Type param1: param1Value\n" - "\tParam2Type param2: param2Value\n" (etc...) - - - Function exit (no return value): - - "FunctionName returned.\n" - - Function exit (simple return value): - - "FunctionName returned:\n" - "\tReturnType: returnValue\n" - - If the return type is an error code, the error text is displayed in () - - If the return type is not an error code, but has taken a special value - because an error occurred, then the reason for the error is shown in [] - - If the return type is a struct ptr, the struct is dumped. - - See the code below for examples -*/ - -/** PA_DEBUG() provides a simple debug message printing facility. The macro - passes it's argument to a printf-like function called PaUtil_DebugPrint() - which prints to stderr and always flushes the stream after printing. - Because preprocessor macros cannot directly accept variable length argument - lists, calls to the macro must include an additional set of parenthesis, eg: - PA_DEBUG(("errorno: %d", 1001 )); -*/ - - -#ifdef PA_ENABLE_DEBUG_OUTPUT -#define PA_DEBUG(x) PaUtil_DebugPrint x ; -#else -#define PA_DEBUG(x) -#endif - - -#ifdef PA_LOG_API_CALLS -#define PA_LOGAPI(x) PaUtil_DebugPrint x - -#define PA_LOGAPI_ENTER(functionName) PaUtil_DebugPrint( functionName " called.\n" ) - -#define PA_LOGAPI_ENTER_PARAMS(functionName) PaUtil_DebugPrint( functionName " called:\n" ) - -#define PA_LOGAPI_EXIT(functionName) PaUtil_DebugPrint( functionName " returned.\n" ) - -#define PA_LOGAPI_EXIT_PAERROR( functionName, result ) \ - PaUtil_DebugPrint( functionName " returned:\n" ); \ - PaUtil_DebugPrint("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) ) - -#define PA_LOGAPI_EXIT_T( functionName, resultFormatString, result ) \ - PaUtil_DebugPrint( functionName " returned:\n" ); \ - PaUtil_DebugPrint("\t" resultFormatString "\n", result ) - -#define PA_LOGAPI_EXIT_PAERROR_OR_T_RESULT( functionName, positiveResultFormatString, result ) \ - PaUtil_DebugPrint( functionName " returned:\n" ); \ - if( result > 0 ) \ - PaUtil_DebugPrint("\t" positiveResultFormatString "\n", result ); \ - else \ - PaUtil_DebugPrint("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) ) -#else -#define PA_LOGAPI(x) -#define PA_LOGAPI_ENTER(functionName) -#define PA_LOGAPI_ENTER_PARAMS(functionName) -#define PA_LOGAPI_EXIT(functionName) -#define PA_LOGAPI_EXIT_PAERROR( functionName, result ) -#define PA_LOGAPI_EXIT_T( functionName, resultFormatString, result ) -#define PA_LOGAPI_EXIT_PAERROR_OR_T_RESULT( functionName, positiveResultFormatString, result ) -#endif - - -typedef void (*PaUtilLogCallback ) (const char *log); - -/** - Install user provided log function -*/ -void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_LOG_H */ diff --git a/external/portaudio/include/pa_dither.h b/external/portaudio/include/pa_dither.h deleted file mode 100644 index a5131b2..0000000 --- a/external/portaudio/include/pa_dither.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef PA_DITHER_H -#define PA_DITHER_H -/* - * $Id: pa_dither.h 1418 2009-10-12 21:00:53Z philburk $ - * Portable Audio I/O Library triangular dither generator - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Functions for generating dither noise -*/ - -#include "pa_types.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* Note that the linear congruential algorithm requires 32 bit integers - * because it uses arithmetic overflow. So use PaUint32 instead of - * unsigned long so it will work on 64 bit systems. - */ - -/** @brief State needed to generate a dither signal */ -typedef struct PaUtilTriangularDitherGenerator{ - PaUint32 previous; - PaUint32 randSeed1; - PaUint32 randSeed2; -} PaUtilTriangularDitherGenerator; - - -/** @brief Initialize dither state */ -void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *ditherState ); - - -/** - @brief Calculate 2 LSB dither signal with a triangular distribution. - Ranged for adding to a 1 bit right-shifted 32 bit integer - prior to >>15. eg: -
-    signed long in = *
-    signed long dither = PaUtil_Generate16BitTriangularDither( ditherState );
-    signed short out = (signed short)(((in>>1) + dither) >> 15);
-
- @return - A signed 32-bit integer with a range of +32767 to -32768 -*/ -PaInt32 PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); - - -/** - @brief Calculate 2 LSB dither signal with a triangular distribution. - Ranged for adding to a pre-scaled float. -
-    float in = *
-    float dither = PaUtil_GenerateFloatTriangularDither( ditherState );
-    // use smaller scaler to prevent overflow when we add the dither
-    signed short out = (signed short)(in*(32766.0f) + dither );
-
- @return - A float with a range of -2.0 to +1.99999. -*/ -float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_DITHER_H */ diff --git a/external/portaudio/include/pa_endianness.h b/external/portaudio/include/pa_endianness.h deleted file mode 100644 index 84e904c..0000000 --- a/external/portaudio/include/pa_endianness.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef PA_ENDIANNESS_H -#define PA_ENDIANNESS_H -/* - * $Id: pa_endianness.h 1324 2008-01-27 02:03:30Z bjornroche $ - * Portable Audio I/O Library current platform endianness macros - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Configure endianness symbols for the target processor. - - Arrange for either the PA_LITTLE_ENDIAN or PA_BIG_ENDIAN preprocessor symbols - to be defined. The one that is defined reflects the endianness of the target - platform and may be used to implement conditional compilation of byte-order - dependent code. - - If either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN is defined already, then no attempt - is made to override that setting. This may be useful if you have a better way - of determining the platform's endianness. The autoconf mechanism uses this for - example. - - A PA_VALIDATE_ENDIANNESS macro is provided to compare the compile time - and runtime endiannes and raise an assertion if they don't match. -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* If this is an apple, we need to do detect endianness this way */ -#if defined(__APPLE__) - /* we need to do some endian detection that is sensitive to harware arch */ - #if defined(__LITTLE_ENDIAN__) - #if !defined( PA_LITTLE_ENDIAN ) - #define PA_LITTLE_ENDIAN - #endif - #if defined( PA_BIG_ENDIAN ) - #undef PA_BIG_ENDIAN - #endif - #else - #if !defined( PA_BIG_ENDIAN ) - #define PA_BIG_ENDIAN - #endif - #if defined( PA_LITTLE_ENDIAN ) - #undef PA_LITTLE_ENDIAN - #endif - #endif -#else - /* this is not an apple, so first check the existing defines, and, failing that, - detect well-known architechtures. */ - - #if defined(PA_LITTLE_ENDIAN) || defined(PA_BIG_ENDIAN) - /* endianness define has been set externally, such as by autoconf */ - - #if defined(PA_LITTLE_ENDIAN) && defined(PA_BIG_ENDIAN) - #error both PA_LITTLE_ENDIAN and PA_BIG_ENDIAN have been defined externally to pa_endianness.h - only one endianness at a time please - #endif - - #else - /* endianness define has not been set externally */ - - /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */ - - #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(LITTLE_ENDIAN) || defined(__i386) || defined(_M_IX86) || defined(__x86_64__) - #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */ - #else - #define PA_BIG_ENDIAN - #endif - #endif - - #if !defined(PA_LITTLE_ENDIAN) && !defined(PA_BIG_ENDIAN) - /* - If the following error is raised, you either need to modify the code above - to automatically determine the endianness from other symbols defined on your - platform, or define either PA_LITTLE_ENDIAN or PA_BIG_ENDIAN externally. - */ - #error pa_endianness.h was unable to automatically determine the endianness of the target platform - #endif - -#endif - - -/* PA_VALIDATE_ENDIANNESS compares the compile time and runtime endianness, - and raises an assertion if they don't match. must be included in - the context in which this macro is used. -*/ -#if defined(NDEBUG) - #define PA_VALIDATE_ENDIANNESS -#else - #if defined(PA_LITTLE_ENDIAN) - #define PA_VALIDATE_ENDIANNESS \ - { \ - const long nativeOne = 1; \ - assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 1 ); \ - } - #elif defined(PA_BIG_ENDIAN) - #define PA_VALIDATE_ENDIANNESS \ - { \ - const long nativeOne = 1; \ - assert( "PortAudio: compile time and runtime endianness don't match" && (((char *)&nativeOne)[0]) == 0 ); \ - } - #endif -#endif - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_ENDIANNESS_H */ diff --git a/external/portaudio/include/pa_hostapi.h b/external/portaudio/include/pa_hostapi.h deleted file mode 100644 index d38b8fe..0000000 --- a/external/portaudio/include/pa_hostapi.h +++ /dev/null @@ -1,362 +0,0 @@ -#ifndef PA_HOSTAPI_H -#define PA_HOSTAPI_H -/* - * $Id: pa_hostapi.h 1880 2012-12-04 18:39:48Z rbencina $ - * Portable Audio I/O Library - * host api representation - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2008 Ross Bencina, Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Interfaces and representation structures used by pa_front.c - to manage and communicate with host API implementations. -*/ - -#include "portaudio.h" - -/** -The PA_NO_* host API macros are now deprecated in favor of PA_USE_* macros. -PA_USE_* indicates whether a particular host API will be initialized by PortAudio. -An undefined or 0 value indicates that the host API will not be used. A value of 1 -indicates that the host API will be used. PA_USE_* macros should be left undefined -or defined to either 0 or 1. - -The code below ensures that PA_USE_* macros are always defined and have value -0 or 1. Undefined symbols are defaulted to 0. Symbols that are neither 0 nor 1 -are defaulted to 1. -*/ - -#ifndef PA_USE_SKELETON -#define PA_USE_SKELETON 0 -#elif (PA_USE_SKELETON != 0) && (PA_USE_SKELETON != 1) -#undef PA_USE_SKELETON -#define PA_USE_SKELETON 1 -#endif - -#if defined(PA_NO_ASIO) || defined(PA_NO_DS) || defined(PA_NO_WMME) || defined(PA_NO_WASAPI) || defined(PA_NO_WDMKS) -#error "Portaudio: PA_NO_ is no longer supported, please remove definition and use PA_USE_ instead" -#endif - -#ifndef PA_USE_ASIO -#define PA_USE_ASIO 0 -#elif (PA_USE_ASIO != 0) && (PA_USE_ASIO != 1) -#undef PA_USE_ASIO -#define PA_USE_ASIO 1 -#endif - -#ifndef PA_USE_DS -#define PA_USE_DS 0 -#elif (PA_USE_DS != 0) && (PA_USE_DS != 1) -#undef PA_USE_DS -#define PA_USE_DS 1 -#endif - -#ifndef PA_USE_WMME -#define PA_USE_WMME 0 -#elif (PA_USE_WMME != 0) && (PA_USE_WMME != 1) -#undef PA_USE_WMME -#define PA_USE_WMME 1 -#endif - -#ifndef PA_USE_WASAPI -#define PA_USE_WASAPI 0 -#elif (PA_USE_WASAPI != 0) && (PA_USE_WASAPI != 1) -#undef PA_USE_WASAPI -#define PA_USE_WASAPI 1 -#endif - -#ifndef PA_USE_WDMKS -#define PA_USE_WDMKS 0 -#elif (PA_USE_WDMKS != 0) && (PA_USE_WDMKS != 1) -#undef PA_USE_WDMKS -#define PA_USE_WDMKS 1 -#endif - -/* Set default values for Unix based APIs. */ -#if defined(PA_NO_OSS) || defined(PA_NO_ALSA) || defined(PA_NO_JACK) || defined(PA_NO_COREAUDIO) || defined(PA_NO_SGI) || defined(PA_NO_ASIHPI) -#error "Portaudio: PA_NO_ is no longer supported, please remove definition and use PA_USE_ instead" -#endif - -#ifndef PA_USE_OSS -#define PA_USE_OSS 0 -#elif (PA_USE_OSS != 0) && (PA_USE_OSS != 1) -#undef PA_USE_OSS -#define PA_USE_OSS 1 -#endif - -#ifndef PA_USE_ALSA -#define PA_USE_ALSA 0 -#elif (PA_USE_ALSA != 0) && (PA_USE_ALSA != 1) -#undef PA_USE_ALSA -#define PA_USE_ALSA 1 -#endif - -#ifndef PA_USE_JACK -#define PA_USE_JACK 0 -#elif (PA_USE_JACK != 0) && (PA_USE_JACK != 1) -#undef PA_USE_JACK -#define PA_USE_JACK 1 -#endif - -#ifndef PA_USE_SGI -#define PA_USE_SGI 0 -#elif (PA_USE_SGI != 0) && (PA_USE_SGI != 1) -#undef PA_USE_SGI -#define PA_USE_SGI 1 -#endif - -#ifndef PA_USE_COREAUDIO -#define PA_USE_COREAUDIO 0 -#elif (PA_USE_COREAUDIO != 0) && (PA_USE_COREAUDIO != 1) -#undef PA_USE_COREAUDIO -#define PA_USE_COREAUDIO 1 -#endif - -#ifndef PA_USE_ASIHPI -#define PA_USE_ASIHPI 0 -#elif (PA_USE_ASIHPI != 0) && (PA_USE_ASIHPI != 1) -#undef PA_USE_ASIHPI -#define PA_USE_ASIHPI 1 -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** **FOR THE USE OF pa_front.c ONLY** - Do NOT use fields in this structure, they my change at any time. - Use functions defined in pa_util.h if you think you need functionality - which can be derived from here. -*/ -typedef struct PaUtilPrivatePaFrontHostApiInfo { - - - unsigned long baseDeviceIndex; -}PaUtilPrivatePaFrontHostApiInfo; - - -/** The common header for all data structures whose pointers are passed through - the hostApiSpecificStreamInfo field of the PaStreamParameters structure. - Note that in order to keep the public PortAudio interface clean, this structure - is not used explicitly when declaring hostApiSpecificStreamInfo data structures. - However, some code in pa_front depends on the first 3 members being equivalent - with this structure. - @see PaStreamParameters -*/ -typedef struct PaUtilHostApiSpecificStreamInfoHeader -{ - unsigned long size; /**< size of whole structure including this header */ - PaHostApiTypeId hostApiType; /**< host API for which this data is intended */ - unsigned long version; /**< structure version */ -} PaUtilHostApiSpecificStreamInfoHeader; - - - -/** A structure representing the interface to a host API. Contains both - concrete data and pointers to functions which implement the interface. -*/ -typedef struct PaUtilHostApiRepresentation { - PaUtilPrivatePaFrontHostApiInfo privatePaFrontInfo; - - /** The host api implementation should populate the info field. In the - case of info.defaultInputDevice and info.defaultOutputDevice the - values stored should be 0 based indices within the host api's own - device index range (0 to deviceCount). These values will be converted - to global device indices by pa_front after PaUtilHostApiInitializer() - returns. - */ - PaHostApiInfo info; - - PaDeviceInfo** deviceInfos; - - /** - (*Terminate)() is guaranteed to be called with a valid - parameter, which was previously returned from the same implementation's - initializer. - */ - void (*Terminate)( struct PaUtilHostApiRepresentation *hostApi ); - - /** - The inputParameters and outputParameters pointers should not be saved - as they will not remain valid after OpenStream is called. - - - The following guarantees are made about parameters to (*OpenStream)(): - - [NOTE: the following list up to *END PA FRONT VALIDATIONS* should be - kept in sync with the one for ValidateOpenStreamParameters and - Pa_OpenStream in pa_front.c] - - PaHostApiRepresentation *hostApi - - is valid for this implementation - - PaStream** stream - - is non-null - - - at least one of inputParameters & outputParmeters is valid (not NULL) - - - if inputParameters & outputParmeters are both valid, that - inputParameters->device & outputParmeters->device both use the same host api - - PaDeviceIndex inputParameters->device - - is within range (0 to Pa_CountDevices-1) Or: - - is paUseHostApiSpecificDeviceSpecification and - inputParameters->hostApiSpecificStreamInfo is non-NULL and refers - to a valid host api - - int inputParameters->numChannels - - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, numInputChannels is > 0 - - upper bound is NOT validated against device capabilities - - PaSampleFormat inputParameters->sampleFormat - - is one of the sample formats defined in portaudio.h - - void *inputParameters->hostApiSpecificStreamInfo - - if supplied its hostApi field matches the input device's host Api - - PaDeviceIndex outputParmeters->device - - is within range (0 to Pa_CountDevices-1) - - int outputParmeters->numChannels - - if inputDevice is valid, numInputChannels is > 0 - - upper bound is NOT validated against device capabilities - - PaSampleFormat outputParmeters->sampleFormat - - is one of the sample formats defined in portaudio.h - - void *outputParmeters->hostApiSpecificStreamInfo - - if supplied its hostApi field matches the output device's host Api - - double sampleRate - - is not an 'absurd' rate (less than 1000. or greater than 384000.) - - sampleRate is NOT validated against device capabilities - - PaStreamFlags streamFlags - - unused platform neutral flags are zero - - paNeverDropInput is only used for full-duplex callback streams - with variable buffer size (paFramesPerBufferUnspecified) - - [*END PA FRONT VALIDATIONS*] - - - The following validations MUST be performed by (*OpenStream)(): - - - check that input device can support numInputChannels - - - check that input device can support inputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - if inputStreamInfo is supplied, validate its contents, - or return an error if no inputStreamInfo is expected - - - check that output device can support numOutputChannels - - - check that output device can support outputSampleFormat, or that - we have the capability to convert from outputSampleFormat to - a native format - - - if outputStreamInfo is supplied, validate its contents, - or return an error if no outputStreamInfo is expected - - - if a full duplex stream is requested, check that the combination - of input and output parameters is supported - - - check that the device supports sampleRate - - - alter sampleRate to a close allowable rate if necessary - - - validate inputLatency and outputLatency - - - validate any platform specific flags, if flags are supplied they - must be valid. - */ - PaError (*OpenStream)( struct PaUtilHostApiRepresentation *hostApi, - PaStream** stream, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerCallback, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ); - - - PaError (*IsFormatSupported)( struct PaUtilHostApiRepresentation *hostApi, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ); -} PaUtilHostApiRepresentation; - - -/** Prototype for the initialization function which must be implemented by every - host API. - - This function should only return an error other than paNoError if it encounters - an unexpected and fatal error (memory allocation error for example). In general, - there may be conditions under which it returns a NULL interface pointer and also - returns paNoError. For example, if the ASIO implementation detects that ASIO is - not installed, it should return a NULL interface, and paNoError. - - @see paHostApiInitializers -*/ -typedef PaError PaUtilHostApiInitializer( PaUtilHostApiRepresentation**, PaHostApiIndex ); - - -/** paHostApiInitializers is a NULL-terminated array of host API initialization - functions. These functions are called by pa_front.c to initialize the host APIs - when the client calls Pa_Initialize(). - - The initialization functions are invoked in order. - - The first successfully initialized host API that has a default input *or* output - device is used as the default PortAudio host API. This is based on the logic that - there is only one default host API, and it must contain the default input and output - devices (if defined). - - There is a platform specific file that defines paHostApiInitializers for that - platform, pa_win/pa_win_hostapis.c contains the Win32 definitions for example. -*/ -extern PaUtilHostApiInitializer *paHostApiInitializers[]; - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_HOSTAPI_H */ diff --git a/external/portaudio/include/pa_jack.h b/external/portaudio/include/pa_jack.h deleted file mode 100644 index 99ef833..0000000 --- a/external/portaudio/include/pa_jack.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef PA_JACK_H -#define PA_JACK_H - -/* - * $Id: - * PortAudio Portable Real-Time Audio Library - * JACK-specific extensions - * - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - * @ingroup public_header - * @brief JACK-specific PortAudio API extension header file. - */ - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Set the JACK client name. - * - * During Pa_Initialize, When PA JACK connects as a client of the JACK server, it requests a certain - * name, which is for instance prepended to port names. By default this name is "PortAudio". The - * JACK server may append a suffix to the client name, in order to avoid clashes among clients that - * try to connect with the same name (e.g., different PA JACK clients). - * - * This function must be called before Pa_Initialize, otherwise it won't have any effect. Note that - * the string is not copied, but instead referenced directly, so it must not be freed for as long as - * PA might need it. - * @sa PaJack_GetClientName - */ -PaError PaJack_SetClientName( const char* name ); - -/** Get the JACK client name used by PA JACK. - * - * The caller is responsible for freeing the returned pointer. - */ -PaError PaJack_GetClientName(const char** clientName); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/portaudio/include/pa_linux_alsa.h b/external/portaudio/include/pa_linux_alsa.h deleted file mode 100644 index 21627bd..0000000 --- a/external/portaudio/include/pa_linux_alsa.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef PA_LINUX_ALSA_H -#define PA_LINUX_ALSA_H - -/* - * $Id: pa_linux_alsa.h 1597 2011-02-11 00:15:51Z dmitrykos $ - * PortAudio Portable Real-Time Audio Library - * ALSA-specific extensions - * - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - * @ingroup public_header - * @brief ALSA-specific PortAudio API extension header file. - */ - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct PaAlsaStreamInfo -{ - unsigned long size; - PaHostApiTypeId hostApiType; - unsigned long version; - - const char *deviceString; -} -PaAlsaStreamInfo; - -/** Initialize host API specific structure, call this before setting relevant attributes. */ -void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ); - -/** Instruct whether to enable real-time priority when starting the audio thread. - * - * If this is turned on by the stream is started, the audio callback thread will be created - * with the FIFO scheduling policy, which is suitable for realtime operation. - **/ -void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ); - -#if 0 -void PaAlsa_EnableWatchdog( PaStream *s, int enable ); -#endif - -/** Get the ALSA-lib card index of this stream's input device. */ -PaError PaAlsa_GetStreamInputCard( PaStream *s, int *card ); - -/** Get the ALSA-lib card index of this stream's output device. */ -PaError PaAlsa_GetStreamOutputCard( PaStream *s, int *card ); - -/** Set the number of periods (buffer fragments) to configure devices with. - * - * By default the number of periods is 4, this is the lowest number of periods that works well on - * the author's soundcard. - * @param numPeriods The number of periods. - */ -PaError PaAlsa_SetNumPeriods( int numPeriods ); - -/** Set the maximum number of times to retry opening busy device (sleeping for a - * short interval inbetween). - */ -PaError PaAlsa_SetRetriesBusy( int retries ); - -/** Set the path and name of ALSA library file if PortAudio is configured to load it dynamically (see - * PA_ALSA_DYNAMIC). This setting will overwrite the default name set by PA_ALSA_PATHNAME define. - * @param pathName Full path with filename. Only filename can be used, but dlopen() will lookup default - * searchable directories (/usr/lib;/usr/local/lib) then. - */ -void PaAlsa_SetLibraryPathName( const char *pathName ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/portaudio/include/pa_mac_core.h b/external/portaudio/include/pa_mac_core.h deleted file mode 100644 index 83e40a6..0000000 --- a/external/portaudio/include/pa_mac_core.h +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef PA_MAC_CORE_H -#define PA_MAC_CORE_H -/* - * PortAudio Portable Real-Time Audio Library - * Macintosh Core Audio specific extensions - * portaudio.h should be included before this file. - * - * Copyright (c) 2005-2006 Bjorn Roche - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - * @ingroup public_header - * @brief CoreAudio-specific PortAudio API extension header file. - */ - -#include "portaudio.h" - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * A pointer to a paMacCoreStreamInfo may be passed as - * the hostApiSpecificStreamInfo in the PaStreamParameters struct - * when opening a stream or querying the format. Use NULL, for the - * defaults. Note that for duplex streams, flags for input and output - * should be the same or behaviour is undefined. - */ -typedef struct -{ - unsigned long size; /**size of whole structure including this header */ - PaHostApiTypeId hostApiType; /**host API for which this data is intended */ - unsigned long version; /**structure version */ - unsigned long flags; /** flags to modify behaviour */ - SInt32 const * channelMap; /** Channel map for HAL channel mapping , if not needed, use NULL;*/ - unsigned long channelMapSize; /** Channel map size for HAL channel mapping , if not needed, use 0;*/ -} PaMacCoreStreamInfo; - -/** - * Functions - */ - - -/** Use this function to initialize a paMacCoreStreamInfo struct - * using the requested flags. Note that channel mapping is turned - * off after a call to this function. - * @param data The datastructure to initialize - * @param flags The flags to initialize the datastructure with. -*/ -void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long flags ); - -/** call this after pa_SetupMacCoreStreamInfo to use channel mapping as described in notes.txt. - * @param data The stream info structure to assign a channel mapping to - * @param channelMap The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be copied), so the caller should not free the array until after the stream has been opened. - * @param channelMapSize The size of the channel map array. - */ -void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * const channelMap, unsigned long channelMapSize ); - -/** - * Retrieve the AudioDeviceID of the input device assigned to an open stream - * - * @param s The stream to query. - * - * @return A valid AudioDeviceID, or NULL if an error occurred. - */ -AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s ); - -/** - * Retrieve the AudioDeviceID of the output device assigned to an open stream - * - * @param s The stream to query. - * - * @return A valid AudioDeviceID, or NULL if an error occurred. - */ -AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s ); - -/** - * Returns a statically allocated string with the device's name - * for the given channel. NULL will be returned on failure. - * - * This function's implemenation is not complete! - * - * @param device The PortAudio device index. - * @param channel The channel number who's name is requested. - * @return a statically allocated string with the name of the device. - * Because this string is statically allocated, it must be - * coppied if it is to be saved and used by the user after - * another call to this function. - * - */ -const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input ); - - -/** Retrieve the range of legal native buffer sizes for the specificed device, in sample frames. - - @param device The global index of the PortAudio device about which the query is being made. - @param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value. - @param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value. - - @see kAudioDevicePropertyBufferFrameSizeRange in the CoreAudio SDK. - */ -PaError PaMacCore_GetBufferSizeRange( PaDeviceIndex device, - long *minBufferSizeFrames, long *maxBufferSizeFrames ); - - -/** - * Flags - */ - -/** - * The following flags alter the behaviour of PA on the mac platform. - * they can be ORed together. These should work both for opening and - * checking a device. - */ - -/** Allows PortAudio to change things like the device's frame size, - * which allows for much lower latency, but might disrupt the device - * if other programs are using it, even when you are just Querying - * the device. */ -#define paMacCoreChangeDeviceParameters (0x01) - -/** In combination with the above flag, - * causes the stream opening to fail, unless the exact sample rates - * are supported by the device. */ -#define paMacCoreFailIfConversionRequired (0x02) - -/** These flags set the SR conversion quality, if required. The wierd ordering - * allows Maximum Quality to be the default.*/ -#define paMacCoreConversionQualityMin (0x0100) -#define paMacCoreConversionQualityMedium (0x0200) -#define paMacCoreConversionQualityLow (0x0300) -#define paMacCoreConversionQualityHigh (0x0400) -#define paMacCoreConversionQualityMax (0x0000) - -/** - * Here are some "preset" combinations of flags (above) to get to some - * common configurations. THIS IS OVERKILL, but if more flags are added - * it won't be. - */ - -/**This is the default setting: do as much sample rate conversion as possible - * and as little mucking with the device as possible. */ -#define paMacCorePlayNice (0x00) -/**This setting is tuned for pro audio apps. It allows SR conversion on input - and output, but it tries to set the appropriate SR on the device.*/ -#define paMacCorePro (0x01) -/**This is a setting to minimize CPU usage and still play nice.*/ -#define paMacCoreMinimizeCPUButPlayNice (0x0100) -/**This is a setting to minimize CPU usage, even if that means interrupting the device. */ -#define paMacCoreMinimizeCPU (0x0101) - - -#ifdef __cplusplus -} -#endif /** __cplusplus */ - -#endif /** PA_MAC_CORE_H */ diff --git a/external/portaudio/include/pa_memorybarrier.h b/external/portaudio/include/pa_memorybarrier.h deleted file mode 100644 index 2879ce3..0000000 --- a/external/portaudio/include/pa_memorybarrier.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * $Id: pa_memorybarrier.h 1240 2007-07-17 13:05:07Z bjornroche $ - * Portable Audio I/O Library - * Memory barrier utilities - * - * Author: Bjorn Roche, XO Audio, LLC - * - * This program uses the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** - @file pa_memorybarrier.h - @ingroup common_src -*/ - -/**************** - * Some memory barrier primitives based on the system. - * right now only OS X, FreeBSD, and Linux are supported. In addition to providing - * memory barriers, these functions should ensure that data cached in registers - * is written out to cache where it can be snooped by other CPUs. (ie, the volatile - * keyword should not be required) - * - * the primitives that must be defined are: - * - * PaUtil_FullMemoryBarrier() - * PaUtil_ReadMemoryBarrier() - * PaUtil_WriteMemoryBarrier() - * - ****************/ - -#if defined(__APPLE__) -# include - /* Here are the memory barrier functions. Mac OS X only provides - full memory barriers, so the three types of barriers are the same, - however, these barriers are superior to compiler-based ones. */ -# define PaUtil_FullMemoryBarrier() OSMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() OSMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() OSMemoryBarrier() -#elif defined(__GNUC__) - /* GCC >= 4.1 has built-in intrinsics. We'll use those */ -# if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) -# define PaUtil_FullMemoryBarrier() __sync_synchronize() -# define PaUtil_ReadMemoryBarrier() __sync_synchronize() -# define PaUtil_WriteMemoryBarrier() __sync_synchronize() - /* as a fallback, GCC understands volatile asm and "memory" to mean it - * should not reorder memory read/writes */ - /* Note that it is not clear that any compiler actually defines __PPC__, - * it can probably removed safely. */ -# elif defined( __ppc__ ) || defined( __powerpc__) || defined( __PPC__ ) -# define PaUtil_FullMemoryBarrier() asm volatile("sync":::"memory") -# define PaUtil_ReadMemoryBarrier() asm volatile("sync":::"memory") -# define PaUtil_WriteMemoryBarrier() asm volatile("sync":::"memory") -# elif defined( __i386__ ) || defined( __i486__ ) || defined( __i586__ ) || \ - defined( __i686__ ) || defined( __x86_64__ ) -# define PaUtil_FullMemoryBarrier() asm volatile("mfence":::"memory") -# define PaUtil_ReadMemoryBarrier() asm volatile("lfence":::"memory") -# define PaUtil_WriteMemoryBarrier() asm volatile("sfence":::"memory") -# else -# ifdef ALLOW_SMP_DANGERS -# warning Memory barriers not defined on this system or system unknown -# warning For SMP safety, you should fix this. -# define PaUtil_FullMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() -# else -# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed. -# endif -# endif -#elif (_MSC_VER >= 1400) && !defined(_WIN32_WCE) -# include -# pragma intrinsic(_ReadWriteBarrier) -# pragma intrinsic(_ReadBarrier) -# pragma intrinsic(_WriteBarrier) -/* note that MSVC intrinsics _ReadWriteBarrier(), _ReadBarrier(), _WriteBarrier() are just compiler barriers *not* memory barriers */ -# define PaUtil_FullMemoryBarrier() _ReadWriteBarrier() -# define PaUtil_ReadMemoryBarrier() _ReadBarrier() -# define PaUtil_WriteMemoryBarrier() _WriteBarrier() -#elif defined(_WIN32_WCE) -# define PaUtil_FullMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() -#elif defined(_MSC_VER) || defined(__BORLANDC__) -# define PaUtil_FullMemoryBarrier() _asm { lock add [esp], 0 } -# define PaUtil_ReadMemoryBarrier() _asm { lock add [esp], 0 } -# define PaUtil_WriteMemoryBarrier() _asm { lock add [esp], 0 } -#else -# ifdef ALLOW_SMP_DANGERS -# warning Memory barriers not defined on this system or system unknown -# warning For SMP safety, you should fix this. -# define PaUtil_FullMemoryBarrier() -# define PaUtil_ReadMemoryBarrier() -# define PaUtil_WriteMemoryBarrier() -# else -# error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed. -# endif -#endif diff --git a/external/portaudio/include/pa_process.h b/external/portaudio/include/pa_process.h deleted file mode 100644 index 4d5f56a..0000000 --- a/external/portaudio/include/pa_process.h +++ /dev/null @@ -1,754 +0,0 @@ -#ifndef PA_PROCESS_H -#define PA_PROCESS_H -/* - * $Id: pa_process.h 1668 2011-05-02 17:07:11Z rossb $ - * Portable Audio I/O Library callback buffer processing adapters - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2002 Phil Burk, Ross Bencina - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Buffer Processor prototypes. A Buffer Processor performs buffer length - adaption, coordinates sample format conversion, and interleaves/deinterleaves - channels. - -

Overview

- - The "Buffer Processor" (PaUtilBufferProcessor) manages conversion of audio - data from host buffers to user buffers and back again. Where required, the - buffer processor takes care of converting between host and user sample formats, - interleaving and deinterleaving multichannel buffers, and adapting between host - and user buffers with different lengths. The buffer processor may be used with - full and half duplex streams, for both callback streams and blocking read/write - streams. - - One of the important capabilities provided by the buffer processor is - the ability to adapt between user and host buffer sizes of different lengths - with minimum latency. Although this task is relatively easy to perform when - the host buffer size is an integer multiple of the user buffer size, the - problem is more complicated when this is not the case - especially for - full-duplex callback streams. Where necessary the adaption is implemented by - internally buffering some input and/or output data. The buffer adation - algorithm used by the buffer processor was originally implemented by - Stephan Letz for the ASIO version of PortAudio, and is described in his - Callback_adaption_.pdf which is included in the distribution. - - The buffer processor performs sample conversion using the functions provided - by pa_converters.c. - - The following sections provide an overview of how to use the buffer processor. - Interested readers are advised to consult the host API implementations for - examples of buffer processor usage. - - -

Initialization, resetting and termination

- - When a stream is opened, the buffer processor should be initialized using - PaUtil_InitializeBufferProcessor. This function initializes internal state - and allocates temporary buffers as neccesary according to the supplied - configuration parameters. Some of the parameters correspond to those requested - by the user in their call to Pa_OpenStream(), others reflect the requirements - of the host API implementation - they indicate host buffer sizes, formats, - and the type of buffering which the Host API uses. The buffer processor should - be initialized for callback streams and blocking read/write streams. - - Call PaUtil_ResetBufferProcessor to clear any sample data which is present - in the buffer processor before starting to use it (for example when - Pa_StartStream is called). - - When the buffer processor is no longer used call - PaUtil_TerminateBufferProcessor. - - -

Using the buffer processor for a callback stream

- - The buffer processor's role in a callback stream is to take host input buffers - process them with the stream callback, and fill host output buffers. For a - full duplex stream, the buffer processor handles input and output simultaneously - due to the requirements of the minimum-latency buffer adation algorithm. - - When a host buffer becomes available, the implementation should call - the buffer processor to process the buffer. The buffer processor calls the - stream callback to consume and/or produce audio data as necessary. The buffer - processor will convert sample formats, interleave/deinterleave channels, - and slice or chunk the data to the appropriate buffer lengths according to - the requirements of the stream callback and the host API. - - To process a host buffer (or a pair of host buffers for a full-duplex stream) - use the following calling sequence: - - -# Call PaUtil_BeginBufferProcessing - -# For a stream which takes input: - - Call PaUtil_SetInputFrameCount with the number of frames in the host input - buffer. - - Call one of the following functions one or more times to tell the - buffer processor about the host input buffer(s): PaUtil_SetInputChannel, - PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - - If the available host data is split accross two buffers (for example a - data range at the end of a circular buffer and another range at the - beginning of the circular buffer), also call - PaUtil_Set2ndInputFrameCount, PaUtil_Set2ndInputChannel, - PaUtil_Set2ndInterleavedInputChannels, - PaUtil_Set2ndNonInterleavedInputChannel as necessary to tell the buffer - processor about the second buffer. - -# For a stream which generates output: - - Call PaUtil_SetOutputFrameCount with the number of frames in the host - output buffer. - - Call one of the following functions one or more times to tell the - buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, - PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - - If the available host output buffer space is split accross two buffers - (for example a data range at the end of a circular buffer and another - range at the beginning of the circular buffer), call - PaUtil_Set2ndOutputFrameCount, PaUtil_Set2ndOutputChannel, - PaUtil_Set2ndInterleavedOutputChannels, - PaUtil_Set2ndNonInterleavedOutputChannel as necessary to tell the buffer - processor about the second buffer. - -# Call PaUtil_EndBufferProcessing, this function performs the actual data - conversion and processing. - - -

Using the buffer processor for a blocking read/write stream

- - Blocking read/write streams use the buffer processor to convert and copy user - output data to a host buffer, and to convert and copy host input data to - the user's buffer. The buffer processor does not perform any buffer adaption. - When using the buffer processor in a blocking read/write stream the input and - output conversion are performed separately by the PaUtil_CopyInput and - PaUtil_CopyOutput functions. - - To copy data from a host input buffer to the buffer(s) which the user supplies - to Pa_ReadStream, use the following calling sequence. - - - Repeat the following three steps until the user buffer(s) have been filled - with samples from the host input buffers: - -# Call PaUtil_SetInputFrameCount with the number of frames in the host - input buffer. - -# Call one of the following functions one or more times to tell the - buffer processor about the host input buffer(s): PaUtil_SetInputChannel, - PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - -# Call PaUtil_CopyInput with the user buffer pointer (or a copy of the - array of buffer pointers for a non-interleaved stream) passed to - Pa_ReadStream, along with the number of frames in the user buffer(s). - Be careful to pass a copy of the user buffer pointers to - PaUtil_CopyInput because PaUtil_CopyInput advances the pointers to - the start of the next region to copy. - - PaUtil_CopyInput will not copy more data than is available in the - host buffer(s), so the above steps need to be repeated until the user - buffer(s) are full. - - - To copy data to the host output buffer from the user buffers(s) supplied - to Pa_WriteStream use the following calling sequence. - - - Repeat the following three steps until all frames from the user buffer(s) - have been copied to the host API: - -# Call PaUtil_SetOutputFrameCount with the number of frames in the host - output buffer. - -# Call one of the following functions one or more times to tell the - buffer processor about the host output buffer(s): PaUtil_SetOutputChannel, - PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel. - Which function you call will depend on whether the host buffer(s) are - interleaved or not. - -# Call PaUtil_CopyOutput with the user buffer pointer (or a copy of the - array of buffer pointers for a non-interleaved stream) passed to - Pa_WriteStream, along with the number of frames in the user buffer(s). - Be careful to pass a copy of the user buffer pointers to - PaUtil_CopyOutput because PaUtil_CopyOutput advances the pointers to - the start of the next region to copy. - - PaUtil_CopyOutput will not copy more data than fits in the host buffer(s), - so the above steps need to be repeated until all user data is copied. -*/ - - -#include "portaudio.h" -#include "pa_converters.h" -#include "pa_dither.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** @brief Mode flag passed to PaUtil_InitializeBufferProcessor indicating the type - of buffering that the host API uses. - - The mode used depends on whether the host API or the implementation manages - the buffers, and how these buffers are used (scatter gather, circular buffer). -*/ -typedef enum { -/** The host buffer size is a fixed known size. */ - paUtilFixedHostBufferSize, - -/** The host buffer size may vary, but has a known maximum size. */ - paUtilBoundedHostBufferSize, - -/** Nothing is known about the host buffer size. */ - paUtilUnknownHostBufferSize, - -/** The host buffer size varies, and the client does not require the buffer - processor to consume all of the input and fill all of the output buffer. This - is useful when the implementation has access to the host API's circular buffer - and only needs to consume/fill some of it, not necessarily all of it, with each - call to the buffer processor. This is the only mode where - PaUtil_EndBufferProcessing() may not consume the whole buffer. -*/ - paUtilVariableHostBufferSizePartialUsageAllowed -}PaUtilHostBufferSizeMode; - - -/** @brief An auxilliary data structure used internally by the buffer processor - to represent host input and output buffers. */ -typedef struct PaUtilChannelDescriptor{ - void *data; - unsigned int stride; /**< stride in samples, not bytes */ -}PaUtilChannelDescriptor; - - -/** @brief The main buffer processor data structure. - - Allocate one of these, initialize it with PaUtil_InitializeBufferProcessor - and terminate it with PaUtil_TerminateBufferProcessor. -*/ -typedef struct { - unsigned long framesPerUserBuffer; - unsigned long framesPerHostBuffer; - - PaUtilHostBufferSizeMode hostBufferSizeMode; - int useNonAdaptingProcess; - int userOutputSampleFormatIsEqualToHost; - int userInputSampleFormatIsEqualToHost; - unsigned long framesPerTempBuffer; - - unsigned int inputChannelCount; - unsigned int bytesPerHostInputSample; - unsigned int bytesPerUserInputSample; - int userInputIsInterleaved; - PaUtilConverter *inputConverter; - PaUtilZeroer *inputZeroer; - - unsigned int outputChannelCount; - unsigned int bytesPerHostOutputSample; - unsigned int bytesPerUserOutputSample; - int userOutputIsInterleaved; - PaUtilConverter *outputConverter; - PaUtilZeroer *outputZeroer; - - unsigned long initialFramesInTempInputBuffer; - unsigned long initialFramesInTempOutputBuffer; - - void *tempInputBuffer; /**< used for slips, block adaption, and conversion. */ - void **tempInputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user input */ - unsigned long framesInTempInputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ - - void *tempOutputBuffer; /**< used for slips, block adaption, and conversion. */ - void **tempOutputBufferPtrs; /**< storage for non-interleaved buffer pointers, NULL for interleaved user output */ - unsigned long framesInTempOutputBuffer; /**< frames remaining in input buffer from previous adaption iteration */ - - PaStreamCallbackTimeInfo *timeInfo; - - PaStreamCallbackFlags callbackStatusFlags; - - int hostInputIsInterleaved; - unsigned long hostInputFrameCount[2]; - PaUtilChannelDescriptor *hostInputChannels[2]; /**< pointers to arrays of channel descriptors. - pointers are NULL for half-duplex output processing. - hostInputChannels[i].data is NULL when the caller - calls PaUtil_SetNoInput() - */ - int hostOutputIsInterleaved; - unsigned long hostOutputFrameCount[2]; - PaUtilChannelDescriptor *hostOutputChannels[2]; /**< pointers to arrays of channel descriptors. - pointers are NULL for half-duplex input processing. - hostOutputChannels[i].data is NULL when the caller - calls PaUtil_SetNoOutput() - */ - - PaUtilTriangularDitherGenerator ditherGenerator; - - double samplePeriod; - - PaStreamCallback *streamCallback; - void *userData; -} PaUtilBufferProcessor; - - -/** @name Initialization, termination, resetting and info */ -/*@{*/ - -/** Initialize a buffer processor's representation stored in a - PaUtilBufferProcessor structure. Be sure to call - PaUtil_TerminateBufferProcessor after finishing with a buffer processor. - - @param bufferProcessor The buffer processor structure to initialize. - - @param inputChannelCount The number of input channels as passed to - Pa_OpenStream or 0 for an output-only stream. - - @param userInputSampleFormat Format of user input samples, as passed to - Pa_OpenStream. This parameter is ignored for ouput-only streams. - - @param hostInputSampleFormat Format of host input samples. This parameter is - ignored for output-only streams. See note about host buffer interleave below. - - @param outputChannelCount The number of output channels as passed to - Pa_OpenStream or 0 for an input-only stream. - - @param userOutputSampleFormat Format of user output samples, as passed to - Pa_OpenStream. This parameter is ignored for input-only streams. - - @param hostOutputSampleFormat Format of host output samples. This parameter is - ignored for input-only streams. See note about host buffer interleave below. - - @param sampleRate Sample rate of the stream. The more accurate this is the - better - it is used for updating time stamps when adapting buffers. - - @param streamFlags Stream flags as passed to Pa_OpenStream, this parameter is - used for selecting special sample conversion options such as clipping and - dithering. - - @param framesPerUserBuffer Number of frames per user buffer, as requested - by the framesPerBuffer parameter to Pa_OpenStream. This parameter may be - zero to indicate that the user will accept any (and varying) buffer sizes. - - @param framesPerHostBuffer Specifies the number of frames per host buffer - for the fixed buffer size mode, and the maximum number of frames - per host buffer for the bounded host buffer size mode. It is ignored for - the other modes. - - @param hostBufferSizeMode A mode flag indicating the size variability of - host buffers that will be passed to the buffer processor. See - PaUtilHostBufferSizeMode for further details. - - @param streamCallback The user stream callback passed to Pa_OpenStream. - - @param userData The user data field passed to Pa_OpenStream. - - @note The interleave flag is ignored for host buffer formats. Host - interleave is determined by the use of different SetInput and SetOutput - functions. - - @return An error code indicating whether the initialization was successful. - If the error code is not PaNoError, the buffer processor was not initialized - and should not be used. - - @see Pa_OpenStream, PaUtilHostBufferSizeMode, PaUtil_TerminateBufferProcessor -*/ -PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bufferProcessor, - int inputChannelCount, PaSampleFormat userInputSampleFormat, - PaSampleFormat hostInputSampleFormat, - int outputChannelCount, PaSampleFormat userOutputSampleFormat, - PaSampleFormat hostOutputSampleFormat, - double sampleRate, - PaStreamFlags streamFlags, - unsigned long framesPerUserBuffer, /* 0 indicates don't care */ - unsigned long framesPerHostBuffer, - PaUtilHostBufferSizeMode hostBufferSizeMode, - PaStreamCallback *streamCallback, void *userData ); - - -/** Terminate a buffer processor's representation. Deallocates any temporary - buffers allocated by PaUtil_InitializeBufferProcessor. - - @param bufferProcessor The buffer processor structure to terminate. - - @see PaUtil_InitializeBufferProcessor. -*/ -void PaUtil_TerminateBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); - - -/** Clear any internally buffered data. If you call - PaUtil_InitializeBufferProcessor in your OpenStream routine, make sure you - call PaUtil_ResetBufferProcessor in your StartStream call. - - @param bufferProcessor The buffer processor to reset. -*/ -void PaUtil_ResetBufferProcessor( PaUtilBufferProcessor* bufferProcessor ); - - -/** Retrieve the input latency of a buffer processor, in frames. - - @param bufferProcessor The buffer processor examine. - - @return The input latency introduced by the buffer processor, in frames. - - @see PaUtil_GetBufferProcessorOutputLatencyFrames -*/ -unsigned long PaUtil_GetBufferProcessorInputLatencyFrames( PaUtilBufferProcessor* bufferProcessor ); - -/** Retrieve the output latency of a buffer processor, in frames. - - @param bufferProcessor The buffer processor examine. - - @return The output latency introduced by the buffer processor, in frames. - - @see PaUtil_GetBufferProcessorInputLatencyFrames -*/ -unsigned long PaUtil_GetBufferProcessorOutputLatencyFrames( PaUtilBufferProcessor* bufferProcessor ); - -/*@}*/ - - -/** @name Host buffer pointer configuration - - Functions to set host input and output buffers, used by both callback streams - and blocking read/write streams. -*/ -/*@{*/ - - -/** Set the number of frames in the input host buffer(s) specified by the - PaUtil_Set*InputChannel functions. - - @param bufferProcessor The buffer processor. - - @param frameCount The number of host input frames. A 0 frameCount indicates to - use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. - - @see PaUtil_SetNoInput, PaUtil_SetInputChannel, - PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel -*/ -void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - - -/** Indicate that no input is avalable. This function should be used when - priming the output of a full-duplex stream opened with the - paPrimeOutputBuffersUsingStreamCallback flag. Note that it is not necessary - to call this or any othe PaUtil_Set*Input* functions for ouput-only streams. - - @param bufferProcessor The buffer processor. -*/ -void PaUtil_SetNoInput( PaUtilBufferProcessor* bufferProcessor ); - - -/** Provide the buffer processor with a pointer to a host input channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. - @param stride The stride from one sample to the next, in samples. For - interleaved host buffers, the stride will usually be the same as the number of - channels in the buffer. -*/ -void PaUtil_SetInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - - -/** Provide the buffer processor with a pointer to an number of interleaved - host input channels. - - @param bufferProcessor The buffer processor. - @param firstChannel The first channel number. - @param data The buffer. - @param channelCount The number of interleaved channels in the buffer. If - channelCount is zero, the number of channels specified to - PaUtil_InitializeBufferProcessor will be used. -*/ -void PaUtil_SetInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - - -/** Provide the buffer processor with a pointer to one non-interleaved host - output channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. -*/ -void PaUtil_SetNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetInputFrameCount -*/ -void PaUtil_Set2ndInputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetInputChannel -*/ -void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetInterleavedInputChannels -*/ -void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - -/** Use for the second buffer half when the input buffer is split in two halves. - @see PaUtil_SetNonInterleavedInputChannel -*/ -void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - - -/** Set the number of frames in the output host buffer(s) specified by the - PaUtil_Set*OutputChannel functions. - - @param bufferProcessor The buffer processor. - - @param frameCount The number of host output frames. A 0 frameCount indicates to - use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. - - @see PaUtil_SetOutputChannel, PaUtil_SetInterleavedOutputChannels, - PaUtil_SetNonInterleavedOutputChannel -*/ -void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - - -/** Indicate that the output will be discarded. This function should be used - when implementing the paNeverDropInput mode for full duplex streams. - - @param bufferProcessor The buffer processor. -*/ -void PaUtil_SetNoOutput( PaUtilBufferProcessor* bufferProcessor ); - - -/** Provide the buffer processor with a pointer to a host output channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. - @param stride The stride from one sample to the next, in samples. For - interleaved host buffers, the stride will usually be the same as the number of - channels in the buffer. -*/ -void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - - -/** Provide the buffer processor with a pointer to a number of interleaved - host output channels. - - @param bufferProcessor The buffer processor. - @param firstChannel The first channel number. - @param data The buffer. - @param channelCount The number of interleaved channels in the buffer. If - channelCount is zero, the number of channels specified to - PaUtil_InitializeBufferProcessor will be used. -*/ -void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - - -/** Provide the buffer processor with a pointer to one non-interleaved host - output channel. - - @param bufferProcessor The buffer processor. - @param channel The channel number. - @param data The buffer. -*/ -void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetOutputFrameCount -*/ -void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetOutputChannel -*/ -void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data, unsigned int stride ); - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetInterleavedOutputChannels -*/ -void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, - unsigned int firstChannel, void *data, unsigned int channelCount ); - -/** Use for the second buffer half when the output buffer is split in two halves. - @see PaUtil_SetNonInterleavedOutputChannel -*/ -void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, - unsigned int channel, void *data ); - -/*@}*/ - - -/** @name Buffer processing functions for callback streams -*/ -/*@{*/ - -/** Commence processing a host buffer (or a pair of host buffers in the - full-duplex case) for a callback stream. - - @param bufferProcessor The buffer processor. - - @param timeInfo Timing information for the first sample of the host - buffer(s). This information may be adjusted when buffer adaption is being - performed. - - @param callbackStatusFlags Flags indicating whether underruns and overruns - have occurred since the last time the buffer processor was called. -*/ -void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bufferProcessor, - PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ); - - -/** Finish processing a host buffer (or a pair of host buffers in the - full-duplex case) for a callback stream. - - @param bufferProcessor The buffer processor. - - @param callbackResult On input, indicates a previous callback result, and on - exit, the result of the user stream callback, if it is called. - On entry callbackResult should contain one of { paContinue, paComplete, or - paAbort}. If paComplete is passed, the stream callback will not be called - but any audio that was generated by previous stream callbacks will be copied - to the output buffer(s). You can check whether the buffer processor's internal - buffer is empty by calling PaUtil_IsBufferProcessorOutputEmpty. - - If the stream callback is called its result is stored in *callbackResult. If - the stream callback returns paComplete or paAbort, all output buffers will be - full of valid data - some of which may be zeros to acount for data that - wasn't generated by the terminating callback. - - @return The number of frames processed. This usually corresponds to the - number of frames specified by the PaUtil_Set*FrameCount functions, exept in - the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a - smaller value may be returned. -*/ -unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bufferProcessor, - int *callbackResult ); - - -/** Determine whether any callback generated output remains in the bufffer - processor's internal buffers. This method may be used to determine when to - continue calling PaUtil_EndBufferProcessing() after the callback has returned - a callbackResult of paComplete. - - @param bufferProcessor The buffer processor. - - @return Returns non-zero when callback generated output remains in the internal - buffer and zero (0) when there internal buffer contains no callback generated - data. -*/ -int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bufferProcessor ); - -/*@}*/ - - -/** @name Buffer processing functions for blocking read/write streams -*/ -/*@{*/ - -/** Copy samples from host input channels set up by the PaUtil_Set*InputChannels - functions to a user supplied buffer. This function is intended for use with - blocking read/write streams. Copies the minimum of the number of - user frames (specified by the frameCount parameter) and the number of available - host frames (specified in a previous call to SetInputFrameCount()). - - @param bufferProcessor The buffer processor. - - @param buffer A pointer to the user buffer pointer, or a pointer to a pointer - to an array of user buffer pointers for a non-interleaved stream. It is - important that this parameter points to a copy of the user buffer pointers, - not to the actual user buffer pointers, because this function updates the - pointers before returning. - - @param frameCount The number of frames of data in the buffer(s) pointed to by - the buffer parameter. - - @return The number of frames copied. The buffer pointer(s) pointed to by the - buffer parameter are advanced to point to the frame(s) following the last one - filled. -*/ -unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bufferProcessor, - void **buffer, unsigned long frameCount ); - - -/* Copy samples from a user supplied buffer to host output channels set up by - the PaUtil_Set*OutputChannels functions. This function is intended for use with - blocking read/write streams. Copies the minimum of the number of - user frames (specified by the frameCount parameter) and the number of - host frames (specified in a previous call to SetOutputFrameCount()). - - @param bufferProcessor The buffer processor. - - @param buffer A pointer to the user buffer pointer, or a pointer to a pointer - to an array of user buffer pointers for a non-interleaved stream. It is - important that this parameter points to a copy of the user buffer pointers, - not to the actual user buffer pointers, because this function updates the - pointers before returning. - - @param frameCount The number of frames of data in the buffer(s) pointed to by - the buffer parameter. - - @return The number of frames copied. The buffer pointer(s) pointed to by the - buffer parameter are advanced to point to the frame(s) following the last one - copied. -*/ -unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bufferProcessor, - const void ** buffer, unsigned long frameCount ); - - -/* Zero samples in host output channels set up by the PaUtil_Set*OutputChannels - functions. This function is useful for flushing streams. - Zeros the minimum of frameCount and the number of host frames specified in a - previous call to SetOutputFrameCount(). - - @param bufferProcessor The buffer processor. - - @param frameCount The maximum number of frames to zero. - - @return The number of frames zeroed. -*/ -unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bufferProcessor, - unsigned long frameCount ); - - -/*@}*/ - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_PROCESS_H */ diff --git a/external/portaudio/include/pa_ringbuffer.h b/external/portaudio/include/pa_ringbuffer.h deleted file mode 100644 index 0cab3a5..0000000 --- a/external/portaudio/include/pa_ringbuffer.h +++ /dev/null @@ -1,236 +0,0 @@ -#ifndef PA_RINGBUFFER_H -#define PA_RINGBUFFER_H -/* - * $Id: pa_ringbuffer.h 1873 2012-10-07 19:00:11Z philburk $ - * Portable Audio I/O Library - * Ring Buffer utility. - * - * Author: Phil Burk, http://www.softsynth.com - * modified for SMP safety on OS X by Bjorn Roche. - * also allowed for const where possible. - * modified for multiple-byte-sized data elements by Sven Fischer - * - * Note that this is safe only for a single-thread reader - * and a single-thread writer. - * - * This program is distributed with the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - @brief Single-reader single-writer lock-free ring buffer - - PaUtilRingBuffer is a ring buffer used to transport samples between - different execution contexts (threads, OS callbacks, interrupt handlers) - without requiring the use of any locks. This only works when there is - a single reader and a single writer (ie. one thread or callback writes - to the ring buffer, another thread or callback reads from it). - - The PaUtilRingBuffer structure manages a ring buffer containing N - elements, where N must be a power of two. An element may be any size - (specified in bytes). - - The memory area used to store the buffer elements must be allocated by - the client prior to calling PaUtil_InitializeRingBuffer() and must outlive - the use of the ring buffer. - - @note The ring buffer functions are not normally exposed in the PortAudio libraries. - If you want to call them then you will need to add pa_ringbuffer.c to your application source code. -*/ - -#if defined(__APPLE__) -#include -typedef int32_t ring_buffer_size_t; -#elif defined( __GNUC__ ) -typedef long ring_buffer_size_t; -#elif (_MSC_VER >= 1400) -typedef long ring_buffer_size_t; -#elif defined(_MSC_VER) || defined(__BORLANDC__) -typedef long ring_buffer_size_t; -#else -typedef long ring_buffer_size_t; -#endif - - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -typedef struct PaUtilRingBuffer -{ - ring_buffer_size_t bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ - volatile ring_buffer_size_t writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */ - volatile ring_buffer_size_t readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */ - ring_buffer_size_t bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */ - ring_buffer_size_t smallMask; /**< Used for fitting indices to buffer. */ - ring_buffer_size_t elementSizeBytes; /**< Number of bytes per element. */ - char *buffer; /**< Pointer to the buffer containing the actual data. */ -}PaUtilRingBuffer; - -/** Initialize Ring Buffer to empty state ready to have elements written to it. - - @param rbuf The ring buffer. - - @param elementSizeBytes The size of a single data element in bytes. - - @param elementCount The number of elements in the buffer (must be a power of 2). - - @param dataPtr A pointer to a previously allocated area where the data - will be maintained. It must be elementCount*elementSizeBytes long. - - @return -1 if elementCount is not a power of 2, otherwise 0. -*/ -ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ); - -/** Reset buffer to empty. Should only be called when buffer is NOT being read or written. - - @param rbuf The ring buffer. -*/ -void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf ); - -/** Retrieve the number of elements available in the ring buffer for writing. - - @param rbuf The ring buffer. - - @return The number of elements available for writing. -*/ -ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( const PaUtilRingBuffer *rbuf ); - -/** Retrieve the number of elements available in the ring buffer for reading. - - @param rbuf The ring buffer. - - @return The number of elements available for reading. -*/ -ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( const PaUtilRingBuffer *rbuf ); - -/** Write data to the ring buffer. - - @param rbuf The ring buffer. - - @param data The address of new data to write to the buffer. - - @param elementCount The number of elements to be written. - - @return The number of elements written. -*/ -ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ); - -/** Read data from the ring buffer. - - @param rbuf The ring buffer. - - @param data The address where the data should be stored. - - @param elementCount The number of elements to be read. - - @return The number of elements read. -*/ -ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ); - -/** Get address of region(s) to which we can write data. - - @param rbuf The ring buffer. - - @param elementCount The number of elements desired. - - @param dataPtr1 The address where the first (or only) region pointer will be - stored. - - @param sizePtr1 The address where the first (or only) region length will be - stored. - - @param dataPtr2 The address where the second region pointer will be stored if - the first region is too small to satisfy elementCount. - - @param sizePtr2 The address where the second region length will be stored if - the first region is too small to satisfy elementCount. - - @return The room available to be written or elementCount, whichever is smaller. -*/ -ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, - void **dataPtr1, ring_buffer_size_t *sizePtr1, - void **dataPtr2, ring_buffer_size_t *sizePtr2 ); - -/** Advance the write index to the next location to be written. - - @param rbuf The ring buffer. - - @param elementCount The number of elements to advance. - - @return The new position. -*/ -ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); - -/** Get address of region(s) from which we can read data. - - @param rbuf The ring buffer. - - @param elementCount The number of elements desired. - - @param dataPtr1 The address where the first (or only) region pointer will be - stored. - - @param sizePtr1 The address where the first (or only) region length will be - stored. - - @param dataPtr2 The address where the second region pointer will be stored if - the first region is too small to satisfy elementCount. - - @param sizePtr2 The address where the second region length will be stored if - the first region is too small to satisfy elementCount. - - @return The number of elements available for reading. -*/ -ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, - void **dataPtr1, ring_buffer_size_t *sizePtr1, - void **dataPtr2, ring_buffer_size_t *sizePtr2 ); - -/** Advance the read index to the next location to be read. - - @param rbuf The ring buffer. - - @param elementCount The number of elements to advance. - - @return The new position. -*/ -ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_RINGBUFFER_H */ diff --git a/external/portaudio/include/pa_stream.h b/external/portaudio/include/pa_stream.h deleted file mode 100644 index 8d707b7..0000000 --- a/external/portaudio/include/pa_stream.h +++ /dev/null @@ -1,205 +0,0 @@ -#ifndef PA_STREAM_H -#define PA_STREAM_H -/* - * $Id: pa_stream.h 1339 2008-02-15 07:50:33Z rossb $ - * Portable Audio I/O Library - * stream interface - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2008 Ross Bencina, Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Stream interfaces, representation structures and helper functions - used to interface between pa_front.c host API implementations. -*/ - - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -#define PA_STREAM_MAGIC (0x18273645) - - -/** A structure representing an (abstract) interface to a host API. Contains - pointers to functions which implement the interface. - - All PaStreamInterface functions are guaranteed to be called with a non-null, - valid stream parameter. -*/ -typedef struct { - PaError (*Close)( PaStream* stream ); - PaError (*Start)( PaStream *stream ); - PaError (*Stop)( PaStream *stream ); - PaError (*Abort)( PaStream *stream ); - PaError (*IsStopped)( PaStream *stream ); - PaError (*IsActive)( PaStream *stream ); - PaTime (*GetTime)( PaStream *stream ); - double (*GetCpuLoad)( PaStream* stream ); - PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ); - PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ); - signed long (*GetReadAvailable)( PaStream* stream ); - signed long (*GetWriteAvailable)( PaStream* stream ); -} PaUtilStreamInterface; - - -/** Initialize the fields of a PaUtilStreamInterface structure. -*/ -void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface, - PaError (*Close)( PaStream* ), - PaError (*Start)( PaStream* ), - PaError (*Stop)( PaStream* ), - PaError (*Abort)( PaStream* ), - PaError (*IsStopped)( PaStream* ), - PaError (*IsActive)( PaStream* ), - PaTime (*GetTime)( PaStream* ), - double (*GetCpuLoad)( PaStream* ), - PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ), - PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ), - signed long (*GetReadAvailable)( PaStream* stream ), - signed long (*GetWriteAvailable)( PaStream* stream ) ); - - -/** Dummy Read function for use in interfaces to a callback based streams. - Pass to the Read parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -PaError PaUtil_DummyRead( PaStream* stream, - void *buffer, - unsigned long frames ); - - -/** Dummy Write function for use in an interfaces to callback based streams. - Pass to the Write parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -PaError PaUtil_DummyWrite( PaStream* stream, - const void *buffer, - unsigned long frames ); - - -/** Dummy GetReadAvailable function for use in interfaces to callback based - streams. Pass to the GetReadAvailable parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -signed long PaUtil_DummyGetReadAvailable( PaStream* stream ); - - -/** Dummy GetWriteAvailable function for use in interfaces to callback based - streams. Pass to the GetWriteAvailable parameter of PaUtil_InitializeStreamInterface. - @return An error code indicating that the function has no effect - because the stream is a callback stream. -*/ -signed long PaUtil_DummyGetWriteAvailable( PaStream* stream ); - - - -/** Dummy GetCpuLoad function for use in an interface to a read/write stream. - Pass to the GetCpuLoad parameter of PaUtil_InitializeStreamInterface. - @return Returns 0. -*/ -double PaUtil_DummyGetCpuLoad( PaStream* stream ); - - -/** Non host specific data for a stream. This data is used by pa_front to - forward to the appropriate functions in the streamInterface structure. -*/ -typedef struct PaUtilStreamRepresentation { - unsigned long magic; /**< set to PA_STREAM_MAGIC */ - struct PaUtilStreamRepresentation *nextOpenStream; /**< field used by multi-api code */ - PaUtilStreamInterface *streamInterface; - PaStreamCallback *streamCallback; - PaStreamFinishedCallback *streamFinishedCallback; - void *userData; - PaStreamInfo streamInfo; -} PaUtilStreamRepresentation; - - -/** Initialize a PaUtilStreamRepresentation structure. - - @see PaUtil_InitializeStreamRepresentation -*/ -void PaUtil_InitializeStreamRepresentation( - PaUtilStreamRepresentation *streamRepresentation, - PaUtilStreamInterface *streamInterface, - PaStreamCallback *streamCallback, - void *userData ); - - -/** Clean up a PaUtilStreamRepresentation structure previously initialized - by a call to PaUtil_InitializeStreamRepresentation. - - @see PaUtil_InitializeStreamRepresentation -*/ -void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation ); - - -/** Check that the stream pointer is valid. - - @return Returns paNoError if the stream pointer appears to be OK, otherwise - returns an error indicating the cause of failure. -*/ -PaError PaUtil_ValidateStreamPointer( PaStream *stream ); - - -/** Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation. - - @see PaUtilStreamRepresentation -*/ -#define PA_STREAM_REP( stream )\ - ((PaUtilStreamRepresentation*) (stream) ) - - -/** Cast an opaque stream pointer into a pointer to a PaUtilStreamInterface. - - @see PaUtilStreamRepresentation, PaUtilStreamInterface -*/ -#define PA_STREAM_INTERFACE( stream )\ - PA_STREAM_REP( (stream) )->streamInterface - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_STREAM_H */ diff --git a/external/portaudio/include/pa_trace.h b/external/portaudio/include/pa_trace.h deleted file mode 100644 index 612dbf3..0000000 --- a/external/portaudio/include/pa_trace.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef PA_TRACE_H -#define PA_TRACE_H -/* - * $Id: pa_trace.h 1812 2012-02-14 09:32:57Z robiwan $ - * Portable Audio I/O Library Trace Facility - * Store trace information in real-time for later printing. - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2000 Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Real-time safe event trace logging facility for debugging. - - Allows data to be logged to a fixed size trace buffer in a real-time - execution context (such as at interrupt time). Each log entry consists - of a message comprising a string pointer and an int. The trace buffer - may be dumped to stdout later. - - This facility is only active if PA_TRACE_REALTIME_EVENTS is set to 1, - otherwise the trace functions expand to no-ops. - - @fn PaUtil_ResetTraceMessages - @brief Clear the trace buffer. - - @fn PaUtil_AddTraceMessage - @brief Add a message to the trace buffer. A message consists of string and an int. - @param msg The string pointer must remain valid until PaUtil_DumpTraceMessages - is called. As a result, usually only string literals should be passed as - the msg parameter. - - @fn PaUtil_DumpTraceMessages - @brief Print all messages in the trace buffer to stdout and clear the trace buffer. -*/ - -#ifndef PA_TRACE_REALTIME_EVENTS -#define PA_TRACE_REALTIME_EVENTS (0) /**< Set to 1 to enable logging using the trace functions defined below */ -#endif - -#ifndef PA_MAX_TRACE_RECORDS -#define PA_MAX_TRACE_RECORDS (2048) /**< Maximum number of records stored in trace buffer */ -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -#if PA_TRACE_REALTIME_EVENTS - -void PaUtil_ResetTraceMessages(); -void PaUtil_AddTraceMessage( const char *msg, int data ); -void PaUtil_DumpTraceMessages(); - -/* Alternative interface */ - -typedef void* LogHandle; - -int PaUtil_InitializeHighSpeedLog(LogHandle* phLog, unsigned maxSizeInBytes); -void PaUtil_ResetHighSpeedLogTimeRef(LogHandle hLog); -int PaUtil_AddHighSpeedLogMessage(LogHandle hLog, const char* fmt, ...); -void PaUtil_DumpHighSpeedLog(LogHandle hLog, const char* fileName); -void PaUtil_DiscardHighSpeedLog(LogHandle hLog); - -#else - -#define PaUtil_ResetTraceMessages() /* noop */ -#define PaUtil_AddTraceMessage(msg,data) /* noop */ -#define PaUtil_DumpTraceMessages() /* noop */ - -#define PaUtil_InitializeHighSpeedLog(phLog, maxSizeInBytes) (0) -#define PaUtil_ResetHighSpeedLogTimeRef(hLog) -#define PaUtil_AddHighSpeedLogMessage(...) (0) -#define PaUtil_DumpHighSpeedLog(hLog, fileName) -#define PaUtil_DiscardHighSpeedLog(hLog) - -#endif - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* PA_TRACE_H */ diff --git a/external/portaudio/include/pa_util.h b/external/portaudio/include/pa_util.h deleted file mode 100644 index c454ea7..0000000 --- a/external/portaudio/include/pa_util.h +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef PA_UTIL_H -#define PA_UTIL_H -/* - * $Id: pa_util.h 1584 2011-02-02 18:58:17Z rossb $ - * Portable Audio I/O Library implementation utilities header - * common implementation utilities and interfaces - * - * Based on the Open Source API proposed by Ross Bencina - * Copyright (c) 1999-2008 Ross Bencina, Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/** @file - @ingroup common_src - - @brief Prototypes for utility functions used by PortAudio implementations. - - Some functions declared here are defined in pa_front.c while others - are implemented separately for each platform. -*/ - - -#include "portaudio.h" - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -struct PaUtilHostApiRepresentation; - - -/** Retrieve a specific host API representation. This function can be used - by implementations to retrieve a pointer to their representation in - host api specific extension functions which aren't passed a rep pointer - by pa_front.c. - - @param hostApi A pointer to a host API represenation pointer. Apon success - this will receive the requested representation pointer. - - @param type A valid host API type identifier. - - @returns An error code. If the result is PaNoError then a pointer to the - requested host API representation will be stored in *hostApi. If the host API - specified by type is not found, this function returns paHostApiNotFound. -*/ -PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **hostApi, - PaHostApiTypeId type ); - - -/** Convert a PortAudio device index into a host API specific device index. - @param hostApiDevice Pointer to a device index, on success this will recieve the - converted device index value. - @param device The PortAudio device index to convert. - @param hostApi The host api which the index should be converted for. - - @returns On success returns PaNoError and places the converted index in the - hostApiDevice parameter. -*/ -PaError PaUtil_DeviceIndexToHostApiDeviceIndex( - PaDeviceIndex *hostApiDevice, PaDeviceIndex device, - struct PaUtilHostApiRepresentation *hostApi ); - - -/** Set the host error information returned by Pa_GetLastHostErrorInfo. This - function and the paUnanticipatedHostError error code should be used as a - last resort. Implementors should use existing PA error codes where possible, - or nominate new ones. Note that at it is always better to use - PaUtil_SetLastHostErrorInfo() and paUnanticipatedHostError than to return an - ambiguous or inaccurate PaError code. - - @param hostApiType The host API which encountered the error (ie of the caller) - - @param errorCode The error code returned by the native API function. - - @param errorText A string describing the error. PaUtil_SetLastHostErrorInfo - makes a copy of the string, so it is not necessary for the pointer to remain - valid after the call to PaUtil_SetLastHostErrorInfo() returns. - -*/ -void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode, - const char *errorText ); - - - -/* the following functions are implemented in a platform platform specific - .c file -*/ - -/** Allocate size bytes, guaranteed to be aligned to a FIXME byte boundary */ -void *PaUtil_AllocateMemory( long size ); - - -/** Realease block if non-NULL. block may be NULL */ -void PaUtil_FreeMemory( void *block ); - - -/** Return the number of currently allocated blocks. This function can be - used for detecting memory leaks. - - @note Allocations will only be tracked if PA_TRACK_MEMORY is #defined. If - it isn't, this function will always return 0. -*/ -int PaUtil_CountCurrentlyAllocatedBlocks( void ); - - -/** Initialize the clock used by PaUtil_GetTime(). Call this before calling - PaUtil_GetTime. - - @see PaUtil_GetTime -*/ -void PaUtil_InitializeClock( void ); - - -/** Return the system time in seconds. Used to implement CPU load functions - - @see PaUtil_InitializeClock -*/ -double PaUtil_GetTime( void ); - - -/* void Pa_Sleep( long msec ); must also be implemented in per-platform .c file */ - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PA_UTIL_H */ diff --git a/external/portaudio/libs/32/portaudio_x86.dll b/external/portaudio/libs/32/portaudio_x86.dll new file mode 100644 index 0000000..d661fd9 Binary files /dev/null and b/external/portaudio/libs/32/portaudio_x86.dll differ diff --git a/external/portaudio/libs/32/portaudio_x86.lib b/external/portaudio/libs/32/portaudio_x86.lib new file mode 100644 index 0000000..d18136c Binary files /dev/null and b/external/portaudio/libs/32/portaudio_x86.lib differ diff --git a/external/portaudio/libs/64/libportaudio_static_x86.a b/external/portaudio/libs/64/libportaudio_static_x86.a new file mode 100644 index 0000000..c3beb67 Binary files /dev/null and b/external/portaudio/libs/64/libportaudio_static_x86.a differ diff --git a/external/portaudio/libs/64/libportaudio_x86.dll b/external/portaudio/libs/64/libportaudio_x86.dll new file mode 100644 index 0000000..45478e1 Binary files /dev/null and b/external/portaudio/libs/64/libportaudio_x86.dll differ diff --git a/external/portaudio/libs/64/libportaudio_x86.dll.a b/external/portaudio/libs/64/libportaudio_x86.dll.a new file mode 100644 index 0000000..7622090 Binary files /dev/null and b/external/portaudio/libs/64/libportaudio_x86.dll.a differ diff --git a/external/portaudio/libs/libportaudio.dll b/external/portaudio/libs/libportaudio.dll deleted file mode 100644 index 47262e0..0000000 Binary files a/external/portaudio/libs/libportaudio.dll and /dev/null differ diff --git a/external/portaudio/libs/libportaudio.dll.a b/external/portaudio/libs/libportaudio.dll.a deleted file mode 100644 index 7c42109..0000000 Binary files a/external/portaudio/libs/libportaudio.dll.a and /dev/null differ diff --git a/external/portaudio/libs/libportaudio_static.a b/external/portaudio/libs/libportaudio_static.a deleted file mode 100644 index 2330eb0..0000000 Binary files a/external/portaudio/libs/libportaudio_static.a and /dev/null differ diff --git a/external/rtl-sdr-release/rtl-sdr.h b/external/rtl-sdr-release/rtl-sdr.h index a07fc60..489e117 100644 --- a/external/rtl-sdr-release/rtl-sdr.h +++ b/external/rtl-sdr-release/rtl-sdr.h @@ -351,9 +351,10 @@ RTLSDR_API int rtlsdr_wait_async(rtlsdr_dev_t *dev, rtlsdr_read_async_cb_t cb, v * \param cb callback function to return received samples * \param ctx user specific context to pass via the callback function * \param buf_num optional buffer count, buf_num * buf_len = overall buffer size - * set to 0 for default buffer count (32) + * set to 0 for default buffer count (15) * \param buf_len optional buffer length, must be multiple of 512, - * set to 0 for default buffer length (16 * 32 * 512) + * should be a multiple of 16384 (URB size), set to 0 + * for default buffer length (16 * 32 * 512) * \return 0 on success */ RTLSDR_API int rtlsdr_read_async(rtlsdr_dev_t *dev, diff --git a/external/rtl-sdr-release/x64/convenience_static.lib b/external/rtl-sdr-release/x64/convenience_static.lib deleted file mode 100644 index 7a589b5..0000000 Binary files a/external/rtl-sdr-release/x64/convenience_static.lib and /dev/null differ diff --git a/external/rtl-sdr-release/x64/libconvenience_static.a b/external/rtl-sdr-release/x64/libconvenience_static.a new file mode 100644 index 0000000..59f0d7d Binary files /dev/null and b/external/rtl-sdr-release/x64/libconvenience_static.a differ diff --git a/external/rtl-sdr-release/x64/liblibgetopt_static.a b/external/rtl-sdr-release/x64/liblibgetopt_static.a new file mode 100644 index 0000000..c9c9637 Binary files /dev/null and b/external/rtl-sdr-release/x64/liblibgetopt_static.a differ diff --git a/external/rtl-sdr-release/x64/librtlsdr.dll b/external/rtl-sdr-release/x64/librtlsdr.dll new file mode 100644 index 0000000..5ef522a Binary files /dev/null and b/external/rtl-sdr-release/x64/librtlsdr.dll differ diff --git a/external/rtl-sdr-release/x64/librtlsdr.dll.a b/external/rtl-sdr-release/x64/librtlsdr.dll.a new file mode 100644 index 0000000..2e0542e Binary files /dev/null and b/external/rtl-sdr-release/x64/librtlsdr.dll.a differ diff --git a/external/rtl-sdr-release/x64/librtlsdr_static.a b/external/rtl-sdr-release/x64/librtlsdr_static.a new file mode 100644 index 0000000..b9f0342 Binary files /dev/null and b/external/rtl-sdr-release/x64/librtlsdr_static.a differ diff --git a/external/rtl-sdr-release/x64/libusb-1.0.dll b/external/rtl-sdr-release/x64/libusb-1.0.dll index 7861dd3..79dba9e 100644 Binary files a/external/rtl-sdr-release/x64/libusb-1.0.dll and b/external/rtl-sdr-release/x64/libusb-1.0.dll differ diff --git a/external/rtl-sdr-release/x64/rtlsdr.dll b/external/rtl-sdr-release/x64/rtlsdr.dll deleted file mode 100644 index eda90d0..0000000 Binary files a/external/rtl-sdr-release/x64/rtlsdr.dll and /dev/null differ diff --git a/external/rtl-sdr-release/x64/rtlsdr.lib b/external/rtl-sdr-release/x64/rtlsdr.lib deleted file mode 100644 index 2daa1bd..0000000 Binary files a/external/rtl-sdr-release/x64/rtlsdr.lib and /dev/null differ diff --git a/external/rtl-sdr-release/x64/rtlsdr_static.lib b/external/rtl-sdr-release/x64/rtlsdr_static.lib deleted file mode 100644 index ec21a7c..0000000 Binary files a/external/rtl-sdr-release/x64/rtlsdr_static.lib and /dev/null differ diff --git a/src/audio/AudioThread.cpp b/src/audio/AudioThread.cpp index b5a6f4b..8a19e3c 100644 --- a/src/audio/AudioThread.cpp +++ b/src/audio/AudioThread.cpp @@ -94,7 +94,7 @@ wxThread::ExitCode AudioThread::Entry() { } int preferred_device = -1; - +/* #ifdef WIN32 wchar_t dev_str[255]; memset(dev_str, 0, sizeof(wchar_t) * 255); @@ -118,7 +118,7 @@ wxThread::ExitCode AudioThread::Entry() { } } #endif - +*/ outputParameters.device = (preferred_device != -1) ? preferred_device : Pa_GetDefaultOutputDevice(); if (outputParameters.device == paNoDevice) { std::cout << "Error: No default output device.\n"; diff --git a/src/audio/AudioThread.h b/src/audio/AudioThread.h index 0b066ad..b1bd0ba 100644 --- a/src/audio/AudioThread.h +++ b/src/audio/AudioThread.h @@ -12,10 +12,7 @@ #include "AudioThreadQueue.h" #include "portaudio.h" -#ifdef WIN32 -#include "pa_stream.h" -#include "pa_debugprint.h" -#endif + static int audioCallback(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData); diff --git a/src/visual/ScopeCanvas.cpp b/src/visual/ScopeCanvas.cpp index 2c8618c..b1d6dba 100644 --- a/src/visual/ScopeCanvas.cpp +++ b/src/visual/ScopeCanvas.cpp @@ -76,10 +76,10 @@ void ScopeCanvas::OnKeyDown(wxKeyEvent& event) { } void ScopeCanvas::OnIdle(wxIdleEvent &event) { - timer.update(); - frameTimer += timer.lastUpdateSeconds(); - if (frameTimer > 1.0/30.0) { +// timer.update(); +// frameTimer += timer.lastUpdateSeconds(); +// if (frameTimer > 1.0/30.0) { Refresh(false); - frameTimer = 0; - } +// frameTimer = 0; +// } } diff --git a/src/visual/SpectrumCanvas.cpp b/src/visual/SpectrumCanvas.cpp index 060950e..7573574 100644 --- a/src/visual/SpectrumCanvas.cpp +++ b/src/visual/SpectrumCanvas.cpp @@ -153,10 +153,10 @@ void SpectrumCanvas::setData(std::vector *data) { } void SpectrumCanvas::OnIdle(wxIdleEvent &event) { - timer.update(); - frameTimer += timer.lastUpdateSeconds(); - if (frameTimer > 1.0/30.0) { +// timer.update(); +// frameTimer += timer.lastUpdateSeconds(); +// if (frameTimer > 1.0/30.0) { Refresh(false); - frameTimer = 0; - } +// frameTimer = 0; +// } } diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 8e04ced..1d073ed 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -151,10 +151,10 @@ void WaterfallCanvas::setData(std::vector *data) { } void WaterfallCanvas::OnIdle(wxIdleEvent &event) { - timer.update(); - frameTimer += timer.lastUpdateSeconds(); - if (frameTimer > 1.0/30.0) { +// timer.update(); +// frameTimer += timer.lastUpdateSeconds(); +// if (frameTimer > 1.0/30.0) { Refresh(false); - frameTimer = 0; - } +// frameTimer = 0; +// } }