mirror of
https://github.com/QB64Official/qb64.git
synced 2024-06-30 22:40:37 +00:00
Merge recent patches
This commit is contained in:
commit
bfd6d9318c
|
@ -1,9 +1,5 @@
|
|||
@ECHO OFF
|
||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
del /q /s internal\c\libqb\*.o >nul 2>nul
|
||||
del /q /s internal\c\libqb\*.a >nul 2>nul
|
||||
del /q /s internal\c\parts\*.o >nul 2>nul
|
||||
del /q /s internal\c\parts\*.a >nul 2>nul
|
||||
del /q /s internal\temp\*.* >nul 2>nul
|
||||
|
||||
cd internal\c
|
||||
set MINGW=mingw32
|
||||
|
@ -40,20 +36,4 @@ cd internal\c
|
|||
c_compiler\bin\windres.exe -i ..\temp\icon.rc -o ..\temp\icon.o
|
||||
c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64_bootstrap.exe"
|
||||
IF ERRORLEVEL 1 exit /b 1
|
||||
cd ..\..
|
||||
|
||||
echo Compiling new QB64
|
||||
echo From git %APPVEYOR_REPO_COMMIT:~0,7% > internal\version.txt
|
||||
qb64_bootstrap.exe -x source\qb64.bas -o qb64.exe
|
||||
IF ERRORLEVEL 1 exit /b 1
|
||||
|
||||
del qb64_bootstrap.exe
|
||||
del /q /s secure-file
|
||||
del /q /s internal\source\*
|
||||
move internal\temp\* internal\source\
|
||||
del /q /s internal\c\libqb\*.o >nul 2>nul
|
||||
del /q /s internal\c\libqb\*.a >nul 2>nul
|
||||
del /q /s internal\c\parts\*.o >nul 2>nul
|
||||
del /q /s internal\c\parts\*.a >nul 2>nul
|
||||
cd internal\source
|
||||
del /q /s debug_* recompile_*
|
40
.ci/bootstrap.sh
Executable file
40
.ci/bootstrap.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
OS=$1
|
||||
|
||||
com_build() {
|
||||
cd internal/c/$1/os/$OS
|
||||
echo -n "Building $2..."
|
||||
if [[ $OS == "osx" ]]; then
|
||||
./setup_build.command
|
||||
else
|
||||
./setup_build.sh
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$2 build failed."
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
com_build "libqb" "libQB"
|
||||
com_build "parts/video/font/ttf" "FreeType"
|
||||
if [[ $OS == "lnx" ]]; then
|
||||
com_build "parts/core" "FreeGLUT"
|
||||
fi
|
||||
|
||||
cp -r internal/source/* internal/temp/
|
||||
cd internal/c
|
||||
echo -n "Bootstrapping QB64..."
|
||||
if [[ $OS == "osx" ]]; then
|
||||
clang++ -w qbx.cpp libqb/os/osx/libqb_setup.o parts/video/font/ttf/os/osx/src.o -framework GLUT -framework OpenGL -framework Cocoa -lcurses -o ../../qb64_bootstrap
|
||||
else
|
||||
g++ -w qbx.cpp libqb/os/lnx/libqb_setup.o parts/video/font/ttf/os/lnx/src.o parts/core/os/lnx/src.a -lGL -lGLU -lX11 -lcurses -lpthread -ldl -lrt -D FREEGLUT_STATIC -DDEPENDENCY_USER_MODS -o ../../qb64_bootstrap
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "QB64 bootstrap failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
20
.ci/build.bat
Normal file
20
.ci/build.bat
Normal file
|
@ -0,0 +1,20 @@
|
|||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
|
||||
echo Compiling new QB64
|
||||
echo From git %APPVEYOR_REPO_COMMIT:~0,7% > internal\version.txt
|
||||
qb64_bootstrap.exe -z source\qb64.bas
|
||||
cd internal\c
|
||||
c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64.exe"
|
||||
IF ERRORLEVEL 1 exit /b 1
|
||||
|
||||
cd ..\..
|
||||
del qb64_bootstrap.exe
|
||||
del /q /s secure-file
|
||||
del /q /s internal\source\*
|
||||
move internal\temp\* internal\source\
|
||||
del /q /s internal\c\libqb\*.o >nul 2>nul
|
||||
del /q /s internal\c\libqb\*.a >nul 2>nul
|
||||
del /q /s internal\c\parts\*.o >nul 2>nul
|
||||
del /q /s internal\c\parts\*.a >nul 2>nul
|
||||
cd internal\source
|
||||
del /q /s debug_* recompile_*
|
|
@ -1,9 +1,10 @@
|
|||
.ci
|
||||
.travis
|
||||
.travis.yml
|
||||
appveyor.yml
|
||||
.git
|
||||
.gitignore
|
||||
.github
|
||||
setup_win.bat
|
||||
qb64/internal/c/mingw32
|
||||
qb64/internal/c/mingw64
|
||||
autosync.sh
|
||||
internal/c/mingw32
|
||||
internal/c/mingw64
|
20
.ci/compile.bat
Normal file
20
.ci/compile.bat
Normal file
|
@ -0,0 +1,20 @@
|
|||
@ECHO OFF
|
||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
|
||||
echo From git %GITHUB_SHA:~0,7% > internal\version.txt
|
||||
qb64_bootstrap.exe -z source\qb64.bas
|
||||
cd internal\c
|
||||
c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64.exe"
|
||||
IF ERRORLEVEL 1 exit /b 1
|
||||
|
||||
cd ..\..
|
||||
del qb64_bootstrap.exe
|
||||
del /q /s secure-file
|
||||
del /q /s internal\source\*
|
||||
del /q /s internal\temp\*
|
||||
del /q /s internal\c\libqb\*.o >nul 2>nul
|
||||
del /q /s internal\c\libqb\*.a >nul 2>nul
|
||||
del /q /s internal\c\parts\*.o >nul 2>nul
|
||||
del /q /s internal\c\parts\*.a >nul 2>nul
|
||||
cd internal\source
|
||||
del /q /s debug_* recompile_*
|
12
.ci/compile.sh
Executable file
12
.ci/compile.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo From git `echo $GITHUB_SHA | sed 's/\(.......\).*$/\1/'` > internal/version.txt
|
||||
./qb64_bootstrap -x -w source/qb64.bas
|
||||
SUCCESS=$?
|
||||
rm qb64_bootstrap
|
||||
rm internal/source/*
|
||||
mv internal/temp/* internal/source/
|
||||
rm internal/source/debug_* internal/source/recompile_*
|
||||
find . -type f -iname "*.a" -exec rm {} \;
|
||||
find . -type f -iname "*.o" -exec rm {} \;
|
||||
exit $SUCCESS
|
12
.ci/deploy.ps1
Normal file
12
.ci/deploy.ps1
Normal file
|
@ -0,0 +1,12 @@
|
|||
$Bucket = "qb64"
|
||||
$Timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd-HH-mm-ss")
|
||||
$Filename = "qb64_development_win-${Env:PLATFORM}.7z"
|
||||
# Ideally this would change the directory name to have useful information, but Windows gives an error
|
||||
# "The process cannot access the file because it is being used by another process.", so this feature
|
||||
# is disabled until someone can work out a better way.
|
||||
# $Dirname = "qb64_${Timestamp}_$($Env:GITHUB_SHA.substring(0,7))_win-${Env:PLATFORM}"
|
||||
# Rename-Item qb64 $Dirname
|
||||
$Dirname = "qb64"
|
||||
Set-Location ..
|
||||
7z a "-xr@${Dirname}\.ci\common-exclusion.list" "-xr@${Dirname}\.ci\win-exclusion.list" $Filename $Dirname
|
||||
aws --endpoint-url ${Env:S3_ENDPOINT} s3api put-object --bucket ${Bucket} --body $Filename --acl public-read --key development-builds/$Filename
|
16
.ci/deploy.sh
Executable file
16
.ci/deploy.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
OS=$1
|
||||
TZ=UTC now=`date +"%F-%H-%M-%S"`
|
||||
BUCKET=qb64
|
||||
filename="qb64_development_${OS}.tar.gz"
|
||||
dirname="qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_${OS}"
|
||||
cd ..
|
||||
mv qb64 "${dirname}"
|
||||
tar --create --auto-compress --file ${filename} --exclude-from=${dirname}/.ci/common-exclusion.list --exclude-from=${dirname}/.ci/$OS-exclusion.list ${dirname}
|
||||
aws --endpoint-url ${S3_ENDPOINT} s3api put-object --bucket ${BUCKET} --body ${filename} --acl public-read --key development-builds/${filename}
|
||||
if [[ $OS == lnx ]]; then
|
||||
aws --endpoint-url ${S3_ENDPOINT} s3api put-object --bucket ${BUCKET} --body ${dirname}/CHANGELOG.md --acl public-read --key development-builds/changelog.md
|
||||
fi
|
||||
# Move it back so the post-job cleanup doesn't complain
|
||||
mv "${dirname}" qb64
|
|
@ -1,3 +1,3 @@
|
|||
setup_osx.command
|
||||
setup_macos.command
|
||||
internal/c/c_compiler
|
||||
qb64_start_osx.command
|
9
.ci/update-source.sh
Executable file
9
.ci/update-source.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
git config --local user.email "flukiluke@gmail.com"
|
||||
git config --local user.name "Autobuild Process"
|
||||
git add internal/source
|
||||
if [[ $(git diff --cached | wc -l) -gt 0 ]]
|
||||
then git commit -m "Update internal/source"
|
||||
fi
|
||||
|
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
patreon: qb64
|
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**QB64 info (please complete the following information):**
|
||||
- First, make sure you've tried to replicate the problem in the latest development build. Get it from https://www.qb64.org/portal/development-build/: [Yes, the issue is in the latest dev build. / No, the issue was fixed. Yay!]
|
||||
- If the suspected bug is also present in the latest dev build, please report what you get in the `Help->About` dialog: [e.g. `Version 1.5 dev build from git a6101af`]
|
||||
- Report the OS you're using: [e.g. Windows 10 Build 2H2D]
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem. If not, delete this block.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
84
.github/workflows/release.yml
vendored
Normal file
84
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
linux-build:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libglu1-mesa-dev libncurses-dev
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh lnx
|
||||
- name: Compile
|
||||
run: .ci/compile.sh
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.sh lnx
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
||||
macos-build:
|
||||
runs-on: macos-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh osx
|
||||
- name: Compile
|
||||
run: .ci/compile.sh
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.sh osx
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
||||
windows-x86-build:
|
||||
runs-on: windows-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
env:
|
||||
PLATFORM: x86
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
run: .ci/compile.bat
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.ps1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
||||
windows-x64-build:
|
||||
runs-on: windows-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
env:
|
||||
PLATFORM: x64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
run: .ci/compile.bat
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.ps1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
94
.github/workflows/run.yml
vendored
Normal file
94
.github/workflows/run.yml
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- development
|
||||
|
||||
jobs:
|
||||
linux-build:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libglu1-mesa-dev libncurses-dev
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh lnx
|
||||
- name: Compile
|
||||
run: .ci/compile.sh
|
||||
- name: Update source
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/update-source.sh
|
||||
- name: Push to repository
|
||||
if: github.event_name == 'push'
|
||||
uses: ad-m/github-push-action@19caa5c351f47734055690f7d01aaaef2f9114d5
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: development
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.sh lnx
|
||||
env:
|
||||
# We are using Digital Ocean Spaces but they are API compatible with S3
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
# AWS_REGION is useless but aws-cli gives errors if its not set
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
||||
macos-build:
|
||||
runs-on: macos-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.sh osx
|
||||
- name: Compile
|
||||
run: .ci/compile.sh
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.sh osx
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
||||
windows-x86-build:
|
||||
runs-on: windows-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
env:
|
||||
PLATFORM: x86
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
run: .ci/compile.bat
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.ps1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
||||
|
||||
windows-x64-build:
|
||||
runs-on: windows-latest
|
||||
if: "!contains(github.event.head_commit.message, 'ci-skip')"
|
||||
env:
|
||||
PLATFORM: x64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Bootstrap compiler
|
||||
run: .ci/bootstrap.bat
|
||||
- name: Compile
|
||||
run: .ci/compile.bat
|
||||
- name: Publish to S3
|
||||
if: github.event_name == 'push'
|
||||
run: .ci/deploy.ps1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: us-east-2
|
||||
S3_ENDPOINT: https://nyc3.digitaloceanspaces.com
|
14
.gitignore
vendored
14
.gitignore
vendored
|
@ -1,15 +1,17 @@
|
|||
internal/c/c_compiler
|
||||
internal/temp
|
||||
internal/temp2
|
||||
internal/temp3
|
||||
internal/temp*
|
||||
*.o
|
||||
*.a
|
||||
*.exe
|
||||
internal/config.txt
|
||||
*.bas
|
||||
internal/config*.txt
|
||||
internal/config.ini
|
||||
internal/help
|
||||
internal/config(2).txt
|
||||
internal/config(1).txt
|
||||
internal/version.txt
|
||||
tempfoldersearch.bin
|
||||
internal/c/mingw32
|
||||
internal/c/mingw64
|
||||
internal/c/qbx[2-9].cpp
|
||||
*.ttf
|
||||
/run_qb64.sh
|
||||
/qb64
|
||||
|
|
36
.travis.yml
36
.travis.yml
|
@ -1,36 +0,0 @@
|
|||
language: cpp
|
||||
install: true
|
||||
script: ".travis/build.sh"
|
||||
after_success: ".travis/push.sh"
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
compiler: clang
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
notifications:
|
||||
irc:
|
||||
channels: chat.freenode.net#qb64
|
||||
skip_join: true
|
||||
template:
|
||||
- 'Autobuild of branch %{branch}: %{message}'
|
||||
addons:
|
||||
ssh_known_hosts: qb64.org
|
||||
apt:
|
||||
packages:
|
||||
- p7zip-full
|
||||
before_deploy:
|
||||
- openssl aes-256-cbc -K $encrypted_efd51ce9e893_key -iv $encrypted_efd51ce9e893_iv
|
||||
-in .travis/travis-qb64.org_rsa.enc -out /tmp/travis-qb64.org_rsa -d
|
||||
- eval "$(ssh-agent -s)"
|
||||
- chmod 600 /tmp/travis-qb64.org_rsa
|
||||
- ssh-add /tmp/travis-qb64.org_rsa
|
||||
deploy:
|
||||
provider: script
|
||||
skip_cleanup: true
|
||||
script: ".travis/deploy.sh"
|
||||
on:
|
||||
branch:
|
||||
- development
|
||||
- master
|
||||
before_install:
|
|
@ -1,5 +0,0 @@
|
|||
$filename = "qb64_" + (get-date -uformat "%Y-%m-%d-%H-%M-%S") + "_" + $Env:APPVEYOR_REPO_COMMIT.Substring(0,7) + "-" + $Env:APPVEYOR_REPO_BRANCH + "_win_" + $Env:PLATFORM + ".7z"
|
||||
cd ..
|
||||
7z a '-xr@qb64\.travis\common-exclusion.list' '-xr@qb64\.travis\win-exclusion.list' $filename qb64
|
||||
|
||||
scp -q -o StrictHostKeyChecking=no $filename m6rosupy1q2t@qb64.org:autobuilds/$Env:APPVEYOR_REPO_BRANCH/
|
Binary file not shown.
|
@ -1,66 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
g++ --version
|
||||
|
||||
###### Part 1: Build old QB64 ######
|
||||
echo "Preparing bootstrap:"
|
||||
find . -type f -iname "*.command" -exec chmod +x {} \;
|
||||
find . -type f -iname "*.a" -exec rm {} \;
|
||||
find . -type f -iname "*.o" -exec rm {} \;
|
||||
|
||||
rm internal/temp/* 2> /dev/null
|
||||
|
||||
com_build() {
|
||||
cd internal/c/$1/os/osx
|
||||
echo "Building $2..."
|
||||
./setup_build.command
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$2 build failed."
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
com_build "libqb" "libQB"
|
||||
com_build "parts/video/font/ttf" "FreeType"
|
||||
|
||||
cp -r internal/source/* internal/temp/
|
||||
cd internal/c
|
||||
echo "Bootstrapping QB64..."
|
||||
g++ -w qbx.cpp libqb/os/osx/libqb_setup.o parts/video/font/ttf/os/osx/src.o -framework GLUT -framework OpenGL -framework Cocoa -lcurses -o ../../qb64_bootstrap
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "QB64 bootstrap failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
cd - > /dev/null
|
||||
|
||||
###### Part 2: Build new QB64 from .bas sources ######
|
||||
echo "Translating .bas source..."
|
||||
echo From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt
|
||||
./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output
|
||||
rm qb64_bootstrap
|
||||
if [ `grep -v '^WARNING' /tmp/qb64-output | wc -l` -gt 2 ]; then
|
||||
cat /tmp/qb64-output
|
||||
rm /tmp/qb64-output
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
|
||||
echo "Testing compile/link..."
|
||||
# extract g++ line
|
||||
cd internal/temp/
|
||||
cpp_call=`awk '$1=="g++" {print $0}' < recompile_osx.command`
|
||||
|
||||
# run g++
|
||||
cd ../c/
|
||||
$cpp_call -o ../../qb64_testrun
|
||||
if [ $? -ne 0 -o ! -f ../../qb64_testrun ]; then
|
||||
echo "Compile/link test failed"
|
||||
exit 1
|
||||
fi
|
||||
cd ../../
|
||||
rm qb64_testrun
|
||||
echo "Done"
|
||||
exit
|
|
@ -1,75 +0,0 @@
|
|||
#!/bin/bash
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then exec .travis/build-osx.sh; fi
|
||||
|
||||
###### Part 1: Build old QB64 ######
|
||||
echo "Preparing bootstrap:"
|
||||
find . -type f -iname "*.sh" -exec chmod +x {} \;
|
||||
find . -type f -iname "*.a" -exec rm {} \;
|
||||
find . -type f -iname "*.o" -exec rm {} \;
|
||||
|
||||
rm internal/temp/* 2> /dev/null
|
||||
|
||||
com_build() {
|
||||
cd internal/c/$1/os/lnx
|
||||
echo -n "Building $2..."
|
||||
./setup_build.sh
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$2 build failed."
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
cd - > /dev/null
|
||||
}
|
||||
|
||||
com_build "libqb" "libQB"
|
||||
com_build "parts/video/font/ttf" "FreeType"
|
||||
com_build "parts/core" "FreeGLUT"
|
||||
|
||||
cp -r internal/source/* internal/temp/
|
||||
cd internal/c
|
||||
echo -n "Bootstrapping QB64..."
|
||||
g++ $NOPIE -w qbx.cpp libqb/os/lnx/libqb_setup.o parts/video/font/ttf/os/lnx/src.o parts/core/os/lnx/src.a -lGL -lGLU -lX11 -lcurses -lpthread -ldl -lrt -D FREEGLUT_STATIC -DDEPENDENCY_USER_MODS -o ../../qb64_bootstrap
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "QB64 bootstrap failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
cd - > /dev/null
|
||||
|
||||
###### Part 2: Build new QB64 from .bas sources ######
|
||||
echo -n "Translating .bas source..."
|
||||
echo From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt
|
||||
./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output
|
||||
rm qb64_bootstrap
|
||||
if [ `grep -v '^WARNING' /tmp/qb64-output | wc -l` -gt 2 ]; then
|
||||
cat /tmp/qb64-output
|
||||
rm /tmp/qb64-output
|
||||
exit 1
|
||||
fi
|
||||
echo "Done"
|
||||
|
||||
echo -n "Testing compile/link..."
|
||||
# extract g++ line
|
||||
cd internal/temp/
|
||||
cpp_call=`awk '$1=="g++" {print $0}' < recompile_lnx.sh`
|
||||
echo $cpp_call
|
||||
|
||||
# run g++
|
||||
cd ../c/
|
||||
${cpp_call/-no-pie/} -o ../../qb64_testrun
|
||||
if [ $? -ne 0 -o ! -f ../../qb64_testrun ]; then
|
||||
echo "Compile/link test failed"
|
||||
exit 1
|
||||
fi
|
||||
cd ../../
|
||||
rm qb64_testrun
|
||||
echo "Done"
|
||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit; fi
|
||||
|
||||
###### Part 3: Establish new bootstrapee ######
|
||||
rm internal/source/*
|
||||
mv internal/temp/* internal/source/
|
||||
find . -type f -iname "*.a" -exec rm {} \;
|
||||
find . -type f -iname "*.o" -exec rm {} \;
|
||||
cd internal/source
|
||||
rm debug_* recompile_*
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" != "linux" ]; then exit; fi
|
||||
|
||||
# Prepare archives
|
||||
# mainversion=`awk '$1=="Version$" {split($3, A, /\"/);print A[2];}' < source/global/version.bas`
|
||||
# buildnum=`awk '$1=="BuildNum$" {split($3,A, /[\"\/]/); print A[3];}' < source/global/version.bas`
|
||||
TZ=UTC now=`date +"%F-%H-%M-%S"`
|
||||
filebase="/tmp/qb64_${now}_`echo ${TRAVIS_COMMIT} | sed 's/\(.......\).*$/\1/'`-${TRAVIS_BRANCH}"
|
||||
rm -r .dpl
|
||||
|
||||
cd ..
|
||||
tar --create --auto-compress --file ${filebase}_osx.tar.gz --exclude-from=qb64/.travis/common-exclusion.list --exclude-from=qb64/.travis/osx-exclusion.list qb64
|
||||
tar --create --auto-compress --file ${filebase}_lnx.tar.gz --exclude-from=qb64/.travis/common-exclusion.list --exclude-from=qb64/.travis/lnx-exclusion.list qb64
|
||||
#7z a -xr@qb64/.travis/common-exclusion.list -xr@qb64/.travis/win-exclusion.list ${filebase}_win.7z qb64/ > /dev/null
|
||||
|
||||
# Send to server
|
||||
# Sometimes the connection can be a bit flakey, so try multiple times on error
|
||||
for i in `seq 1 10`
|
||||
do scp ${filebase}_* m6rosupy1q2t@qb64.org:autobuilds/${TRAVIS_BRANCH}/
|
||||
if [ "$?" -eq 0 ]
|
||||
then exit 0
|
||||
fi
|
||||
echo scp failed
|
||||
done
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
if [ "$TRAVIS_OS_NAME" != "linux" ]; then exit; fi
|
||||
if [ "${UPDATE_REPO}" != "yes" ]; then exit; fi
|
||||
git config --global user.email "flukiluke@gmail.com"
|
||||
git config --global user.name "Autobuild process"
|
||||
git clone --depth=1 --branch=$TRAVIS_BRANCH https://${GH_TOKEN}@github.com/Galleondragon/qb64.git homeqb64
|
||||
cd homeqb64
|
||||
rm -r internal/source
|
||||
cp -r ../internal/source internal/source
|
||||
git add --all internal/source
|
||||
git commit --message "Autobuild update [ci skip]"
|
||||
git push
|
||||
cd ..
|
||||
rm -rf homeqb64
|
Binary file not shown.
41
CHANGELOG.md
Normal file
41
CHANGELOG.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
# QB64 development build - Changelog
|
||||
Upcoming version is currently identified as v2.1, but that number may change before release.
|
||||
|
||||
## New features
|
||||
### All platforms
|
||||
- Implement the `_Bin$` function as counterpart to `&B` prefixed number strings. Usage is analog to the legacy OCT$ and HEX$ functions.
|
||||
- Save Watch Panel position and size.
|
||||
- Add `$NOPREFIX` support for `$COLOR`.
|
||||
- Allow changing color of menu panels and dialogs (Options->IDE Colors).
|
||||
- Add support to different number formats in Watch Panel and Watch List dialog (dec/hex/oct/bin).
|
||||
|
||||
<!---
|
||||
### Windows
|
||||
|
||||
### macOS
|
||||
|
||||
### Linux
|
||||
--->
|
||||
|
||||
## Fixes
|
||||
### All platforms
|
||||
- Fix function `LOC` returning wrong values when used on physical files.
|
||||
- Fix glitch in syntax highlighter mistaking variable names with scientific notation.
|
||||
- Fix Variable List dialog's "Add All" button not properly considering the active filter.
|
||||
- Fix wiki update feature.
|
||||
- Fix issue with Sub/Function parameters in `Declare` blocks with `$NoPrefix`.
|
||||
- Fix issue with Sub/Function parameters without types after `As`.
|
||||
- Fix issue with capitalization of array names in `LBound/UBound` calls.
|
||||
- Fix capitalization of 'To' in `Case` statements.
|
||||
- Fix indentation issue in disabled precompiler blocks.
|
||||
- Fix crash when a variable was deleted between `$Debug` sessions.
|
||||
- Reenables selecting a line by clicking the line number bar when `$Debug` is not used and the `Auto-add $Debug metacommand` feature is disabled.
|
||||
|
||||
<!---
|
||||
### Windows
|
||||
|
||||
### macOS
|
||||
--->
|
||||
|
||||
### Linux
|
||||
- Fix building static libraries when installation path contains spaces.
|
1
COPYING.txt
Normal file
1
COPYING.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Please refer to licenses/COPYING.TXT for licensing details.
|
56
README.md
56
README.md
|
@ -1,9 +1,55 @@
|
|||
_This repository is outdated. Follow development at https://github.com/QB64Team/qb64_
|
||||
|
||||
# QB64
|
||||
|
||||
<p align="center">
|
||||
<img src="https://qb64.org/images/QB64icon1.3small.png"/>
|
||||
</p
|
||||
![githubstrip](https://user-images.githubusercontent.com/10699359/109433808-1026f580-79f1-11eb-9472-2d4180dff14c.png)
|
||||
|
||||
QB64 is a modern extended BASIC+OpenGL language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows (XP and up), Linux and macOS.
|
||||
=======
|
||||
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/QB64Team/qb64/issues)
|
||||
|
||||
# Table of Contents
|
||||
1. [Installation](#Installation)
|
||||
1. [Windows](#Windows)
|
||||
2. [macOS](#macOS)
|
||||
3. [Linux](#Linux)
|
||||
|
||||
2. [Usage](#Usage)
|
||||
3. [Additional Info](#Additional_Info)
|
||||
|
||||
# Installation <a name="Installation"></a>
|
||||
Download the appropriate package for your operating system. Check the Releases page.
|
||||
|
||||
<a name="Windows"></a>
|
||||
## Windows
|
||||
|
||||
Make sure to extract the package contents to a folder with full write permissions (failing to do so may result in IDE or compilation errors).
|
||||
|
||||
* It is advisable to to whitelist the QB64 folder in your antivirus/antimalware software *
|
||||
|
||||
<a name="macOS"></a>
|
||||
## macOS
|
||||
Before using QB64 make sure to install the Xcode command line tools with:
|
||||
```bash
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
Run ```./setup_osx.command``` to compile QB64 for your OS version.
|
||||
|
||||
<a name="Linux"></a>
|
||||
## Linux
|
||||
Compile QB64 with ```./setup_lnx.sh```.
|
||||
|
||||
Dependencies should be automatically installed. Required packages include OpenGL, ALSA and the GNU C++ Compiler.
|
||||
|
||||
<a name="Usage"></a>
|
||||
# Usage
|
||||
Run the QB64 executable to launch the IDE, which you can use to edit your .BAS files. From there, hit F5 to compile and run your code.
|
||||
|
||||
To generate a binary without running it, hit F11.
|
||||
|
||||
Additionally, if you do not wish to use the integrated IDE and to only compile your program, you can use the following command-line calls:
|
||||
|
||||
```qb64 -c yourfile.bas```
|
||||
|
||||
```qb64 -c yourfile.bas -o outputname.exe```
|
||||
|
||||
Replacing `-c` with `-x` will compile without opening a separate compiler window.
|
3
SAMPLES.txt
Normal file
3
SAMPLES.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
The collection of sample programs previous distributed with QB64 is now available at https://www.qb64.org/forum/index.php?topic=171.0
|
||||
|
||||
More programs and useful code routines at https://www.qb64.org/forum/index.php?board=8.0
|
17
appveyor.yml
17
appveyor.yml
|
@ -1,17 +0,0 @@
|
|||
version: 1.2.{build}
|
||||
image: Visual Studio 2017
|
||||
clone_depth: 1
|
||||
environment:
|
||||
sshkey:
|
||||
secure: BiD9D+ye4Q+R8yBsThsfG0K+SFL5gRx6gNfxxSTR8ge3lp98cwZ3y7T3bq7tmgE7
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
build_script:
|
||||
- cmd: .travis\appveyor.bat
|
||||
install:
|
||||
- nuget install secure-file -ExcludeVersion
|
||||
- cmd: secure-file\tools\secure-file -decrypt .travis\appveyor-qb64.org_rsa.enc -secret %sshkey% -out %userprofile%\.ssh\id_rsa
|
||||
deploy_script:
|
||||
- ps: .travis\appveyor-deploy.ps1
|
||||
test: off
|
28
autosync.sh
28
autosync.sh
|
@ -1,28 +0,0 @@
|
|||
#!/bin/bash
|
||||
# This script reproduces any commits on upstream to the given remotes, but only on the given branches.
|
||||
# It is intended to be run via a cron job or similar.
|
||||
# The merge is --ff-only, so the target branches must not have anything else adding commits to them.
|
||||
|
||||
set -e
|
||||
cd ~/qb64
|
||||
|
||||
# Adding a new branch/remote? git checkout -b $remote-$branch $remote/$branch to create a new local.
|
||||
BRANCHES='development'
|
||||
REMOTES='origin fellippe qb64team'
|
||||
|
||||
git fetch upstream
|
||||
|
||||
for branch in $BRANCHES; do
|
||||
for remote in $REMOTES; do
|
||||
git checkout -q $remote-$branch
|
||||
git merge -q --ff-only upstream/$branch
|
||||
done
|
||||
done
|
||||
|
||||
for remote in $REMOTES; do
|
||||
refspecs=
|
||||
for branch in $BRANCHES; do
|
||||
refspecs="$refspecs $remote-$branch:$branch"
|
||||
done
|
||||
git push -q $remote $refspecs
|
||||
done
|
BIN
cyberbit.ttf
BIN
cyberbit.ttf
Binary file not shown.
|
@ -100,7 +100,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
//QB64 string descriptor structure
|
||||
struct qbs_field{
|
||||
|
@ -270,6 +269,7 @@
|
|||
*/
|
||||
ptrszint elementsize;
|
||||
int32 image;
|
||||
int32 sound;
|
||||
};
|
||||
struct mem_lock{
|
||||
uint64 id;
|
||||
|
@ -279,6 +279,7 @@
|
|||
//2=image
|
||||
//3=sub/function scope block
|
||||
//4=array
|
||||
//5=sound
|
||||
//---- type specific variables follow ----
|
||||
void *offset;//used by malloc'ed blocks to free them
|
||||
};
|
||||
|
|
2349
internal/c/libqb.cpp
2349
internal/c/libqb.cpp
File diff suppressed because it is too large
Load diff
|
@ -68,4 +68,6 @@
|
|||
|
||||
extern qbs *qbs_lcase(qbs *str);
|
||||
extern qbs *qbs_ucase(qbs *str);
|
||||
|
||||
using namespace std;
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
#ifdef QB64_MACOSX
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
// trigger recompilation = 3
|
||||
|
||||
int32 displayorder_screen=1;
|
||||
int32 displayorder_hardware=2;
|
||||
|
@ -525,6 +530,44 @@ void sub__glrender(int32 method){
|
|||
|
||||
if (render_state.dest_handle==0){
|
||||
static int32 dst_w,dst_h;
|
||||
static int32 scale_factor=0;
|
||||
|
||||
#ifdef QB64_MACOSX
|
||||
if (scale_factor==0) {
|
||||
// by default scale_factor should be 1, but in macOS Catalina (10.15.*) scale_factor must be setted in 2
|
||||
// * in cases where the app is executed on system with Retina Display
|
||||
scale_factor = 1; // by default
|
||||
|
||||
// lookup for retina/5k output from system_profiler (storing all outpun in stream)
|
||||
bool b_isRetina, b_is5k;
|
||||
FILE* consoleStream = popen("system_profiler SPDisplaysDataType", "r");
|
||||
if (consoleStream) {
|
||||
char buffer[128];
|
||||
while (!feof(consoleStream)) {
|
||||
if (fgets(buffer, 128, consoleStream) != NULL) {
|
||||
string szBuffer(buffer);
|
||||
|
||||
if (!b_isRetina) b_isRetina = (szBuffer.rfind("Retina") != ULONG_MAX);
|
||||
if (!b_is5k) b_is5k = (szBuffer.rfind("5K") != ULONG_MAX);
|
||||
}
|
||||
}
|
||||
}
|
||||
pclose(consoleStream);
|
||||
|
||||
if (b_isRetina || b_is5k) {
|
||||
// apply only factor = 2 if macOS is Catalina (11.15.* // kern.osrelease 19.*)
|
||||
char str[256];
|
||||
size_t size = sizeof(str);
|
||||
int ret = sysctlbyname("kern.osrelease", str, &size, NULL, 0);
|
||||
|
||||
string sz_osrelease(str);
|
||||
if (sz_osrelease.rfind("19.") == 0) scale_factor=2;
|
||||
}
|
||||
}
|
||||
#else
|
||||
scale_factor=1;
|
||||
#endif
|
||||
|
||||
dst_w=environment__window_width;
|
||||
dst_h=environment__window_height;
|
||||
|
||||
|
@ -538,7 +581,7 @@ void sub__glrender(int32 method){
|
|||
glLoadIdentity();
|
||||
glScalef(1, -1, 1);//flip vertically
|
||||
glTranslatef(0, -dst_h, 0);//move to new vertical position
|
||||
glViewport(0,0,dst_w,dst_h);
|
||||
glViewport(0,0,dst_w * scale_factor,dst_h * scale_factor);
|
||||
|
||||
|
||||
}else{
|
||||
|
@ -2023,20 +2066,29 @@ void sub__glrender(int32 method){
|
|||
|
||||
void GLUT_MOTION_FUNC(int x, int y){
|
||||
|
||||
static int32 i,last_i;
|
||||
static int32 xrel=0,yrel=0;
|
||||
|
||||
int32 i, last_i;
|
||||
int32 handle;
|
||||
int32 xrel, yrel;
|
||||
handle=mouse_message_queue_first;
|
||||
mouse_message_queue_struct *queue=(mouse_message_queue_struct*)list_get(mouse_message_queue_handles,handle);
|
||||
|
||||
//message #1
|
||||
last_i=queue->last;
|
||||
i=queue->last+1; if (i>queue->lastIndex) i=0;
|
||||
i=queue->last+1; if (i>queue->lastIndex) i=0; //wrap around
|
||||
if (i==queue->current){
|
||||
int32 nextIndex=queue->last+1; if (nextIndex>queue->lastIndex) nextIndex=0;
|
||||
int32 nextIndex=queue->last+1;
|
||||
if (nextIndex>queue->lastIndex) nextIndex=0;
|
||||
queue->current=nextIndex;
|
||||
}
|
||||
#ifdef QB64_WINDOWS
|
||||
// Windows calculates relative movement by intercepting WM_INPUT events instead
|
||||
xrel = 0;
|
||||
yrel = 0;
|
||||
#else
|
||||
xrel = x - queue->queue[queue->last].x;
|
||||
yrel = y - queue->queue[queue->last].y;
|
||||
#endif
|
||||
|
||||
queue->queue[i].x=x;
|
||||
queue->queue[i].y=y;
|
||||
queue->queue[i].movementx=xrel;
|
||||
|
|
|
@ -181,16 +181,6 @@ int32 requestedKeyboardOverlayImage=0;
|
|||
if (flags&NEW_HARDWARE_IMG__DUPLICATE_PROVIDED_BUFFER){
|
||||
hardware_img->software_pixel_buffer=(uint32*)malloc(x*y*4);
|
||||
memcpy(hardware_img->software_pixel_buffer,pixels,x*y*4);
|
||||
#ifdef QB64_ANDROID
|
||||
//BGRA->RGBA
|
||||
uint32 *pos=(uint32*)hardware_img->software_pixel_buffer;
|
||||
int32 numPixels=x*y;
|
||||
uint32 col;
|
||||
while(numPixels--){
|
||||
col=*pos;
|
||||
*pos++= (col&0xFF00FF00) | ((col & 0xFF0000) >> 16) | ((col & 0x0000FF) << 16);
|
||||
}
|
||||
#endif
|
||||
}else{
|
||||
hardware_img->software_pixel_buffer=pixels;
|
||||
}
|
||||
|
|
2
internal/c/libqb/os/osx/build_test.command
Normal file → Executable file
2
internal/c/libqb/os/osx/build_test.command
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
g++ -c -w -Wall ../../../libqb.mm -D DEPENDENCY_AUDIO_OUT -D DEPENDENCY_AUDIO_DECODE -D DEPENDENCY_AUDIO_CONVERSION -o libqb_test_only.o
|
||||
clang++ -c -w -Wall ../../../libqb.mm -D DEPENDENCY_AUDIO_OUT -D DEPENDENCY_AUDIO_DECODE -D DEPENDENCY_AUDIO_CONVERSION -o libqb_test_only.o
|
||||
echo "Press any key to continue"
|
||||
Pause()
|
||||
{
|
||||
|
|
2
internal/c/libqb/os/osx/setup_build.command
Normal file → Executable file
2
internal/c/libqb/os/osx/setup_build.command
Normal file → Executable file
|
@ -1,3 +1,3 @@
|
|||
cd "$(dirname "$0")"
|
||||
g++ -c -w -Wall ../../../libqb.mm -D DEPENDENCY_LOADFONT -o libqb_setup.o
|
||||
clang++ -c -w -Wall ../../../libqb.mm -D DEPENDENCY_LOADFONT -o libqb_setup.o
|
||||
|
||||
|
|
2
internal/c/makeline_lnx_nogui.txt
Normal file
2
internal/c/makeline_lnx_nogui.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
g++ -no-pie -w qbx.cpp parts/core/os/lnx/src.a -lpthread -ldl -lrt -D FREEGLUT_STATIC -o
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
g++ -w qbx.cpp -framework OpenGL -framework IOKit -framework GLUT -framework OpenGL -framework Cocoa -o
|
||||
clang++ -w qbx.cpp -framework OpenGL -framework IOKit -framework GLUT -framework OpenGL -framework Cocoa -o
|
||||
|
||||
(below for reference purposes only, above is minimum viable)
|
||||
g++ -w qbx.cpp -framework ApplicationServices -framework OpenGL -framework IOKit -framework CoreServices -framework CoreFoundation -framework GLUT -framework OpenGL -framework Cocoa -o
|
||||
clang++ -w qbx.cpp -framework ApplicationServices -framework OpenGL -framework IOKit -framework CoreServices -framework CoreFoundation -framework GLUT -framework OpenGL -framework Cocoa -o
|
0
internal/c/mingw32/libexec/gcc/i686-w64-mingw32/8.1.0/install-tools/fixinc.sh
Normal file → Executable file
0
internal/c/mingw32/libexec/gcc/i686-w64-mingw32/8.1.0/install-tools/fixinc.sh
Normal file → Executable file
0
internal/c/mingw32/opt/bin/python-config-u.sh
Normal file → Executable file
0
internal/c/mingw32/opt/bin/python-config-u.sh
Normal file → Executable file
0
internal/c/mingw32/opt/bin/python-config.sh
Normal file → Executable file
0
internal/c/mingw32/opt/bin/python-config.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/itcl4.1.1/itclConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/itcl4.1.1/itclConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tcl8.6/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tcl8.6/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tdbc1.0.6/tdbcConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tdbc1.0.6/tdbcConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tk8.6/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tk8.6/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/lib/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw32/opt/ssl/misc/CA.sh
Normal file → Executable file
0
internal/c/mingw32/opt/ssl/misc/CA.sh
Normal file → Executable file
0
internal/c/mingw64/libexec/gcc/x86_64-w64-mingw32/8.1.0/install-tools/fixinc.sh
Normal file → Executable file
0
internal/c/mingw64/libexec/gcc/x86_64-w64-mingw32/8.1.0/install-tools/fixinc.sh
Normal file → Executable file
0
internal/c/mingw64/opt/bin/python-config-u.sh
Normal file → Executable file
0
internal/c/mingw64/opt/bin/python-config-u.sh
Normal file → Executable file
0
internal/c/mingw64/opt/bin/python-config.sh
Normal file → Executable file
0
internal/c/mingw64/opt/bin/python-config.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/itcl4.1.1/itclConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/itcl4.1.1/itclConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tcl8.6/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tcl8.6/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tclConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tdbc1.0.6/tdbcConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tdbc1.0.6/tdbcConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tk8.6/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tk8.6/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/lib/tkConfig.sh
Normal file → Executable file
0
internal/c/mingw64/opt/ssl/misc/CA.sh
Normal file → Executable file
0
internal/c/mingw64/opt/ssl/misc/CA.sh
Normal file → Executable file
|
@ -214,7 +214,7 @@ int32 _dieeetomsbin(double *src8, double *dest8)
|
|||
/* Make a clobberable copy of the source number */
|
||||
memcpy(ieee,src8,8); //strncpy((char *)ieee,(char *)src8,8);
|
||||
|
||||
for (i=0; i<8; i++) msbin[i] = 0;
|
||||
memset(msbin, 0, sizeof(*dest8)); //for (i=0; i<8; i++) msbin[i] = 0;
|
||||
|
||||
/* If all are zero in src8, the msbin should be zero */
|
||||
for (i=0; i<8; i++) any_on |= ieee[i];
|
||||
|
@ -222,12 +222,15 @@ int32 _dieeetomsbin(double *src8, double *dest8)
|
|||
|
||||
sign = ieee[7] & 0x80;
|
||||
msbin[6] |= sign;
|
||||
msbin_exp = (unsigned)(ieee[7] & 0x7f) * 0x10;
|
||||
msbin_exp = (unsigned)(ieee[7] & 0x7f) << 4; //(unsigned)(ieee[7] & 0x7f) * 0x10;
|
||||
msbin_exp += ieee[6] >> 4;
|
||||
|
||||
if (msbin_exp-0x3ff > 0x80) return 1;
|
||||
|
||||
msbin[7] = msbin_exp - 0x3ff + 0x80 + 1;
|
||||
// verify the exponent is in range for MBF encoding
|
||||
msbin_exp = msbin_exp - 0x3ff + 0x80 + 1;
|
||||
if ((msbin_exp & 0xff00) != 0) return 1;
|
||||
msbin[7] = msbin_exp;
|
||||
// if (msbin_exp-0x3ff > 0x80) return 1;
|
||||
// msbin[7] = msbin_exp - 0x3ff + 0x80 + 1;
|
||||
|
||||
/* The ieee mantissa must be shifted up 3 bits */
|
||||
ieee[6] &= 0x0f; /* mask out the exponent in the second byte */
|
||||
|
|
|
@ -29,40 +29,22 @@
|
|||
_DELAY 0.05 ' 50ms delay (20 checks per second)
|
||||
GET #client, , a2$
|
||||
a$ = a$ + a2$
|
||||
i = INSTR(a$, "Content-Length:")
|
||||
IF i THEN
|
||||
i2 = INSTR(i, a$, e$)
|
||||
IF i2 THEN
|
||||
l = VAL(MID$(a$, i + 15, i2 - i - 14))
|
||||
i3 = INSTR(i2, a$, e$ + e$)
|
||||
IF i3 THEN
|
||||
i3 = i3 + 4 'move i3 to start of data
|
||||
IF (LEN(a$) - i3 + 1) = l THEN
|
||||
CLOSE client ' CLOSE CLIENT
|
||||
d$ = MID$(a$, i3, l)
|
||||
|
||||
'check IP format:
|
||||
i = 0 'total dots
|
||||
x$ = "" 'current number
|
||||
FOR i2 = 1 TO LEN(d$)
|
||||
IF ASC(d$, i2) = 46 THEN
|
||||
IF LEN(x$) = 0 THEN EXIT FUNCTION
|
||||
x$ = ""
|
||||
i = i + 1
|
||||
IF i > 3 THEN EXIT FUNCTION
|
||||
ELSEIF ASC(d$, i2) < 48 OR ASC(d$, i2) > 57 THEN
|
||||
EXIT FUNCTION
|
||||
ELSE
|
||||
x$ = x$ + MID$(d$, i2, 1)
|
||||
END IF
|
||||
NEXT
|
||||
|
||||
whatismyip$ = d$
|
||||
EXIT FUNCTION
|
||||
END IF ' availabledata = l
|
||||
END IF ' i3
|
||||
END IF ' i2
|
||||
END IF ' i
|
||||
IF l = 0 THEN
|
||||
i = INSTR(a$, e$ + e$)
|
||||
IF i THEN
|
||||
i2 = INSTR(i + 4, a$, e$)
|
||||
IF i2 THEN
|
||||
l = VAL("&H" + MID$(a$, i + 4, i2 - i - 2))
|
||||
a$ = MID$(a$, i + 4 + i2 - i - 2)
|
||||
END IF ' i2
|
||||
END IF ' i
|
||||
ELSE
|
||||
IF LEN(a$) >= l THEN
|
||||
whatismyip$ = LEFT$(a$, l)
|
||||
CLOSE client
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
END IF
|
||||
LOOP UNTIL TIMER > t! + 5 ' (in seconds)
|
||||
CLOSE client
|
||||
END FUNCTION
|
||||
|
@ -77,8 +59,7 @@ qbs* WHATISMYIP(){ //changed name from FUNC_WHATISMYIP to WHATISMYIP
|
|||
uint8 *tmp_mem_static_pointer=mem_static_pointer;
|
||||
uint32 tmp_cmem_sp=cmem_sp;
|
||||
|
||||
|
||||
//data1.txt
|
||||
// include "data1.txt"
|
||||
qbs *_FUNC_WHATISMYIP_STRING_WHATISMYIP=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_WHATISMYIP)_FUNC_WHATISMYIP_STRING_WHATISMYIP=qbs_new(0,0);
|
||||
qbs *_FUNC_WHATISMYIP_STRING_URL=NULL;
|
||||
|
@ -87,76 +68,57 @@ qbs* WHATISMYIP(){ //changed name from FUNC_WHATISMYIP to WHATISMYIP
|
|||
if (!_FUNC_WHATISMYIP_STRING_URL2)_FUNC_WHATISMYIP_STRING_URL2=qbs_new(0,0);
|
||||
float *_FUNC_WHATISMYIP_SINGLE_X=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_X==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_X=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_X=0;
|
||||
_FUNC_WHATISMYIP_SINGLE_X=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_X=0;
|
||||
}
|
||||
float *_FUNC_WHATISMYIP_SINGLE_CLIENT=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_CLIENT==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_CLIENT=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_CLIENT=0;
|
||||
_FUNC_WHATISMYIP_SINGLE_CLIENT=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_CLIENT=0;
|
||||
}
|
||||
qbs *_FUNC_WHATISMYIP_STRING_E=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_E)_FUNC_WHATISMYIP_STRING_E=qbs_new(0,0);
|
||||
qbs *_FUNC_WHATISMYIP_STRING_URL3=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_URL3)_FUNC_WHATISMYIP_STRING_URL3=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_20=NULL;
|
||||
if (!byte_element_20){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_20=(byte_element_struct*)(mem_static_pointer-12); else byte_element_20=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_2=NULL;
|
||||
if (!byte_element_2){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_WHATISMYIP_STRING_X=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_X)_FUNC_WHATISMYIP_STRING_X=qbs_new(0,0);
|
||||
byte_element_struct *byte_element_21=NULL;
|
||||
if (!byte_element_21){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_21=(byte_element_struct*)(mem_static_pointer-12); else byte_element_21=(byte_element_struct*)mem_static_malloc(12);
|
||||
byte_element_struct *byte_element_3=NULL;
|
||||
if (!byte_element_3){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_3=(byte_element_struct*)(mem_static_pointer-12); else byte_element_3=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
float *_FUNC_WHATISMYIP_SINGLE_T=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_T==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_T=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_T=0;
|
||||
_FUNC_WHATISMYIP_SINGLE_T=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_T=0;
|
||||
}
|
||||
qbs *_FUNC_WHATISMYIP_STRING_A2=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_A2)_FUNC_WHATISMYIP_STRING_A2=qbs_new(0,0);
|
||||
qbs *_FUNC_WHATISMYIP_STRING_A=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_A)_FUNC_WHATISMYIP_STRING_A=qbs_new(0,0);
|
||||
float *_FUNC_WHATISMYIP_SINGLE_L=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_L==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_L=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_L=0;
|
||||
}
|
||||
float *_FUNC_WHATISMYIP_SINGLE_I=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_I==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_I=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I=0;
|
||||
_FUNC_WHATISMYIP_SINGLE_I=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I=0;
|
||||
}
|
||||
float *_FUNC_WHATISMYIP_SINGLE_I2=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_I2==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_I2=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I2=0;
|
||||
_FUNC_WHATISMYIP_SINGLE_I2=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I2=0;
|
||||
}
|
||||
float *_FUNC_WHATISMYIP_SINGLE_L=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_L==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_L=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_L=0;
|
||||
byte_element_struct *byte_element_5=NULL;
|
||||
if (!byte_element_5){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_5=(byte_element_struct*)(mem_static_pointer-12); else byte_element_5=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
float *_FUNC_WHATISMYIP_SINGLE_I3=NULL;
|
||||
if(_FUNC_WHATISMYIP_SINGLE_I3==NULL){
|
||||
_FUNC_WHATISMYIP_SINGLE_I3=(float*)mem_static_malloc(4);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I3=0;
|
||||
}
|
||||
byte_element_struct *byte_element_23=NULL;
|
||||
if (!byte_element_23){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_23=(byte_element_struct*)(mem_static_pointer-12); else byte_element_23=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
qbs *_FUNC_WHATISMYIP_STRING_D=NULL;
|
||||
if (!_FUNC_WHATISMYIP_STRING_D)_FUNC_WHATISMYIP_STRING_D=qbs_new(0,0);
|
||||
double fornext_value25;
|
||||
double fornext_finalvalue25;
|
||||
double fornext_step25;
|
||||
uint8 fornext_step_negative25;
|
||||
byte_element_struct *byte_element_26=NULL;
|
||||
if (!byte_element_26){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_26=(byte_element_struct*)(mem_static_pointer-12); else byte_element_26=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
byte_element_struct *byte_element_27=NULL;
|
||||
if (!byte_element_27){
|
||||
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_27=(byte_element_struct*)(mem_static_pointer-12); else byte_element_27=(byte_element_struct*)mem_static_malloc(12);
|
||||
}
|
||||
|
||||
// end of "data1.txt
|
||||
|
||||
mem_lock *sf_mem_lock;
|
||||
new_mem_lock();
|
||||
|
@ -170,13 +132,13 @@ qbs* WHATISMYIP(){ //changed name from FUNC_WHATISMYIP to WHATISMYIP
|
|||
*_FUNC_WHATISMYIP_SINGLE_X=func_instr(NULL,_FUNC_WHATISMYIP_STRING_URL2,qbs_new_txt_len("/",1),0);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((*_FUNC_WHATISMYIP_SINGLE_X)||new_error){
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_URL2,qbs_left(_FUNC_WHATISMYIP_STRING_URL,qbr(*_FUNC_WHATISMYIP_SINGLE_X- 1 )));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_URL2,qbs_left(_FUNC_WHATISMYIP_STRING_URL,qbr(*_FUNC_WHATISMYIP_SINGLE_X- 1 )));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
}
|
||||
*_FUNC_WHATISMYIP_SINGLE_CLIENT=func__openclient(qbs_add(qbs_new_txt_len("TCP/IP:80:",10),_FUNC_WHATISMYIP_STRING_URL2));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((-(*_FUNC_WHATISMYIP_SINGLE_CLIENT== 0 ))||new_error){
|
||||
goto exit_subfunc;
|
||||
goto exit_subfunc;
|
||||
}
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_E,qbs_add(func_chr( 13 ),func_chr( 10 )));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
|
@ -186,88 +148,44 @@ qbs* WHATISMYIP(){ //changed name from FUNC_WHATISMYIP to WHATISMYIP
|
|||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_add(qbs_add(qbs_add(qbs_add(_FUNC_WHATISMYIP_STRING_X,qbs_new_txt_len("Host: ",6)),_FUNC_WHATISMYIP_STRING_URL2),_FUNC_WHATISMYIP_STRING_E),_FUNC_WHATISMYIP_STRING_E));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
sub_put2(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),NULL,byte_element((uint64)_FUNC_WHATISMYIP_STRING_X->chr,_FUNC_WHATISMYIP_STRING_X->len,byte_element_21),0);
|
||||
sub_put2(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),NULL,byte_element((uint64)_FUNC_WHATISMYIP_STRING_X->chr,_FUNC_WHATISMYIP_STRING_X->len,byte_element_3),0);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
*_FUNC_WHATISMYIP_SINGLE_T=func_timer(NULL,0);
|
||||
do{
|
||||
sub__delay( 0.05E+0 );
|
||||
sub_get2(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),NULL,_FUNC_WHATISMYIP_STRING_A2,0);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_A,qbs_add(_FUNC_WHATISMYIP_STRING_A,_FUNC_WHATISMYIP_STRING_A2));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I=func_instr(NULL,_FUNC_WHATISMYIP_STRING_A,qbs_new_txt_len("Content-Length:",15),0);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((*_FUNC_WHATISMYIP_SINGLE_I)||new_error){
|
||||
*_FUNC_WHATISMYIP_SINGLE_I2=func_instr(qbr(*_FUNC_WHATISMYIP_SINGLE_I),_FUNC_WHATISMYIP_STRING_A,_FUNC_WHATISMYIP_STRING_E,1);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((*_FUNC_WHATISMYIP_SINGLE_I2)||new_error){
|
||||
*_FUNC_WHATISMYIP_SINGLE_L=func_val(func_mid(_FUNC_WHATISMYIP_STRING_A,qbr(*_FUNC_WHATISMYIP_SINGLE_I+ 15 ),qbr(*_FUNC_WHATISMYIP_SINGLE_I2-*_FUNC_WHATISMYIP_SINGLE_I- 14 ),1));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I3=func_instr(qbr(*_FUNC_WHATISMYIP_SINGLE_I2),_FUNC_WHATISMYIP_STRING_A,qbs_add(_FUNC_WHATISMYIP_STRING_E,_FUNC_WHATISMYIP_STRING_E),1);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((*_FUNC_WHATISMYIP_SINGLE_I3)||new_error){
|
||||
*_FUNC_WHATISMYIP_SINGLE_I3=*_FUNC_WHATISMYIP_SINGLE_I3+ 4 ;
|
||||
if ((qbs_cleanup(qbs_tmp_base,-(((float)((_FUNC_WHATISMYIP_STRING_A->len-*_FUNC_WHATISMYIP_SINGLE_I3+ 1 )))==((float)(*_FUNC_WHATISMYIP_SINGLE_L)))))||new_error){
|
||||
sub_close(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),1);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_D,func_mid(_FUNC_WHATISMYIP_STRING_A,qbr(*_FUNC_WHATISMYIP_SINGLE_I3),qbr(*_FUNC_WHATISMYIP_SINGLE_L),1));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I= 0 ;
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_new_txt_len("",0));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
fornext_value25= 1 ;
|
||||
fornext_finalvalue25=_FUNC_WHATISMYIP_STRING_D->len;
|
||||
fornext_step25= 1 ;
|
||||
if (fornext_step25<0) fornext_step_negative25=1; else fornext_step_negative25=0;
|
||||
if (new_error) goto fornext_error25;
|
||||
goto fornext_entrylabel25;
|
||||
while(1){
|
||||
fornext_value25=fornext_step25+(*_FUNC_WHATISMYIP_SINGLE_I2);
|
||||
fornext_entrylabel25:
|
||||
*_FUNC_WHATISMYIP_SINGLE_I2=fornext_value25;
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if (fornext_step_negative25){
|
||||
if (fornext_value25<fornext_finalvalue25) break;
|
||||
}else{
|
||||
if (fornext_value25>fornext_finalvalue25) break;
|
||||
}
|
||||
fornext_error25:;
|
||||
if ((qbs_cleanup(qbs_tmp_base,-(qbs_asc(_FUNC_WHATISMYIP_STRING_D,qbr(*_FUNC_WHATISMYIP_SINGLE_I2))== 46 )))||new_error){
|
||||
if ((qbs_cleanup(qbs_tmp_base,-(_FUNC_WHATISMYIP_STRING_X->len== 0 )))||new_error){
|
||||
goto exit_subfunc;
|
||||
}
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_new_txt_len("",0));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
*_FUNC_WHATISMYIP_SINGLE_I=*_FUNC_WHATISMYIP_SINGLE_I+ 1 ;
|
||||
if ((-(*_FUNC_WHATISMYIP_SINGLE_I> 3 ))||new_error){
|
||||
goto exit_subfunc;
|
||||
}
|
||||
}else{
|
||||
if (qbs_cleanup(qbs_tmp_base,(-(qbs_asc(_FUNC_WHATISMYIP_STRING_D,qbr(*_FUNC_WHATISMYIP_SINGLE_I2))< 48 ))|(-(qbs_asc(_FUNC_WHATISMYIP_STRING_D,qbr(*_FUNC_WHATISMYIP_SINGLE_I2))> 57 )))){
|
||||
goto exit_subfunc;
|
||||
}else{
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_X,qbs_add(_FUNC_WHATISMYIP_STRING_X,func_mid(_FUNC_WHATISMYIP_STRING_D,qbr(*_FUNC_WHATISMYIP_SINGLE_I2), 1 ,1)));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
}
|
||||
}
|
||||
fornext_continue_24:;
|
||||
}
|
||||
fornext_exit_24:;
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_WHATISMYIP,_FUNC_WHATISMYIP_STRING_D);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
goto exit_subfunc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dl_continue_22:;
|
||||
sub__delay( 0.05E+0 );
|
||||
sub_get2(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),NULL,_FUNC_WHATISMYIP_STRING_A2,0);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_A,qbs_add(_FUNC_WHATISMYIP_STRING_A,_FUNC_WHATISMYIP_STRING_A2));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((-(*_FUNC_WHATISMYIP_SINGLE_L== 0 ))||new_error){
|
||||
*_FUNC_WHATISMYIP_SINGLE_I=func_instr(NULL,_FUNC_WHATISMYIP_STRING_A,qbs_add(_FUNC_WHATISMYIP_STRING_E,_FUNC_WHATISMYIP_STRING_E),0);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((*_FUNC_WHATISMYIP_SINGLE_I)||new_error){
|
||||
*_FUNC_WHATISMYIP_SINGLE_I2=func_instr(qbr(*_FUNC_WHATISMYIP_SINGLE_I+ 4 ),_FUNC_WHATISMYIP_STRING_A,_FUNC_WHATISMYIP_STRING_E,1);
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
if ((*_FUNC_WHATISMYIP_SINGLE_I2)||new_error){
|
||||
*_FUNC_WHATISMYIP_SINGLE_L=func_val(qbs_add(qbs_new_txt_len("&H",2),func_mid(_FUNC_WHATISMYIP_STRING_A,qbr(*_FUNC_WHATISMYIP_SINGLE_I+ 4 ),qbr(*_FUNC_WHATISMYIP_SINGLE_I2-*_FUNC_WHATISMYIP_SINGLE_I- 2 ),1)));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_A,func_mid(_FUNC_WHATISMYIP_STRING_A,qbr(*_FUNC_WHATISMYIP_SINGLE_I+ 4 +*_FUNC_WHATISMYIP_SINGLE_I2-*_FUNC_WHATISMYIP_SINGLE_I- 2 ),NULL,0));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if ((qbs_cleanup(qbs_tmp_base,-(_FUNC_WHATISMYIP_STRING_A->len>=*_FUNC_WHATISMYIP_SINGLE_L)))||new_error){
|
||||
qbs_set(_FUNC_WHATISMYIP_STRING_WHATISMYIP,qbs_left(_FUNC_WHATISMYIP_STRING_A,qbr(*_FUNC_WHATISMYIP_SINGLE_L)));
|
||||
qbs_cleanup(qbs_tmp_base,0);
|
||||
sub_close(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),1);
|
||||
goto exit_subfunc;
|
||||
}
|
||||
}
|
||||
dl_continue_4:;
|
||||
}while((!(-(((float)((func_timer(NULL,0))))>((float)((*_FUNC_WHATISMYIP_SINGLE_T+ 5 ))))))&&(!new_error));
|
||||
dl_exit_22:;
|
||||
dl_exit_4:;
|
||||
sub_close(qbr(*_FUNC_WHATISMYIP_SINGLE_CLIENT),1);
|
||||
exit_subfunc:;
|
||||
free_mem_lock(sf_mem_lock);
|
||||
|
||||
|
||||
//"free1.txt"
|
||||
// include "free1.txt"
|
||||
qbs_free(_FUNC_WHATISMYIP_STRING_URL);
|
||||
qbs_free(_FUNC_WHATISMYIP_STRING_URL2);
|
||||
qbs_free(_FUNC_WHATISMYIP_STRING_E);
|
||||
|
@ -275,8 +193,7 @@ qbs* WHATISMYIP(){ //changed name from FUNC_WHATISMYIP to WHATISMYIP
|
|||
qbs_free(_FUNC_WHATISMYIP_STRING_X);
|
||||
qbs_free(_FUNC_WHATISMYIP_STRING_A2);
|
||||
qbs_free(_FUNC_WHATISMYIP_STRING_A);
|
||||
qbs_free(_FUNC_WHATISMYIP_STRING_D);
|
||||
|
||||
// end of "free1.txt"
|
||||
|
||||
if ((tmp_mem_static_pointer>=mem_static)&&(tmp_mem_static_pointer<=mem_static_limit)) mem_static_pointer=tmp_mem_static_pointer; else mem_static_pointer=mem_static;
|
||||
cmem_sp=tmp_cmem_sp;
|
||||
|
|
|
@ -34,12 +34,16 @@
|
|||
#error "Unknown system; refusing to build. Edit os.h if needed"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(QB64_MACOSX)
|
||||
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(QB64_MACOSX) || defined(__aarch64__)
|
||||
#define QB64_64
|
||||
#else
|
||||
#define QB64_32
|
||||
#endif
|
||||
|
||||
#if !defined(i386) && !defined(__x86_64__)
|
||||
#define QB64_NOT_X86
|
||||
#endif
|
||||
|
||||
/* common types (not quite an include guard, but allows an including
|
||||
* file to not have these included.
|
||||
*
|
||||
|
|
2
internal/c/parts/audio/conversion/os/osx/build.command
Normal file → Executable file
2
internal/c/parts/audio/conversion/os/osx/build.command
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -c ../../src/resample.c -o temp/resample.o
|
||||
clang -c ../../src/resample.c -o temp/resample.o
|
||||
ar rcs src.a temp/resample.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
|
|
2
internal/c/parts/audio/decode/mp3_mini/os/osx/build.command
Normal file → Executable file
2
internal/c/parts/audio/decode/mp3_mini/os/osx/build.command
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -c ../../src/minimp3.c -o temp/minimp3.o
|
||||
clang -c ../../src/minimp3.c -o temp/minimp3.o
|
||||
ar rcs src.a temp/minimp3.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
|
|
|
@ -54,10 +54,12 @@
|
|||
typedef unsigned __int64 uint64_t;
|
||||
typedef signed __int64 int64_t;
|
||||
#else
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef signed long long int64_t;
|
||||
// typedef __uint64_t uint64_t;
|
||||
// typedef __int64_t int64_t;
|
||||
#ifndef UINT64_MAX
|
||||
typedef unsigned long long uint64_t;
|
||||
#endif
|
||||
#ifndef INT64_MAX
|
||||
typedef signed long long int64_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
2
internal/c/parts/audio/decode/ogg/os/osx/build.command
Normal file → Executable file
2
internal/c/parts/audio/decode/ogg/os/osx/build.command
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
cd "$(dirname "$0")"
|
||||
gcc -c ../../src/stb_vorbis.c -o src.o
|
||||
clang -c ../../src/stb_vorbis.c -o src.o
|
||||
echo "Press any key to continue..."
|
||||
Pause()
|
||||
{
|
||||
|
|
|
@ -244,6 +244,61 @@ got_seq:
|
|||
return handle;
|
||||
}
|
||||
|
||||
mem_block func__memsound(int32 i,int32 targetChannel){
|
||||
|
||||
static mem_block b;
|
||||
|
||||
if (new_error) goto error;
|
||||
if (i<=0) goto error;
|
||||
|
||||
sndsetup();
|
||||
|
||||
static snd_struct *sn;
|
||||
sn = (snd_struct*)list_get(snd_handles, i);
|
||||
if (!sn){
|
||||
goto error;
|
||||
}
|
||||
if (!snd_allow_internal){
|
||||
if (sn->internal){
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (targetChannel<1 || targetChannel>sn->seq->channels) goto error;
|
||||
|
||||
if (sn->lock_id){
|
||||
b.lock_offset=(ptrszint)sn->lock_offset; b.lock_id=sn->lock_id;//get existing tag
|
||||
}else{
|
||||
new_mem_lock();
|
||||
mem_lock_tmp->type=5;//sound
|
||||
b.lock_offset=(ptrszint)mem_lock_tmp; b.lock_id=mem_lock_id;
|
||||
sn->lock_offset=(void*)mem_lock_tmp; sn->lock_id=mem_lock_id;//create tag
|
||||
}
|
||||
|
||||
if (targetChannel==1) {
|
||||
b.offset=(ptrszint)sn->seq->data_left;
|
||||
b.size=sn->seq->data_left_size;
|
||||
}
|
||||
|
||||
if (targetChannel==2) {
|
||||
b.offset=(ptrszint)sn->seq->data_right;
|
||||
b.size=sn->seq->data_right_size;
|
||||
}
|
||||
|
||||
b.type=0;//sn->bytes_per_pixel+128+1024+2048;//integer+unsigned+pixeltype
|
||||
b.elementsize=sn->seq->bits_per_sample/8;
|
||||
b.sound=i;
|
||||
|
||||
return b;
|
||||
error:
|
||||
b.offset=0;
|
||||
b.size=0;
|
||||
b.lock_offset=(ptrszint)mem_lock_base; b.lock_id=1073741821;//set invalid lock
|
||||
b.type=0;
|
||||
b.elementsize=0;
|
||||
b.sound=0;
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
void sub__sndplayfile(qbs *filename, int32 sync, double volume, int32 passed){
|
||||
if (new_error) return;
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
ifeq ("$(ROOTDIR)","")
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
else
|
||||
LOCAL_PATH := $(ROOTDIR)
|
||||
endif
|
||||
|
||||
ANALYZE ?= no
|
||||
ANALYZE_OUTPUT?=/dev/null
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
TARGET_ARCH_ABI ?=armeabi-v7a
|
||||
LOCAL_LDLIBS := -llog
|
||||
LOCAL_MODULE := openal
|
||||
LOCAL_ARM_MODE := arm
|
||||
CLANG_VERSION ?= 3.1
|
||||
ROOTDIR ?= $(LOCAL_PATH)
|
||||
OPENAL_DIR := OpenAL
|
||||
MODULE := openal
|
||||
MODULE_DST := obj/local/$(TARGET_ARCH_ABI)/objs/openal
|
||||
ifeq ("$(BINDIR)","")
|
||||
BINDIR := $(abspath $(ROOTDIR)/../obj/local/$(TARGET_ARCH_ABI)/objs/ )
|
||||
else
|
||||
BINDIR := $(abspath $(BINDIR) )
|
||||
endif
|
||||
|
||||
ANDROID_NDK_ROOT=/Developer/DestinyCloudFist/android-ndk-r8b
|
||||
|
||||
LOCAL_CFLAGS += -I$(ROOTDIR)/$(OPENAL_DIR) \
|
||||
-I$(ROOTDIR)/$(OPENAL_DIR)/include \
|
||||
-I$(ROOTDIR)/$(OPENAL_DIR)/OpenAL32/Include \
|
||||
-DAL_ALEXT_PROTOTYPES \
|
||||
-DANDROID \
|
||||
-fpic \
|
||||
-ffunction-sections \
|
||||
-funwind-tables \
|
||||
-fstack-protector \
|
||||
-fno-short-enums \
|
||||
-DHAVE_GCC_VISIBILITY \
|
||||
-O3 \
|
||||
-g \
|
||||
|
||||
LOCAL_LDLIBS += -Wl,--build-id -Bsymbolic -shared
|
||||
|
||||
# Default to Fixed-point math
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
# ARMv5, used fixed point math
|
||||
LOCAL_CFLAGS += -marm -DOPENAL_FIXED_POINT -DOPENAL_FIXED_POINT_SHIFT=16
|
||||
endif
|
||||
|
||||
|
||||
MAX_SOURCES_LOW ?= 4
|
||||
MAX_SOURCES_START ?= 8
|
||||
MAX_SOURCES_HIGH ?= 64
|
||||
LOCAL_CFLAGS += -DMAX_SOURCES_LOW=$(MAX_SOURCES_LOW) -DMAX_SOURCES_START=$(MAX_SOURCES_START) -DMAX_SOURCES_HIGH=$(MAX_SOURCES_HIGH)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(OPENAL_DIR)/Alc/android.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alAuxEffectSlot.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alBuffer.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alDatabuffer.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alEffect.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alError.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alExtension.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alFilter.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alListener.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alSource.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alState.c \
|
||||
$(OPENAL_DIR)/OpenAL32/alThunk.c \
|
||||
$(OPENAL_DIR)/Alc/ALc.c \
|
||||
$(OPENAL_DIR)/Alc/alcConfig.c \
|
||||
$(OPENAL_DIR)/Alc/alcEcho.c \
|
||||
$(OPENAL_DIR)/Alc/alcModulator.c \
|
||||
$(OPENAL_DIR)/Alc/alcReverb.c \
|
||||
$(OPENAL_DIR)/Alc/alcRing.c \
|
||||
$(OPENAL_DIR)/Alc/alcThread.c \
|
||||
$(OPENAL_DIR)/Alc/ALu.c \
|
||||
$(OPENAL_DIR)/Alc/bs2b.c \
|
||||
$(OPENAL_DIR)/Alc/null.c \
|
||||
$(OPENAL_DIR)/Alc/panning.c \
|
||||
$(OPENAL_DIR)/Alc/mixer.c \
|
||||
$(OPENAL_DIR)/Alc/audiotrack.c \
|
||||
|
||||
|
||||
# If building for versions after FROYO
|
||||
ifeq ($(POST_FROYO), yes)
|
||||
LOCAL_CFLAGS += -DPOST_FROYO -I$(ANDROID_NDK_ROOT)/platforms/android-9/arch-arm/usr/include/
|
||||
LOCAL_LDLIBS += -ldl -L$(ANDROID_NDK_ROOT)/platforms/android-9/arch-arm/usr/lib/
|
||||
LOCAL_SRC_FILES += $(OPENAL_DIR)/Alc/opensles.c
|
||||
endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
APP_ABI := $(TARGET_ARCH_ABI)
|
||||
# $(warning APP_ABI $(APP_ABI))
|
||||
# $(warning LOCAL_ARM_NEON $(LOCAL_ARM_NEON))
|
|
@ -1,825 +0,0 @@
|
|||
#ifndef AL_AL_H
|
||||
#define AL_AL_H
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#ifndef LOGI
|
||||
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"OpenAL",__VA_ARGS__)
|
||||
#endif
|
||||
#ifndef LOGE
|
||||
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"OpenAL",__VA_ARGS__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(AL_LIBTYPE_STATIC)
|
||||
#define AL_API
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
#if defined(AL_BUILD_LIBRARY)
|
||||
#define AL_API __declspec(dllexport)
|
||||
#else
|
||||
#define AL_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
|
||||
#define AL_API __attribute__((visibility("protected")))
|
||||
#else
|
||||
#define AL_API extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define AL_APIENTRY __cdecl
|
||||
#else
|
||||
#define AL_APIENTRY
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and
|
||||
* AL_ILLEGAL_COMMAND macros are deprecated, but are included for
|
||||
* applications porting code from AL 1.0
|
||||
*/
|
||||
#define OPENAL
|
||||
#define ALAPI AL_API
|
||||
#define ALAPIENTRY AL_APIENTRY
|
||||
#define AL_INVALID (-1)
|
||||
#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
|
||||
#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
|
||||
|
||||
#define AL_VERSION_1_0
|
||||
#define AL_VERSION_1_1
|
||||
|
||||
|
||||
/** 8-bit boolean */
|
||||
typedef char ALboolean;
|
||||
|
||||
/** character */
|
||||
typedef char ALchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
typedef signed char ALbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
typedef short ALshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
typedef int ALint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
typedef int ALsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
typedef int ALenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
typedef float ALfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
typedef double ALdouble;
|
||||
|
||||
#ifdef OPENAL_FIXED_POINT
|
||||
/* Apportable tries to define int64_t and int32_t if it thinks it is needed.
|
||||
* But this is breaking in a complex project involving both pure C and C++
|
||||
* something is triggering redefinition errors. The workaround seems to be just using stdint.h.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
/** Types and Macros for fixed-point math */
|
||||
#ifndef INT64_MAX
|
||||
typedef long long int64_t;
|
||||
#define INT64_MAX 9223372036854775807LL
|
||||
|
||||
#endif
|
||||
#ifndef INT32_MAX
|
||||
typedef int int32_t;
|
||||
#define INT32_MAX 2147483647
|
||||
#endif
|
||||
|
||||
// FIXME(apportable) make this int32_t
|
||||
typedef int64_t ALfp;
|
||||
typedef int64_t ALdfp;
|
||||
|
||||
#define ONE (1<<OPENAL_FIXED_POINT_SHIFT)
|
||||
#define TWO (2<<OPENAL_FIXED_POINT_SHIFT)
|
||||
|
||||
#define float2ALfp(x) ((ALfp)((x) * (1<<OPENAL_FIXED_POINT_SHIFT) + ((x)>=0 ? 0.5 : -0.5)))
|
||||
#define ALfp2float(x) ((float)(x) / (1<<OPENAL_FIXED_POINT_SHIFT))
|
||||
|
||||
#define double2ALdfp(x) ((ALdfp)((x) * (1<<OPENAL_FIXED_POINT_SHIFT) + ((x)>=0 ? 0.5 : -0.5)))
|
||||
#define ALdfp2double(x) ((double)(x) / (1<<OPENAL_FIXED_POINT_SHIFT))
|
||||
|
||||
#define int2ALfp(x) ((ALfp)(x) << OPENAL_FIXED_POINT_SHIFT)
|
||||
#define ALfp2int(x) ((ALint)((x) >> OPENAL_FIXED_POINT_SHIFT))
|
||||
|
||||
#define int2ALdfp(x) ((ALdfp)(x) << OPENAL_FIXED_POINT_SHIFT)
|
||||
#define ALdfp2int(x) ((ALint)((x) >> OPENAL_FIXED_POINT_SHIFT))
|
||||
|
||||
#define ALfpMult(x,y) ((ALfp)((((int64_t)(x))*((int64_t)(y)))>>OPENAL_FIXED_POINT_SHIFT))
|
||||
#define ALfpDiv(x,y) ((ALfp)(((int64_t)(x) << OPENAL_FIXED_POINT_SHIFT) / (y)))
|
||||
|
||||
#define ALdfpMult(x,y) ALfpMult(x,y)
|
||||
#define ALdfpDiv(x,y) ALfpDiv(x,y)
|
||||
|
||||
#define __isnan(x) (0)
|
||||
#define __cos(x) (float2ALfp(cos(ALfp2float(x))))
|
||||
#define __sin(x) (float2ALfp(sin(ALfp2float(x))))
|
||||
#define __log10(x) (float2ALfp(log10(ALfp2float(x))))
|
||||
#define __atan(x) (float2ALfp(atan(ALfp2float(x))))
|
||||
|
||||
#define toALfpConst(x) ((x)*(1<<OPENAL_FIXED_POINT_SHIFT))
|
||||
|
||||
#else
|
||||
typedef float ALfp;
|
||||
typedef double ALdfp;
|
||||
|
||||
#define float2ALfp(x) (x)
|
||||
#define ALfp2float(x) (x)
|
||||
|
||||
#define double2ALdfp(x) (x)
|
||||
#define ALdfp2double(x) (x)
|
||||
|
||||
#define int2ALfp(x) ((ALfp)(x))
|
||||
#define ALfp2int(x) ((ALint)(x))
|
||||
|
||||
#define int2ALdfp(x) ((ALdfp)(x))
|
||||
#define ALdfp2int(x) ((ALint)(x))
|
||||
|
||||
#define ALfpMult(x,y) ((x)*(y))
|
||||
#define ALfpDiv(x,y) ((x)/(y))
|
||||
|
||||
#define ALdfpMult(x,y) ALfpMult((x),(y))
|
||||
#define ALdfpDiv(x,y) ALfpDiv((x),(y))
|
||||
|
||||
#define __isnan(x) (0)
|
||||
#define __cos(x) cos((x))
|
||||
#define __sin(x) sin((x))
|
||||
#define __log10(x) log10((x))
|
||||
#define __atan(x) atan((x))
|
||||
|
||||
#define toALfpConst(x) (x)
|
||||
|
||||
#endif
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
typedef void ALvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
|
||||
/* "no distance model" or "no buffer" */
|
||||
#define AL_NONE 0
|
||||
|
||||
/* Boolean False. */
|
||||
#define AL_FALSE 0
|
||||
|
||||
/** Boolean True. */
|
||||
#define AL_TRUE 1
|
||||
|
||||
/** Indicate Source has relative coordinates. */
|
||||
#define AL_SOURCE_RELATIVE 0x202
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Directional source, inner cone angle, in degrees.
|
||||
* Range: [0-360]
|
||||
* Default: 360
|
||||
*/
|
||||
#define AL_CONE_INNER_ANGLE 0x1001
|
||||
|
||||
/**
|
||||
* Directional source, outer cone angle, in degrees.
|
||||
* Range: [0-360]
|
||||
* Default: 360
|
||||
*/
|
||||
#define AL_CONE_OUTER_ANGLE 0x1002
|
||||
|
||||
/**
|
||||
* Specify the pitch to be applied at source.
|
||||
* Range: [0.5-2.0]
|
||||
* Default: 1.0
|
||||
*/
|
||||
#define AL_PITCH 0x1003
|
||||
|
||||
/**
|
||||
* Specify the current location in three dimensional space.
|
||||
* OpenAL, like OpenGL, uses a right handed coordinate system,
|
||||
* where in a frontal default view X (thumb) points right,
|
||||
* Y points up (index finger), and Z points towards the
|
||||
* viewer/camera (middle finger).
|
||||
* To switch from a left handed coordinate system, flip the
|
||||
* sign on the Z coordinate.
|
||||
* Listener position is always in the world coordinate system.
|
||||
*/
|
||||
#define AL_POSITION 0x1004
|
||||
|
||||
/** Specify the current direction. */
|
||||
#define AL_DIRECTION 0x1005
|
||||
|
||||
/** Specify the current velocity in three dimensional space. */
|
||||
#define AL_VELOCITY 0x1006
|
||||
|
||||
/**
|
||||
* Indicate whether source is looping.
|
||||
* Type: ALboolean?
|
||||
* Range: [AL_TRUE, AL_FALSE]
|
||||
* Default: FALSE.
|
||||
*/
|
||||
#define AL_LOOPING 0x1007
|
||||
|
||||
/**
|
||||
* Indicate the buffer to provide sound samples.
|
||||
* Type: ALuint.
|
||||
* Range: any valid Buffer id.
|
||||
*/
|
||||
#define AL_BUFFER 0x1009
|
||||
|
||||
/**
|
||||
* Indicate the gain (volume amplification) applied.
|
||||
* Type: ALfloat.
|
||||
* Range: ]0.0- ]
|
||||
* A value of 1.0 means un-attenuated/unchanged.
|
||||
* Each division by 2 equals an attenuation of -6dB.
|
||||
* Each multiplicaton with 2 equals an amplification of +6dB.
|
||||
* A value of 0.0 is meaningless with respect to a logarithmic
|
||||
* scale; it is interpreted as zero volume - the channel
|
||||
* is effectively disabled.
|
||||
*/
|
||||
#define AL_GAIN 0x100A
|
||||
|
||||
/*
|
||||
* Indicate minimum source attenuation
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* Logarthmic
|
||||
*/
|
||||
#define AL_MIN_GAIN 0x100D
|
||||
|
||||
/**
|
||||
* Indicate maximum source attenuation
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* Logarthmic
|
||||
*/
|
||||
#define AL_MAX_GAIN 0x100E
|
||||
|
||||
/**
|
||||
* Indicate listener orientation.
|
||||
*
|
||||
* at/up
|
||||
*/
|
||||
#define AL_ORIENTATION 0x100F
|
||||
|
||||
/**
|
||||
* Source state information.
|
||||
*/
|
||||
#define AL_SOURCE_STATE 0x1010
|
||||
#define AL_INITIAL 0x1011
|
||||
#define AL_PLAYING 0x1012
|
||||
#define AL_PAUSED 0x1013
|
||||
#define AL_STOPPED 0x1014
|
||||
|
||||
/**
|
||||
* Buffer Queue params
|
||||
*/
|
||||
#define AL_BUFFERS_QUEUED 0x1015
|
||||
#define AL_BUFFERS_PROCESSED 0x1016
|
||||
|
||||
/**
|
||||
* Source buffer position information
|
||||
*/
|
||||
#define AL_SEC_OFFSET 0x1024
|
||||
#define AL_SAMPLE_OFFSET 0x1025
|
||||
#define AL_BYTE_OFFSET 0x1026
|
||||
|
||||
/*
|
||||
* Source type (Static, Streaming or undetermined)
|
||||
* Source is Static if a Buffer has been attached using AL_BUFFER
|
||||
* Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
|
||||
* Source is undetermined when it has the NULL buffer attached
|
||||
*/
|
||||
#define AL_SOURCE_TYPE 0x1027
|
||||
#define AL_STATIC 0x1028
|
||||
#define AL_STREAMING 0x1029
|
||||
#define AL_UNDETERMINED 0x1030
|
||||
|
||||
/** Sound samples: format specifier. */
|
||||
#define AL_FORMAT_MONO8 0x1100
|
||||
#define AL_FORMAT_MONO16 0x1101
|
||||
#define AL_FORMAT_STEREO8 0x1102
|
||||
#define AL_FORMAT_STEREO16 0x1103
|
||||
|
||||
/**
|
||||
* source specific reference distance
|
||||
* Type: ALfloat
|
||||
* Range: 0.0 - +inf
|
||||
*
|
||||
* At 0.0, no distance attenuation occurs. Default is
|
||||
* 1.0.
|
||||
*/
|
||||
#define AL_REFERENCE_DISTANCE 0x1020
|
||||
|
||||
/**
|
||||
* source specific rolloff factor
|
||||
* Type: ALfloat
|
||||
* Range: 0.0 - +inf
|
||||
*
|
||||
*/
|
||||
#define AL_ROLLOFF_FACTOR 0x1021
|
||||
|
||||
/**
|
||||
* Directional source, outer cone gain.
|
||||
*
|
||||
* Default: 0.0
|
||||
* Range: [0.0 - 1.0]
|
||||
* Logarithmic
|
||||
*/
|
||||
#define AL_CONE_OUTER_GAIN 0x1022
|
||||
|
||||
/**
|
||||
* Indicate distance above which sources are not
|
||||
* attenuated using the inverse clamped distance model.
|
||||
*
|
||||
* Default: +inf
|
||||
* Type: ALfloat
|
||||
* Range: 0.0 - +inf
|
||||
*/
|
||||
#define AL_MAX_DISTANCE 0x1023
|
||||
|
||||
/**
|
||||
* Sound samples: frequency, in units of Hertz [Hz].
|
||||
* This is the number of samples per second. Half of the
|
||||
* sample frequency marks the maximum significant
|
||||
* frequency component.
|
||||
*/
|
||||
#define AL_FREQUENCY 0x2001
|
||||
#define AL_BITS 0x2002
|
||||
#define AL_CHANNELS 0x2003
|
||||
#define AL_SIZE 0x2004
|
||||
|
||||
/**
|
||||
* Buffer state.
|
||||
*
|
||||
* Not supported for public use (yet).
|
||||
*/
|
||||
#define AL_UNUSED 0x2010
|
||||
#define AL_PENDING 0x2011
|
||||
#define AL_PROCESSED 0x2012
|
||||
|
||||
|
||||
/** Errors: No Error. */
|
||||
#define AL_NO_ERROR AL_FALSE
|
||||
|
||||
/**
|
||||
* Invalid Name paramater passed to AL call.
|
||||
*/
|
||||
#define AL_INVALID_NAME 0xA001
|
||||
|
||||
/**
|
||||
* Invalid parameter passed to AL call.
|
||||
*/
|
||||
#define AL_INVALID_ENUM 0xA002
|
||||
|
||||
/**
|
||||
* Invalid enum parameter value.
|
||||
*/
|
||||
#define AL_INVALID_VALUE 0xA003
|
||||
|
||||
/**
|
||||
* Illegal call.
|
||||
*/
|
||||
#define AL_INVALID_OPERATION 0xA004
|
||||
|
||||
|
||||
/**
|
||||
* No mojo.
|
||||
*/
|
||||
#define AL_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/** Context strings: Vendor Name. */
|
||||
#define AL_VENDOR 0xB001
|
||||
#define AL_VERSION 0xB002
|
||||
#define AL_RENDERER 0xB003
|
||||
#define AL_EXTENSIONS 0xB004
|
||||
|
||||
/** Global tweakage. */
|
||||
|
||||
/**
|
||||
* Doppler scale. Default 1.0
|
||||
*/
|
||||
#define AL_DOPPLER_FACTOR 0xC000
|
||||
|
||||
/**
|
||||
* Tweaks speed of propagation.
|
||||
*/
|
||||
#define AL_DOPPLER_VELOCITY 0xC001
|
||||
|
||||
/**
|
||||
* Speed of Sound in units per second
|
||||
*/
|
||||
#define AL_SPEED_OF_SOUND 0xC003
|
||||
|
||||
/**
|
||||
* Distance models
|
||||
*
|
||||
* used in conjunction with DistanceModel
|
||||
*
|
||||
* implicit: NONE, which disances distance attenuation.
|
||||
*/
|
||||
#define AL_DISTANCE_MODEL 0xD000
|
||||
#define AL_INVERSE_DISTANCE 0xD001
|
||||
#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
|
||||
#define AL_LINEAR_DISTANCE 0xD003
|
||||
#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
|
||||
#define AL_EXPONENT_DISTANCE 0xD005
|
||||
#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
|
||||
|
||||
/**
|
||||
* Priority
|
||||
*
|
||||
* Apportable Extension.
|
||||
* Used to prevent dynamic throttling of this source.
|
||||
*
|
||||
*/
|
||||
#define AL_PRIORITY 0xE001
|
||||
#define AL_PRIORITY_SLOTS 0xE002
|
||||
/*
|
||||
* Renderer State management
|
||||
*/
|
||||
AL_API void AL_APIENTRY alEnable( ALenum capability );
|
||||
|
||||
AL_API void AL_APIENTRY alDisable( ALenum capability );
|
||||
|
||||
AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
|
||||
|
||||
|
||||
/*
|
||||
* State retrieval
|
||||
*/
|
||||
AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
|
||||
|
||||
AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* data );
|
||||
|
||||
AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* data );
|
||||
|
||||
AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* data );
|
||||
|
||||
AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* data );
|
||||
|
||||
AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
|
||||
|
||||
AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
|
||||
|
||||
AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
|
||||
|
||||
AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
|
||||
|
||||
|
||||
/*
|
||||
* Error support.
|
||||
* Obtain the most recent error generated in the AL state machine.
|
||||
*/
|
||||
AL_API ALenum AL_APIENTRY alGetError( void );
|
||||
|
||||
|
||||
/*
|
||||
* Extension support.
|
||||
* Query for the presence of an extension, and obtain any appropriate
|
||||
* function pointers and enum values.
|
||||
*/
|
||||
AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
|
||||
|
||||
AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
|
||||
|
||||
AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
|
||||
|
||||
|
||||
/*
|
||||
* LISTENER
|
||||
* Listener represents the location and orientation of the
|
||||
* 'user' in 3D-space.
|
||||
*
|
||||
* Properties include: -
|
||||
*
|
||||
* Gain AL_GAIN ALfloat
|
||||
* Position AL_POSITION ALfloat[3]
|
||||
* Velocity AL_VELOCITY ALfloat[3]
|
||||
* Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Set Listener parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value );
|
||||
|
||||
AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
|
||||
|
||||
/*
|
||||
* Get Listener parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value );
|
||||
|
||||
AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alGetListeneri( ALenum param, ALint* value );
|
||||
|
||||
AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values );
|
||||
|
||||
|
||||
/**
|
||||
* SOURCE
|
||||
* Sources represent individual sound objects in 3D-space.
|
||||
* Sources take the PCM data provided in the specified Buffer,
|
||||
* apply Source-specific modifications, and then
|
||||
* submit them to be mixed according to spatial arrangement etc.
|
||||
*
|
||||
* Properties include: -
|
||||
*
|
||||
* Gain AL_GAIN ALfloat
|
||||
* Min Gain AL_MIN_GAIN ALfloat
|
||||
* Max Gain AL_MAX_GAIN ALfloat
|
||||
* Position AL_POSITION ALfloat[3]
|
||||
* Velocity AL_VELOCITY ALfloat[3]
|
||||
* Direction AL_DIRECTION ALfloat[3]
|
||||
* Head Relative Mode AL_SOURCE_RELATIVE ALint (AL_TRUE or AL_FALSE)
|
||||
* Reference Distance AL_REFERENCE_DISTANCE ALfloat
|
||||
* Max Distance AL_MAX_DISTANCE ALfloat
|
||||
* RollOff Factor AL_ROLLOFF_FACTOR ALfloat
|
||||
* Inner Angle AL_CONE_INNER_ANGLE ALint or ALfloat
|
||||
* Outer Angle AL_CONE_OUTER_ANGLE ALint or ALfloat
|
||||
* Cone Outer Gain AL_CONE_OUTER_GAIN ALint or ALfloat
|
||||
* Pitch AL_PITCH ALfloat
|
||||
* Looping AL_LOOPING ALint (AL_TRUE or AL_FALSE)
|
||||
* MS Offset AL_MSEC_OFFSET ALint or ALfloat
|
||||
* Byte Offset AL_BYTE_OFFSET ALint or ALfloat
|
||||
* Sample Offset AL_SAMPLE_OFFSET ALint or ALfloat
|
||||
* Attached Buffer AL_BUFFER ALint
|
||||
* State (Query only) AL_SOURCE_STATE ALint
|
||||
* Buffers Queued (Query only) AL_BUFFERS_QUEUED ALint
|
||||
* Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
|
||||
*/
|
||||
|
||||
/* Create Source objects */
|
||||
AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* sources );
|
||||
|
||||
/* Delete Source objects */
|
||||
AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* sources );
|
||||
|
||||
/* Verify a handle is a valid Source */
|
||||
AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid );
|
||||
|
||||
/*
|
||||
* Set Source parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
|
||||
|
||||
AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values );
|
||||
|
||||
/*
|
||||
* Get Source parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
|
||||
|
||||
AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
||||
|
||||
AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value );
|
||||
|
||||
AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
||||
|
||||
AL_API void AL_APIENTRY alGetSourceiv( ALuint sid, ALenum param, ALint* values );
|
||||
|
||||
|
||||
/*
|
||||
* Source vector based playback calls
|
||||
*/
|
||||
|
||||
/* Play, replay, or resume (if paused) a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids );
|
||||
|
||||
/* Stop a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids );
|
||||
|
||||
/* Rewind a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids );
|
||||
|
||||
/* Pause a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids );
|
||||
|
||||
/*
|
||||
* Source based playback calls
|
||||
*/
|
||||
|
||||
/* Play, replay, or resume a Source */
|
||||
AL_API void AL_APIENTRY alSourcePlay( ALuint sid );
|
||||
|
||||
/* Stop a Source */
|
||||
AL_API void AL_APIENTRY alSourceStop( ALuint sid );
|
||||
|
||||
/* Rewind a Source (set playback postiton to beginning) */
|
||||
AL_API void AL_APIENTRY alSourceRewind( ALuint sid );
|
||||
|
||||
/* Pause a Source */
|
||||
AL_API void AL_APIENTRY alSourcePause( ALuint sid );
|
||||
|
||||
/*
|
||||
* Source Queuing
|
||||
*/
|
||||
AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids );
|
||||
|
||||
AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
|
||||
|
||||
|
||||
/**
|
||||
* BUFFER
|
||||
* Buffer objects are storage space for sample data.
|
||||
* Buffers are referred to by Sources. One Buffer can be used
|
||||
* by multiple Sources.
|
||||
*
|
||||
* Properties include: -
|
||||
*
|
||||
* Frequency (Query only) AL_FREQUENCY ALint
|
||||
* Size (Query only) AL_SIZE ALint
|
||||
* Bits (Query only) AL_BITS ALint
|
||||
* Channels (Query only) AL_CHANNELS ALint
|
||||
*/
|
||||
|
||||
/* Create Buffer objects */
|
||||
AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* buffers );
|
||||
|
||||
/* Delete Buffer objects */
|
||||
AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* buffers );
|
||||
|
||||
/* Verify a handle is a valid Buffer */
|
||||
AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
|
||||
|
||||
/* Specify the data to be copied into a buffer */
|
||||
AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
|
||||
|
||||
/*
|
||||
* Set Buffer parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alBufferf( ALuint bid, ALenum param, ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alBufferfv( ALuint bid, ALenum param, const ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alBufferi( ALuint bid, ALenum param, ALint value );
|
||||
|
||||
AL_API void AL_APIENTRY alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alBufferiv( ALuint bid, ALenum param, const ALint* values );
|
||||
|
||||
/*
|
||||
* Get Buffer parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
|
||||
|
||||
AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
||||
|
||||
AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
|
||||
|
||||
AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
||||
|
||||
AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values );
|
||||
|
||||
|
||||
/*
|
||||
* Global Parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alDopplerFactor( ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
|
||||
|
||||
/*
|
||||
* Pointer-to-function types, useful for dynamically getting AL entry points.
|
||||
*/
|
||||
typedef void (AL_APIENTRY *LPALENABLE)( ALenum capability );
|
||||
typedef void (AL_APIENTRY *LPALDISABLE)( ALenum capability );
|
||||
typedef ALboolean (AL_APIENTRY *LPALISENABLED)( ALenum capability );
|
||||
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)( ALenum param );
|
||||
typedef void (AL_APIENTRY *LPALGETBOOLEANV)( ALenum param, ALboolean* data );
|
||||
typedef void (AL_APIENTRY *LPALGETINTEGERV)( ALenum param, ALint* data );
|
||||
typedef void (AL_APIENTRY *LPALGETFLOATV)( ALenum param, ALfloat* data );
|
||||
typedef void (AL_APIENTRY *LPALGETDOUBLEV)( ALenum param, ALdouble* data );
|
||||
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)( ALenum param );
|
||||
typedef ALint (AL_APIENTRY *LPALGETINTEGER)( ALenum param );
|
||||
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)( ALenum param );
|
||||
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)( ALenum param );
|
||||
typedef ALenum (AL_APIENTRY *LPALGETERROR)( void );
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar* extname );
|
||||
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)( const ALchar* fname );
|
||||
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)( const ALchar* ename );
|
||||
typedef void (AL_APIENTRY *LPALLISTENERF)( ALenum param, ALfloat value );
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3F)( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
typedef void (AL_APIENTRY *LPALLISTENERFV)( ALenum param, const ALfloat* values );
|
||||
typedef void (AL_APIENTRY *LPALLISTENERI)( ALenum param, ALint value );
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
typedef void (AL_APIENTRY *LPALLISTENERIV)( ALenum param, const ALint* values );
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERF)( ALenum param, ALfloat* value );
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3F)( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERFV)( ALenum param, ALfloat* values );
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERI)( ALenum param, ALint* value );
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERIV)( ALenum param, ALint* values );
|
||||
typedef void (AL_APIENTRY *LPALGENSOURCES)( ALsizei n, ALuint* sources );
|
||||
typedef void (AL_APIENTRY *LPALDELETESOURCES)( ALsizei n, const ALuint* sources );
|
||||
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)( ALuint sid );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEF)( ALuint sid, ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3F)( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEFV)( ALuint sid, ALenum param, const ALfloat* values );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEI)( ALuint sid, ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEIV)( ALuint sid, ALenum param, const ALint* values );
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEF)( ALuint sid, ALenum param, ALfloat* value );
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3F)( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEFV)( ALuint sid, ALenum param, ALfloat* values );
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEI)( ALuint sid, ALenum param, ALint* value );
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEIV)( ALuint sid, ALenum param, ALint* values );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)( ALsizei ns, const ALuint *sids );
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOPV)( ALsizei ns, const ALuint *sids );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)( ALsizei ns, const ALuint *sids );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)( ALsizei ns, const ALuint *sids );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAY)( ALuint sid );
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOP)( ALuint sid );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWIND)( ALuint sid );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)( ALuint sid );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, const ALuint *bids );
|
||||
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids );
|
||||
typedef void (AL_APIENTRY *LPALGENBUFFERS)( ALsizei n, ALuint* buffers );
|
||||
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)( ALsizei n, const ALuint* buffers );
|
||||
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)( ALuint bid );
|
||||
typedef void (AL_APIENTRY *LPALBUFFERDATA)( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
|
||||
typedef void (AL_APIENTRY *LPALBUFFERF)( ALuint bid, ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
typedef void (AL_APIENTRY *LPALBUFFERFV)( ALuint bid, ALenum param, const ALfloat* values );
|
||||
typedef void (AL_APIENTRY *LPALBUFFERI)( ALuint bid, ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
typedef void (AL_APIENTRY *LPALBUFFERIV)( ALuint bid, ALenum param, const ALint* values );
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERF)( ALuint bid, ALenum param, ALfloat* value );
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERI)( ALuint bid, ALenum param, ALint* value );
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERIV)( ALuint bid, ALenum param, ALint* values );
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)( ALfloat value );
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)( ALfloat value );
|
||||
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)( ALfloat value );
|
||||
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)( ALenum distanceModel );
|
||||
|
||||
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||
#pragma export off
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* AL_AL_H */
|
|
@ -1,285 +0,0 @@
|
|||
#ifndef AL_ALC_H
|
||||
#define AL_ALC_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(AL_LIBTYPE_STATIC)
|
||||
#define ALC_API
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
#if defined(AL_BUILD_LIBRARY)
|
||||
#define ALC_API __declspec(dllexport)
|
||||
#else
|
||||
#define ALC_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
|
||||
#define ALC_API __attribute__((visibility("protected")))
|
||||
#else
|
||||
#define ALC_API extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define ALC_APIENTRY __cdecl
|
||||
#else
|
||||
#define ALC_APIENTRY
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
|
||||
* included for applications porting code from AL 1.0
|
||||
*/
|
||||
#define ALCAPI ALC_API
|
||||
#define ALCAPIENTRY ALC_APIENTRY
|
||||
#define ALC_INVALID 0
|
||||
|
||||
|
||||
#define ALC_VERSION_0_1 1
|
||||
|
||||
typedef struct ALCdevice_struct ALCdevice;
|
||||
typedef struct ALCcontext_struct ALCcontext;
|
||||
|
||||
|
||||
/** 8-bit boolean */
|
||||
typedef char ALCboolean;
|
||||
|
||||
/** character */
|
||||
typedef char ALCchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
typedef signed char ALCbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALCubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
typedef short ALCshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALCushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
typedef int ALCint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALCuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
typedef int ALCsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
typedef int ALCenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
typedef float ALCfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
typedef double ALCdouble;
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
typedef void ALCvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
|
||||
/* Boolean False. */
|
||||
#define ALC_FALSE 0
|
||||
|
||||
/* Boolean True. */
|
||||
#define ALC_TRUE 1
|
||||
|
||||
/**
|
||||
* followed by <int> Hz
|
||||
*/
|
||||
#define ALC_FREQUENCY 0x1007
|
||||
|
||||
/**
|
||||
* followed by <int> Hz
|
||||
*/
|
||||
#define ALC_REFRESH 0x1008
|
||||
|
||||
/**
|
||||
* followed by AL_TRUE, AL_FALSE
|
||||
*/
|
||||
#define ALC_SYNC 0x1009
|
||||
|
||||
/**
|
||||
* followed by <int> Num of requested Mono (3D) Sources
|
||||
*/
|
||||
#define ALC_MONO_SOURCES 0x1010
|
||||
|
||||
/**
|
||||
* followed by <int> Num of requested Stereo Sources
|
||||
*/
|
||||
#define ALC_STEREO_SOURCES 0x1011
|
||||
|
||||
/**
|
||||
* errors
|
||||
*/
|
||||
|
||||
/**
|
||||
* No error
|
||||
*/
|
||||
#define ALC_NO_ERROR ALC_FALSE
|
||||
|
||||
/**
|
||||
* No device
|
||||
*/
|
||||
#define ALC_INVALID_DEVICE 0xA001
|
||||
|
||||
/**
|
||||
* invalid context ID
|
||||
*/
|
||||
#define ALC_INVALID_CONTEXT 0xA002
|
||||
|
||||
/**
|
||||
* bad enum
|
||||
*/
|
||||
#define ALC_INVALID_ENUM 0xA003
|
||||
|
||||
/**
|
||||
* bad value
|
||||
*/
|
||||
#define ALC_INVALID_VALUE 0xA004
|
||||
|
||||
/**
|
||||
* Out of memory.
|
||||
*/
|
||||
#define ALC_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/**
|
||||
* The Specifier string for default device
|
||||
*/
|
||||
#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
|
||||
#define ALC_DEVICE_SPECIFIER 0x1005
|
||||
#define ALC_EXTENSIONS 0x1006
|
||||
|
||||
#define ALC_MAJOR_VERSION 0x1000
|
||||
#define ALC_MINOR_VERSION 0x1001
|
||||
|
||||
#define ALC_ATTRIBUTES_SIZE 0x1002
|
||||
#define ALC_ALL_ATTRIBUTES 0x1003
|
||||
|
||||
|
||||
/**
|
||||
* Capture extension
|
||||
*/
|
||||
#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
|
||||
#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
|
||||
#define ALC_CAPTURE_SAMPLES 0x312
|
||||
|
||||
|
||||
/*
|
||||
* Context Management
|
||||
*/
|
||||
ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
|
||||
|
||||
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
|
||||
|
||||
ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
|
||||
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
|
||||
|
||||
|
||||
/*
|
||||
* Device Management
|
||||
*/
|
||||
ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
|
||||
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
|
||||
|
||||
|
||||
/*
|
||||
* Error support.
|
||||
* Obtain the most recent Context error
|
||||
*/
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
|
||||
|
||||
|
||||
/*
|
||||
* Extension support.
|
||||
* Query for the presence of an extension, and obtain any appropriate
|
||||
* function pointers and enum values.
|
||||
*/
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
|
||||
|
||||
ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
|
||||
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
|
||||
|
||||
|
||||
/*
|
||||
* Query functions
|
||||
*/
|
||||
ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
|
||||
|
||||
|
||||
/*
|
||||
* Capture functions
|
||||
*/
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
|
||||
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
|
||||
|
||||
ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
|
||||
|
||||
/*
|
||||
* Pointer-to-function types, useful for dynamically getting ALC entry points.
|
||||
*/
|
||||
typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
|
||||
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
|
||||
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
|
||||
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
|
||||
typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
|
||||
typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
|
||||
typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
|
||||
typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
|
||||
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
|
||||
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
|
||||
typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
|
||||
|
||||
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||
#pragma export off
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
/*
|
||||
* OpenAL extension for suspend/resume of audio throughout application lifecycle
|
||||
*/
|
||||
ALC_API void ALC_APIENTRY alcSuspend( void );
|
||||
ALC_API void ALC_APIENTRY alcResume( void );
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AL_ALC_H */
|
|
@ -1,165 +0,0 @@
|
|||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 2008 by authors.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#ifndef AL_ALEXT_H
|
||||
#define AL_ALEXT_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef AL_LOKI_IMA_ADPCM_format
|
||||
#define AL_LOKI_IMA_ADPCM_format 1
|
||||
#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000
|
||||
#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001
|
||||
#endif
|
||||
|
||||
#ifndef AL_LOKI_WAVE_format
|
||||
#define AL_LOKI_WAVE_format 1
|
||||
#define AL_FORMAT_WAVE_EXT 0x10002
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_vorbis
|
||||
#define AL_EXT_vorbis 1
|
||||
#define AL_FORMAT_VORBIS_EXT 0x10003
|
||||
#endif
|
||||
|
||||
#ifndef AL_LOKI_quadriphonic
|
||||
#define AL_LOKI_quadriphonic 1
|
||||
#define AL_FORMAT_QUAD8_LOKI 0x10004
|
||||
#define AL_FORMAT_QUAD16_LOKI 0x10005
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_float32
|
||||
#define AL_EXT_float32 1
|
||||
#define AL_FORMAT_MONO_FLOAT32 0x10010
|
||||
#define AL_FORMAT_STEREO_FLOAT32 0x10011
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_double
|
||||
#define AL_EXT_double 1
|
||||
#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012
|
||||
#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013
|
||||
#endif
|
||||
|
||||
#ifndef ALC_LOKI_audio_channel
|
||||
#define ALC_LOKI_audio_channel 1
|
||||
#define ALC_CHAN_MAIN_LOKI 0x500001
|
||||
#define ALC_CHAN_PCM_LOKI 0x500002
|
||||
#define ALC_CHAN_CD_LOKI 0x500003
|
||||
#endif
|
||||
|
||||
#ifndef ALC_ENUMERATE_ALL_EXT
|
||||
#define ALC_ENUMERATE_ALL_EXT 1
|
||||
#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
|
||||
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MCFORMATS
|
||||
#define AL_EXT_MCFORMATS 1
|
||||
#define AL_FORMAT_QUAD8 0x1204
|
||||
#define AL_FORMAT_QUAD16 0x1205
|
||||
#define AL_FORMAT_QUAD32 0x1206
|
||||
#define AL_FORMAT_REAR8 0x1207
|
||||
#define AL_FORMAT_REAR16 0x1208
|
||||
#define AL_FORMAT_REAR32 0x1209
|
||||
#define AL_FORMAT_51CHN8 0x120A
|
||||
#define AL_FORMAT_51CHN16 0x120B
|
||||
#define AL_FORMAT_51CHN32 0x120C
|
||||
#define AL_FORMAT_61CHN8 0x120D
|
||||
#define AL_FORMAT_61CHN16 0x120E
|
||||
#define AL_FORMAT_61CHN32 0x120F
|
||||
#define AL_FORMAT_71CHN8 0x1210
|
||||
#define AL_FORMAT_71CHN16 0x1211
|
||||
#define AL_FORMAT_71CHN32 0x1212
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MULAW_MCFORMATS
|
||||
#define AL_EXT_MULAW_MCFORMATS 1
|
||||
#define AL_FORMAT_MONO_MULAW 0x10014
|
||||
#define AL_FORMAT_STEREO_MULAW 0x10015
|
||||
#define AL_FORMAT_QUAD_MULAW 0x10021
|
||||
#define AL_FORMAT_REAR_MULAW 0x10022
|
||||
#define AL_FORMAT_51CHN_MULAW 0x10023
|
||||
#define AL_FORMAT_61CHN_MULAW 0x10024
|
||||
#define AL_FORMAT_71CHN_MULAW 0x10025
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_IMA4
|
||||
#define AL_EXT_IMA4 1
|
||||
#define AL_FORMAT_MONO_IMA4 0x1300
|
||||
#define AL_FORMAT_STEREO_IMA4 0x1301
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_STATIC_BUFFER
|
||||
#define AL_EXT_STATIC_BUFFER 1
|
||||
typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_EFX
|
||||
#define ALC_EXT_EFX 1
|
||||
#include "efx.h"
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_disconnect
|
||||
#define ALC_EXT_disconnect 1
|
||||
#define ALC_CONNECTED 0x313
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_thread_local_context
|
||||
#define ALC_EXT_thread_local_context 1
|
||||
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context);
|
||||
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context);
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_source_distance_model
|
||||
#define AL_EXT_source_distance_model 1
|
||||
#define AL_SOURCE_DISTANCE_MODEL 0x200
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_buffer_sub_data
|
||||
#define AL_SOFT_buffer_sub_data 1
|
||||
#define AL_BYTE_RW_OFFSETS_SOFT 0x1031
|
||||
#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032
|
||||
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_loop_points
|
||||
#define AL_SOFT_loop_points 1
|
||||
#define AL_LOOP_POINTS_SOFT 0x2015
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,3 +0,0 @@
|
|||
/* The tokens that would be defined here are already defined in efx.h. This
|
||||
* empty file is here to provide compatibility with Windows-based projects
|
||||
* that would include it. */
|
|
@ -1,758 +0,0 @@
|
|||
#ifndef AL_EFX_H
|
||||
#define AL_EFX_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ALC_EXT_EFX_NAME "ALC_EXT_EFX"
|
||||
|
||||
#define ALC_EFX_MAJOR_VERSION 0x20001
|
||||
#define ALC_EFX_MINOR_VERSION 0x20002
|
||||
#define ALC_MAX_AUXILIARY_SENDS 0x20003
|
||||
|
||||
|
||||
/* Listener properties. */
|
||||
#define AL_METERS_PER_UNIT 0x20004
|
||||
|
||||
/* Source properties. */
|
||||
#define AL_DIRECT_FILTER 0x20005
|
||||
#define AL_AUXILIARY_SEND_FILTER 0x20006
|
||||
#define AL_AIR_ABSORPTION_FACTOR 0x20007
|
||||
#define AL_ROOM_ROLLOFF_FACTOR 0x20008
|
||||
#define AL_CONE_OUTER_GAINHF 0x20009
|
||||
#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A
|
||||
#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B
|
||||
#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C
|
||||
|
||||
|
||||
/* Effect properties. */
|
||||
|
||||
/* Reverb effect parameters */
|
||||
#define AL_REVERB_DENSITY 0x0001
|
||||
#define AL_REVERB_DIFFUSION 0x0002
|
||||
#define AL_REVERB_GAIN 0x0003
|
||||
#define AL_REVERB_GAINHF 0x0004
|
||||
#define AL_REVERB_DECAY_TIME 0x0005
|
||||
#define AL_REVERB_DECAY_HFRATIO 0x0006
|
||||
#define AL_REVERB_REFLECTIONS_GAIN 0x0007
|
||||
#define AL_REVERB_REFLECTIONS_DELAY 0x0008
|
||||
#define AL_REVERB_LATE_REVERB_GAIN 0x0009
|
||||
#define AL_REVERB_LATE_REVERB_DELAY 0x000A
|
||||
#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B
|
||||
#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C
|
||||
#define AL_REVERB_DECAY_HFLIMIT 0x000D
|
||||
|
||||
/* EAX Reverb effect parameters */
|
||||
#define AL_EAXREVERB_DENSITY 0x0001
|
||||
#define AL_EAXREVERB_DIFFUSION 0x0002
|
||||
#define AL_EAXREVERB_GAIN 0x0003
|
||||
#define AL_EAXREVERB_GAINHF 0x0004
|
||||
#define AL_EAXREVERB_GAINLF 0x0005
|
||||
#define AL_EAXREVERB_DECAY_TIME 0x0006
|
||||
#define AL_EAXREVERB_DECAY_HFRATIO 0x0007
|
||||
#define AL_EAXREVERB_DECAY_LFRATIO 0x0008
|
||||
#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009
|
||||
#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A
|
||||
#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B
|
||||
#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C
|
||||
#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D
|
||||
#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E
|
||||
#define AL_EAXREVERB_ECHO_TIME 0x000F
|
||||
#define AL_EAXREVERB_ECHO_DEPTH 0x0010
|
||||
#define AL_EAXREVERB_MODULATION_TIME 0x0011
|
||||
#define AL_EAXREVERB_MODULATION_DEPTH 0x0012
|
||||
#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013
|
||||
#define AL_EAXREVERB_HFREFERENCE 0x0014
|
||||
#define AL_EAXREVERB_LFREFERENCE 0x0015
|
||||
#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016
|
||||
#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017
|
||||
|
||||
/* Chorus effect parameters */
|
||||
#define AL_CHORUS_WAVEFORM 0x0001
|
||||
#define AL_CHORUS_PHASE 0x0002
|
||||
#define AL_CHORUS_RATE 0x0003
|
||||
#define AL_CHORUS_DEPTH 0x0004
|
||||
#define AL_CHORUS_FEEDBACK 0x0005
|
||||
#define AL_CHORUS_DELAY 0x0006
|
||||
|
||||
/* Distortion effect parameters */
|
||||
#define AL_DISTORTION_EDGE 0x0001
|
||||
#define AL_DISTORTION_GAIN 0x0002
|
||||
#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003
|
||||
#define AL_DISTORTION_EQCENTER 0x0004
|
||||
#define AL_DISTORTION_EQBANDWIDTH 0x0005
|
||||
|
||||
/* Echo effect parameters */
|
||||
#define AL_ECHO_DELAY 0x0001
|
||||
#define AL_ECHO_LRDELAY 0x0002
|
||||
#define AL_ECHO_DAMPING 0x0003
|
||||
#define AL_ECHO_FEEDBACK 0x0004
|
||||
#define AL_ECHO_SPREAD 0x0005
|
||||
|
||||
/* Flanger effect parameters */
|
||||
#define AL_FLANGER_WAVEFORM 0x0001
|
||||
#define AL_FLANGER_PHASE 0x0002
|
||||
#define AL_FLANGER_RATE 0x0003
|
||||
#define AL_FLANGER_DEPTH 0x0004
|
||||
#define AL_FLANGER_FEEDBACK 0x0005
|
||||
#define AL_FLANGER_DELAY 0x0006
|
||||
|
||||
/* Frequency shifter effect parameters */
|
||||
#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001
|
||||
#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002
|
||||
#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003
|
||||
|
||||
/* Vocal morpher effect parameters */
|
||||
#define AL_VOCAL_MORPHER_PHONEMEA 0x0001
|
||||
#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002
|
||||
#define AL_VOCAL_MORPHER_PHONEMEB 0x0003
|
||||
#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM 0x0005
|
||||
#define AL_VOCAL_MORPHER_RATE 0x0006
|
||||
|
||||
/* Pitchshifter effect parameters */
|
||||
#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001
|
||||
#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002
|
||||
|
||||
/* Ringmodulator effect parameters */
|
||||
#define AL_RING_MODULATOR_FREQUENCY 0x0001
|
||||
#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002
|
||||
#define AL_RING_MODULATOR_WAVEFORM 0x0003
|
||||
|
||||
/* Autowah effect parameters */
|
||||
#define AL_AUTOWAH_ATTACK_TIME 0x0001
|
||||
#define AL_AUTOWAH_RELEASE_TIME 0x0002
|
||||
#define AL_AUTOWAH_RESONANCE 0x0003
|
||||
#define AL_AUTOWAH_PEAK_GAIN 0x0004
|
||||
|
||||
/* Compressor effect parameters */
|
||||
#define AL_COMPRESSOR_ONOFF 0x0001
|
||||
|
||||
/* Equalizer effect parameters */
|
||||
#define AL_EQUALIZER_LOW_GAIN 0x0001
|
||||
#define AL_EQUALIZER_LOW_CUTOFF 0x0002
|
||||
#define AL_EQUALIZER_MID1_GAIN 0x0003
|
||||
#define AL_EQUALIZER_MID1_CENTER 0x0004
|
||||
#define AL_EQUALIZER_MID1_WIDTH 0x0005
|
||||
#define AL_EQUALIZER_MID2_GAIN 0x0006
|
||||
#define AL_EQUALIZER_MID2_CENTER 0x0007
|
||||
#define AL_EQUALIZER_MID2_WIDTH 0x0008
|
||||
#define AL_EQUALIZER_HIGH_GAIN 0x0009
|
||||
#define AL_EQUALIZER_HIGH_CUTOFF 0x000A
|
||||
|
||||
/* Effect type */
|
||||
#define AL_EFFECT_FIRST_PARAMETER 0x0000
|
||||
#define AL_EFFECT_LAST_PARAMETER 0x8000
|
||||
#define AL_EFFECT_TYPE 0x8001
|
||||
|
||||
/* Effect types, used with the AL_EFFECT_TYPE property */
|
||||
#define AL_EFFECT_NULL 0x0000
|
||||
#define AL_EFFECT_REVERB 0x0001
|
||||
#define AL_EFFECT_CHORUS 0x0002
|
||||
#define AL_EFFECT_DISTORTION 0x0003
|
||||
#define AL_EFFECT_ECHO 0x0004
|
||||
#define AL_EFFECT_FLANGER 0x0005
|
||||
#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006
|
||||
#define AL_EFFECT_VOCAL_MORPHER 0x0007
|
||||
#define AL_EFFECT_PITCH_SHIFTER 0x0008
|
||||
#define AL_EFFECT_RING_MODULATOR 0x0009
|
||||
#define AL_EFFECT_AUTOWAH 0x000A
|
||||
#define AL_EFFECT_COMPRESSOR 0x000B
|
||||
#define AL_EFFECT_EQUALIZER 0x000C
|
||||
#define AL_EFFECT_EAXREVERB 0x8000
|
||||
|
||||
/* Auxiliary Effect Slot properties. */
|
||||
#define AL_EFFECTSLOT_EFFECT 0x0001
|
||||
#define AL_EFFECTSLOT_GAIN 0x0002
|
||||
#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003
|
||||
|
||||
/* NULL Auxiliary Slot ID to disable a source send. */
|
||||
#define AL_EFFECTSLOT_NULL 0x0000
|
||||
|
||||
|
||||
/* Filter properties. */
|
||||
|
||||
/* Lowpass filter parameters */
|
||||
#define AL_LOWPASS_GAIN 0x0001
|
||||
#define AL_LOWPASS_GAINHF 0x0002
|
||||
|
||||
/* Highpass filter parameters */
|
||||
#define AL_HIGHPASS_GAIN 0x0001
|
||||
#define AL_HIGHPASS_GAINLF 0x0002
|
||||
|
||||
/* Bandpass filter parameters */
|
||||
#define AL_BANDPASS_GAIN 0x0001
|
||||
#define AL_BANDPASS_GAINLF 0x0002
|
||||
#define AL_BANDPASS_GAINHF 0x0003
|
||||
|
||||
/* Filter type */
|
||||
#define AL_FILTER_FIRST_PARAMETER 0x0000
|
||||
#define AL_FILTER_LAST_PARAMETER 0x8000
|
||||
#define AL_FILTER_TYPE 0x8001
|
||||
|
||||
/* Filter types, used with the AL_FILTER_TYPE property */
|
||||
#define AL_FILTER_NULL 0x0000
|
||||
#define AL_FILTER_LOWPASS 0x0001
|
||||
#define AL_FILTER_HIGHPASS 0x0002
|
||||
#define AL_FILTER_BANDPASS 0x0003
|
||||
|
||||
|
||||
/* Effect object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*);
|
||||
|
||||
/* Filter object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*);
|
||||
|
||||
/* Auxiliary Effect Slot object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*);
|
||||
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects);
|
||||
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect);
|
||||
AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
|
||||
|
||||
AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters);
|
||||
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter);
|
||||
AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
|
||||
|
||||
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots);
|
||||
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues);
|
||||
#endif
|
||||
|
||||
/* Filter ranges and defaults. */
|
||||
|
||||
/* Lowpass filter */
|
||||
#define LOWPASS_MIN_GAIN (0.0f)
|
||||
#define LOWPASS_MAX_GAIN (1.0f)
|
||||
#define LOWPASS_DEFAULT_GAIN (1.0f)
|
||||
|
||||
#define LOWPASS_MIN_GAINHF (0.0f)
|
||||
#define LOWPASS_MAX_GAINHF (1.0f)
|
||||
#define LOWPASS_DEFAULT_GAINHF (1.0f)
|
||||
|
||||
/* Highpass filter */
|
||||
#define HIGHPASS_MIN_GAIN (0.0f)
|
||||
#define HIGHPASS_MAX_GAIN (1.0f)
|
||||
#define HIGHPASS_DEFAULT_GAIN (1.0f)
|
||||
|
||||
#define HIGHPASS_MIN_GAINLF (0.0f)
|
||||
#define HIGHPASS_MAX_GAINLF (1.0f)
|
||||
#define HIGHPASS_DEFAULT_GAINLF (1.0f)
|
||||
|
||||
/* Bandpass filter */
|
||||
#define BANDPASS_MIN_GAIN (0.0f)
|
||||
#define BANDPASS_MAX_GAIN (1.0f)
|
||||
#define BANDPASS_DEFAULT_GAIN (1.0f)
|
||||
|
||||
#define BANDPASS_MIN_GAINHF (0.0f)
|
||||
#define BANDPASS_MAX_GAINHF (1.0f)
|
||||
#define BANDPASS_DEFAULT_GAINHF (1.0f)
|
||||
|
||||
#define BANDPASS_MIN_GAINLF (0.0f)
|
||||
#define BANDPASS_MAX_GAINLF (1.0f)
|
||||
#define BANDPASS_DEFAULT_GAINLF (1.0f)
|
||||
|
||||
|
||||
/* Effect parameter ranges and defaults. */
|
||||
|
||||
/* Standard reverb effect */
|
||||
#define AL_REVERB_MIN_DENSITY (0.0f)
|
||||
#define AL_REVERB_MAX_DENSITY (1.0f)
|
||||
#define AL_REVERB_DEFAULT_DENSITY (1.0f)
|
||||
|
||||
#define AL_REVERB_MIN_DIFFUSION (0.0f)
|
||||
#define AL_REVERB_MAX_DIFFUSION (1.0f)
|
||||
#define AL_REVERB_DEFAULT_DIFFUSION (1.0f)
|
||||
|
||||
#define AL_REVERB_MIN_GAIN (0.0f)
|
||||
#define AL_REVERB_MAX_GAIN (1.0f)
|
||||
#define AL_REVERB_DEFAULT_GAIN (0.32f)
|
||||
|
||||
#define AL_REVERB_MIN_GAINHF (0.0f)
|
||||
#define AL_REVERB_MAX_GAINHF (1.0f)
|
||||
#define AL_REVERB_DEFAULT_GAINHF (0.89f)
|
||||
|
||||
#define AL_REVERB_MIN_DECAY_TIME (0.1f)
|
||||
#define AL_REVERB_MAX_DECAY_TIME (20.0f)
|
||||
#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f)
|
||||
|
||||
#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f)
|
||||
#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f)
|
||||
#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f)
|
||||
|
||||
#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f)
|
||||
#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f)
|
||||
#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
|
||||
|
||||
#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f)
|
||||
#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f)
|
||||
#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
|
||||
|
||||
#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f)
|
||||
#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f)
|
||||
#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
|
||||
|
||||
#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f)
|
||||
#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f)
|
||||
#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
|
||||
|
||||
#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
|
||||
#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
|
||||
#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
|
||||
|
||||
#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
|
||||
#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
|
||||
#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE
|
||||
#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE
|
||||
#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE
|
||||
|
||||
/* EAX reverb effect */
|
||||
#define AL_EAXREVERB_MIN_DENSITY (0.0f)
|
||||
#define AL_EAXREVERB_MAX_DENSITY (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DIFFUSION (0.0f)
|
||||
#define AL_EAXREVERB_MAX_DIFFUSION (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_GAIN (0.0f)
|
||||
#define AL_EAXREVERB_MAX_GAIN (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_GAIN (0.32f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_GAINHF (0.0f)
|
||||
#define AL_EAXREVERB_MAX_GAINHF (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_GAINLF (0.0f)
|
||||
#define AL_EAXREVERB_MAX_GAINLF (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f)
|
||||
#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f)
|
||||
#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f)
|
||||
#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f)
|
||||
#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f)
|
||||
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f)
|
||||
#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f)
|
||||
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
|
||||
|
||||
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f)
|
||||
#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f)
|
||||
#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f)
|
||||
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
|
||||
|
||||
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f)
|
||||
#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f)
|
||||
#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f)
|
||||
#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f)
|
||||
#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f)
|
||||
#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
|
||||
#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f)
|
||||
#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f)
|
||||
#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE
|
||||
#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE
|
||||
|
||||
/* Chorus effect */
|
||||
#define AL_CHORUS_WAVEFORM_SINUSOID (0)
|
||||
#define AL_CHORUS_WAVEFORM_TRIANGLE (1)
|
||||
|
||||
#define AL_CHORUS_MIN_WAVEFORM (0)
|
||||
#define AL_CHORUS_MAX_WAVEFORM (1)
|
||||
#define AL_CHORUS_DEFAULT_WAVEFORM (1)
|
||||
|
||||
#define AL_CHORUS_MIN_PHASE (-180)
|
||||
#define AL_CHORUS_MAX_PHASE (180)
|
||||
#define AL_CHORUS_DEFAULT_PHASE (90)
|
||||
|
||||
#define AL_CHORUS_MIN_RATE (0.0f)
|
||||
#define AL_CHORUS_MAX_RATE (10.0f)
|
||||
#define AL_CHORUS_DEFAULT_RATE (1.1f)
|
||||
|
||||
#define AL_CHORUS_MIN_DEPTH (0.0f)
|
||||
#define AL_CHORUS_MAX_DEPTH (1.0f)
|
||||
#define AL_CHORUS_DEFAULT_DEPTH (0.1f)
|
||||
|
||||
#define AL_CHORUS_MIN_FEEDBACK (-1.0f)
|
||||
#define AL_CHORUS_MAX_FEEDBACK (1.0f)
|
||||
#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f)
|
||||
|
||||
#define AL_CHORUS_MIN_DELAY (0.0f)
|
||||
#define AL_CHORUS_MAX_DELAY (0.016f)
|
||||
#define AL_CHORUS_DEFAULT_DELAY (0.016f)
|
||||
|
||||
/* Distortion effect */
|
||||
#define AL_DISTORTION_MIN_EDGE (0.0f)
|
||||
#define AL_DISTORTION_MAX_EDGE (1.0f)
|
||||
#define AL_DISTORTION_DEFAULT_EDGE (0.2f)
|
||||
|
||||
#define AL_DISTORTION_MIN_GAIN (0.01f)
|
||||
#define AL_DISTORTION_MAX_GAIN (1.0f)
|
||||
#define AL_DISTORTION_DEFAULT_GAIN (0.05f)
|
||||
|
||||
#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f)
|
||||
#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f)
|
||||
#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f)
|
||||
|
||||
#define AL_DISTORTION_MIN_EQCENTER (80.0f)
|
||||
#define AL_DISTORTION_MAX_EQCENTER (24000.0f)
|
||||
#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f)
|
||||
|
||||
#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f)
|
||||
#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f)
|
||||
#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f)
|
||||
|
||||
/* Echo effect */
|
||||
#define AL_ECHO_MIN_DELAY (0.0f)
|
||||
#define AL_ECHO_MAX_DELAY (0.207f)
|
||||
#define AL_ECHO_DEFAULT_DELAY (0.1f)
|
||||
|
||||
#define AL_ECHO_MIN_LRDELAY (0.0f)
|
||||
#define AL_ECHO_MAX_LRDELAY (0.404f)
|
||||
#define AL_ECHO_DEFAULT_LRDELAY (0.1f)
|
||||
|
||||
#define AL_ECHO_MIN_DAMPING (0.0f)
|
||||
#define AL_ECHO_MAX_DAMPING (0.99f)
|
||||
#define AL_ECHO_DEFAULT_DAMPING (0.5f)
|
||||
|
||||
#define AL_ECHO_MIN_FEEDBACK (0.0f)
|
||||
#define AL_ECHO_MAX_FEEDBACK (1.0f)
|
||||
#define AL_ECHO_DEFAULT_FEEDBACK (0.5f)
|
||||
|
||||
#define AL_ECHO_MIN_SPREAD (-1.0f)
|
||||
#define AL_ECHO_MAX_SPREAD (1.0f)
|
||||
#define AL_ECHO_DEFAULT_SPREAD (-1.0f)
|
||||
|
||||
/* Flanger effect */
|
||||
#define AL_FLANGER_WAVEFORM_SINUSOID (0)
|
||||
#define AL_FLANGER_WAVEFORM_TRIANGLE (1)
|
||||
|
||||
#define AL_FLANGER_MIN_WAVEFORM (0)
|
||||
#define AL_FLANGER_MAX_WAVEFORM (1)
|
||||
#define AL_FLANGER_DEFAULT_WAVEFORM (1)
|
||||
|
||||
#define AL_FLANGER_MIN_PHASE (-180)
|
||||
#define AL_FLANGER_MAX_PHASE (180)
|
||||
#define AL_FLANGER_DEFAULT_PHASE (0)
|
||||
|
||||
#define AL_FLANGER_MIN_RATE (0.0f)
|
||||
#define AL_FLANGER_MAX_RATE (10.0f)
|
||||
#define AL_FLANGER_DEFAULT_RATE (0.27f)
|
||||
|
||||
#define AL_FLANGER_MIN_DEPTH (0.0f)
|
||||
#define AL_FLANGER_MAX_DEPTH (1.0f)
|
||||
#define AL_FLANGER_DEFAULT_DEPTH (1.0f)
|
||||
|
||||
#define AL_FLANGER_MIN_FEEDBACK (-1.0f)
|
||||
#define AL_FLANGER_MAX_FEEDBACK (1.0f)
|
||||
#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f)
|
||||
|
||||
#define AL_FLANGER_MIN_DELAY (0.0f)
|
||||
#define AL_FLANGER_MAX_DELAY (0.004f)
|
||||
#define AL_FLANGER_DEFAULT_DELAY (0.002f)
|
||||
|
||||
/* Frequency shifter effect */
|
||||
#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f)
|
||||
#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f)
|
||||
#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f)
|
||||
|
||||
#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0)
|
||||
#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2)
|
||||
#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0)
|
||||
|
||||
#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0)
|
||||
#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1)
|
||||
#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2)
|
||||
|
||||
#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0)
|
||||
#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2)
|
||||
#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0)
|
||||
|
||||
/* Vocal morpher effect */
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_PHONEME_A (0)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_E (1)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_I (2)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_O (3)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_U (4)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AA (5)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AE (6)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AH (7)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AO (8)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_EH (9)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_ER (10)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_IH (11)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_IY (12)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_UH (13)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_UW (14)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_B (15)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_D (16)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_F (17)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_G (18)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_J (19)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_K (20)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_L (21)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_M (22)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_N (23)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_P (24)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_R (25)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_S (26)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_T (27)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_V (28)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_Z (29)
|
||||
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0)
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1)
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0)
|
||||
#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_RATE (0.0f)
|
||||
#define AL_VOCAL_MORPHER_MAX_RATE (10.0f)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f)
|
||||
|
||||
/* Pitch shifter effect */
|
||||
#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12)
|
||||
#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12)
|
||||
#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12)
|
||||
|
||||
#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50)
|
||||
#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50)
|
||||
#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0)
|
||||
|
||||
/* Ring modulator effect */
|
||||
#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f)
|
||||
#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f)
|
||||
#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f)
|
||||
|
||||
#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f)
|
||||
#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f)
|
||||
#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f)
|
||||
|
||||
#define AL_RING_MODULATOR_SINUSOID (0)
|
||||
#define AL_RING_MODULATOR_SAWTOOTH (1)
|
||||
#define AL_RING_MODULATOR_SQUARE (2)
|
||||
|
||||
#define AL_RING_MODULATOR_MIN_WAVEFORM (0)
|
||||
#define AL_RING_MODULATOR_MAX_WAVEFORM (2)
|
||||
#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0)
|
||||
|
||||
/* Autowah effect */
|
||||
#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f)
|
||||
#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f)
|
||||
|
||||
#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f)
|
||||
#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f)
|
||||
|
||||
#define AL_AUTOWAH_MIN_RESONANCE (2.0f)
|
||||
#define AL_AUTOWAH_MAX_RESONANCE (1000.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f)
|
||||
|
||||
#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f)
|
||||
#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f)
|
||||
|
||||
/* Compressor effect */
|
||||
#define AL_COMPRESSOR_MIN_ONOFF (0)
|
||||
#define AL_COMPRESSOR_MAX_ONOFF (1)
|
||||
#define AL_COMPRESSOR_DEFAULT_ONOFF (1)
|
||||
|
||||
/* Equalizer effect */
|
||||
#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f)
|
||||
#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f)
|
||||
#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f)
|
||||
#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f)
|
||||
#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f)
|
||||
#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f)
|
||||
#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f)
|
||||
|
||||
|
||||
/* Source parameter value ranges and defaults. */
|
||||
#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f)
|
||||
#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f)
|
||||
#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f)
|
||||
|
||||
#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
|
||||
#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
|
||||
#define AL_MIN_CONE_OUTER_GAINHF (0.0f)
|
||||
#define AL_MAX_CONE_OUTER_GAINHF (1.0f)
|
||||
#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f)
|
||||
|
||||
#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE
|
||||
#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE
|
||||
#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE
|
||||
|
||||
#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE
|
||||
#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE
|
||||
#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE
|
||||
|
||||
#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE
|
||||
#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE
|
||||
#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE
|
||||
|
||||
|
||||
/* Listener parameter value ranges and defaults. */
|
||||
#define AL_MIN_METERS_PER_UNIT FLT_MIN
|
||||
#define AL_MAX_METERS_PER_UNIT FLT_MAX
|
||||
#define AL_DEFAULT_METERS_PER_UNIT (1.0f)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* AL_EFX_H */
|
|
@ -1,161 +0,0 @@
|
|||
/**********************************************************************************************************************************
|
||||
*
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (c) 2004-2006, Apple Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2008, Apple Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of Apple Inc. ("Apple") nor the names of its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**********************************************************************************************************************************/
|
||||
|
||||
#ifndef __OAL_MAC_OSX_OAL_EXTENSIONS_H__
|
||||
#define __OAL_MAC_OSX_OAL_EXTENSIONS_H__
|
||||
|
||||
#include <OpenAL/al.h>
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
ALC_EXT_MAC_OSX
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
// Retrieve functions via alGetProcAddress() by passing in strings: alcMacOSXMixerOutputRate or alcMacOSXGetMixerOutputRate
|
||||
|
||||
// Setting the Mixer Output Rate effectively sets the samnple rate at which the mixer
|
||||
typedef ALvoid (*alcMacOSXRenderingQualityProcPtr) (ALint value);
|
||||
typedef ALvoid (*alMacOSXRenderChannelCountProcPtr) (ALint value);
|
||||
typedef ALvoid (*alcMacOSXMixerMaxiumumBussesProcPtr) (ALint value);
|
||||
typedef ALvoid (*alcMacOSXMixerOutputRateProcPtr) (ALdouble value);
|
||||
|
||||
typedef ALint (*alcMacOSXGetRenderingQualityProcPtr) ();
|
||||
typedef ALint (*alMacOSXGetRenderChannelCountProcPtr) ();
|
||||
typedef ALint (*alcMacOSXGetMixerMaxiumumBussesProcPtr) ();
|
||||
typedef ALdouble (*alcMacOSXGetMixerOutputRateProcPtr) ();
|
||||
|
||||
/* Render Quality. Used with alcMacOSXRenderingQuality() */
|
||||
|
||||
#define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_HIGH 'rqhi'
|
||||
#define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_LOW 'rdlo'
|
||||
|
||||
// High Quality Spatial Algorithm suitable only for headphone use
|
||||
#define ALC_IPHONE_SPATIAL_RENDERING_QUALITY_HEADPHONES 'hdph'
|
||||
|
||||
/*
|
||||
Render Channels. Used with alMacOSXRenderChannelCount()
|
||||
Allows a user to force OpenAL to render to stereo, regardless of the audio hardware being used
|
||||
*/
|
||||
#define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_STEREO 'rcst'
|
||||
|
||||
/* GameKit extension */
|
||||
|
||||
#define AL_GAMEKIT 'gksr'
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
AL_EXT_SOURCE_NOTIFICATIONS
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
/*
|
||||
Source Notifications
|
||||
|
||||
Eliminates the need for continuous polling for source state by providing a
|
||||
mechanism for the application to receive source state change notifications.
|
||||
Upon receiving a notification, the application can retrieve the actual state
|
||||
corresponding to the notification ID for which the notification was sent.
|
||||
*/
|
||||
|
||||
#define AL_QUEUE_HAS_LOOPED 0x9000
|
||||
|
||||
/*
|
||||
Notification Proc: ALSourceNotificationProc
|
||||
|
||||
sid - source id
|
||||
notificationID - id of state that has changed
|
||||
userData - user data provided to alSourceAddNotification()
|
||||
*/
|
||||
|
||||
typedef ALvoid (*alSourceNotificationProc)(ALuint sid, ALuint notificationID, ALvoid* userData);
|
||||
|
||||
/*
|
||||
API: alSourceAddNotification
|
||||
|
||||
sid - source id
|
||||
notificationID - id of state for which caller wants to be notified of a change
|
||||
notifyProc - notification proc
|
||||
userData - ptr to applications user data, will be returned in the notification proc
|
||||
|
||||
Returns AL_NO_ERROR if request is successful.
|
||||
|
||||
Valid IDs:
|
||||
AL_SOURCE_STATE
|
||||
AL_BUFFERS_PROCESSED
|
||||
AL_QUEUE_HAS_LOOPED - notification sent when a looping source has looped to it's start point
|
||||
*/
|
||||
typedef ALenum (*alSourceAddNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData);
|
||||
|
||||
/*
|
||||
API: alSourceRemoveStateNotification
|
||||
|
||||
sid - source id
|
||||
notificationID - id of state for which caller wants to remove an existing notification
|
||||
notifyProc - notification proc
|
||||
userData - ptr to applications user data, will be returned in the notification proc
|
||||
*/
|
||||
typedef ALvoid (*alSourceRemoveNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData);
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
ALC_EXT_ASA : Apple Spatial Audio Extension
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
/*
|
||||
Used with the ASA API calls: alcASAGetSource(), alcASASetSource(), alcASAGetListener(), alcASASetListener()
|
||||
*/
|
||||
|
||||
typedef ALenum (*alcASAGetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint* dataSize);
|
||||
typedef ALenum (*alcASASetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint dataSize);
|
||||
typedef ALenum (*alcASAGetListenerProcPtr) (ALuint property, ALvoid *data, ALuint* dataSize);
|
||||
typedef ALenum (*alcASASetListenerProcPtr) (ALuint property, ALvoid *data, ALuint dataSize);
|
||||
|
||||
/* listener properties */
|
||||
#define ALC_ASA_REVERB_ON 'rvon' // type ALuint
|
||||
#define ALC_ASA_REVERB_GLOBAL_LEVEL 'rvgl' // type ALfloat -40.0 db - 40.0 db
|
||||
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE 'rvrt' // type ALint
|
||||
|
||||
/* reverb room type presets for the ALC_ASA_REVERB_ROOM_TYPE property */
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_SmallRoom 0
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_MediumRoom 1
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom 2
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_MediumHall 3
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_LargeHall 4
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_Plate 5
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_MediumChamber 6
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_LargeChamber 7
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_Cathedral 8
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom2 9
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_MediumHall2 10
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_MediumHall3 11
|
||||
#define ALC_ASA_REVERB_ROOM_TYPE_LargeHall2 12
|
||||
|
||||
#define ALC_ASA_REVERB_EQ_GAIN 'rveg' // type ALfloat
|
||||
#define ALC_ASA_REVERB_EQ_BANDWITH 'rveb' // type ALfloat
|
||||
#define ALC_ASA_REVERB_EQ_FREQ 'rvef' // type ALfloat
|
||||
|
||||
/* source properties */
|
||||
#define ALC_ASA_REVERB_SEND_LEVEL 'rvsl' // type ALfloat 0.0 (dry) - 1.0 (wet) (0-100% dry/wet mix, 0.0 default)
|
||||
#define ALC_ASA_OCCLUSION 'occl' // type ALfloat -100.0 db (most occlusion) - 0.0 db (no occlusion, 0.0 default)
|
||||
#define ALC_ASA_OBSTRUCTION 'obst' // type ALfloat -100.0 db (most obstruction) - 0.0 db (no obstruction, 0.0 default)
|
||||
|
||||
#endif // __OAL_MAC_OSX_OAL_EXTENSIONS_H__
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,63 +0,0 @@
|
|||
#ifndef _AL_AUXEFFECTSLOT_H_
|
||||
#define _AL_AUXEFFECTSLOT_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "alEffect.h"
|
||||
#include "alFilter.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ALeffectState ALeffectState;
|
||||
|
||||
typedef struct ALeffectslot
|
||||
{
|
||||
ALeffect effect;
|
||||
|
||||
ALfp Gain;
|
||||
ALboolean AuxSendAuto;
|
||||
|
||||
ALeffectState *EffectState;
|
||||
|
||||
ALfp WetBuffer[BUFFERSIZE];
|
||||
|
||||
ALfp ClickRemoval[1];
|
||||
ALfp PendingClicks[1];
|
||||
|
||||
ALuint refcount;
|
||||
|
||||
// Index to itself
|
||||
ALuint effectslot;
|
||||
|
||||
struct ALeffectslot *next;
|
||||
} ALeffectslot;
|
||||
|
||||
|
||||
ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context);
|
||||
|
||||
|
||||
struct ALeffectState {
|
||||
ALvoid (*Destroy)(ALeffectState *State);
|
||||
ALboolean (*DeviceUpdate)(ALeffectState *State, ALCdevice *Device);
|
||||
ALvoid (*Update)(ALeffectState *State, ALCcontext *Context, const ALeffect *Effect);
|
||||
ALvoid (*Process)(ALeffectState *State, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfp *SamplesIn, ALfp (*SamplesOut)[MAXCHANNELS]);
|
||||
};
|
||||
|
||||
ALeffectState *NoneCreate(void);
|
||||
ALeffectState *EAXVerbCreate(void);
|
||||
ALeffectState *VerbCreate(void);
|
||||
ALeffectState *EchoCreate(void);
|
||||
ALeffectState *ModulatorCreate(void);
|
||||
|
||||
#define ALEffect_Destroy(a) ((a)->Destroy((a)))
|
||||
#define ALEffect_DeviceUpdate(a,b) ((a)->DeviceUpdate((a),(b)))
|
||||
#define ALEffect_Update(a,b,c) ((a)->Update((a),(b),(c)))
|
||||
#define ALEffect_Process(a,b,c,d,e) ((a)->Process((a),(b),(c),(d),(e)))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,98 +0,0 @@
|
|||
#ifndef _AL_BUFFER_H_
|
||||
#define _AL_BUFFER_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Input formats (some are currently theoretical) */
|
||||
enum UserFmtType {
|
||||
UserFmtByte, /* AL_BYTE */
|
||||
UserFmtUByte, /* AL_UNSIGNED_BYTE */
|
||||
UserFmtShort, /* AL_SHORT */
|
||||
UserFmtUShort, /* AL_UNSIGNED_SHORT */
|
||||
UserFmtInt, /* AL_INT */
|
||||
UserFmtUInt, /* AL_UNSIGNED_INT */
|
||||
UserFmtFloat, /* AL_FLOAT */
|
||||
UserFmtDouble, /* AL_DOUBLE */
|
||||
UserFmtMulaw, /* AL_MULAW */
|
||||
UserFmtIMA4, /* AL_IMA4 */
|
||||
};
|
||||
enum UserFmtChannels {
|
||||
UserFmtMono, /* AL_MONO */
|
||||
UserFmtStereo, /* AL_STEREO */
|
||||
UserFmtRear, /* AL_REAR */
|
||||
UserFmtQuad, /* AL_QUAD */
|
||||
UserFmtX51, /* AL_5POINT1 (WFX order) */
|
||||
UserFmtX61, /* AL_6POINT1 (WFX order) */
|
||||
UserFmtX71, /* AL_7POINT1 (WFX order) */
|
||||
};
|
||||
|
||||
ALboolean DecomposeUserFormat(ALenum format, enum UserFmtChannels *chans,
|
||||
enum UserFmtType *type);
|
||||
ALuint BytesFromUserFmt(enum UserFmtType type);
|
||||
ALuint ChannelsFromUserFmt(enum UserFmtChannels chans);
|
||||
static __inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans,
|
||||
enum UserFmtType type)
|
||||
{
|
||||
return ChannelsFromUserFmt(chans) * BytesFromUserFmt(type);
|
||||
}
|
||||
|
||||
|
||||
/* Storable formats */
|
||||
enum FmtType {
|
||||
FmtUByte = UserFmtUByte,
|
||||
FmtShort = UserFmtShort,
|
||||
FmtFloat = UserFmtFloat,
|
||||
};
|
||||
enum FmtChannels {
|
||||
FmtMono = UserFmtMono,
|
||||
FmtStereo = UserFmtStereo,
|
||||
FmtRear = UserFmtRear,
|
||||
FmtQuad = UserFmtQuad,
|
||||
FmtX51 = UserFmtX51,
|
||||
FmtX61 = UserFmtX61,
|
||||
FmtX71 = UserFmtX71,
|
||||
};
|
||||
|
||||
ALboolean DecomposeFormat(ALenum format, enum FmtChannels *chans, enum FmtType *type);
|
||||
ALuint BytesFromFmt(enum FmtType type);
|
||||
ALuint ChannelsFromFmt(enum FmtChannels chans);
|
||||
static __inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
|
||||
{
|
||||
return ChannelsFromFmt(chans) * BytesFromFmt(type);
|
||||
}
|
||||
|
||||
|
||||
typedef struct ALbuffer
|
||||
{
|
||||
ALvoid *data;
|
||||
ALsizei size;
|
||||
|
||||
ALsizei Frequency;
|
||||
enum FmtChannels FmtChannels;
|
||||
enum FmtType FmtType;
|
||||
|
||||
enum UserFmtChannels OriginalChannels;
|
||||
enum UserFmtType OriginalType;
|
||||
ALsizei OriginalSize;
|
||||
ALsizei OriginalAlign;
|
||||
|
||||
ALsizei LoopStart;
|
||||
ALsizei LoopEnd;
|
||||
|
||||
ALuint refcount; // Number of sources using this buffer (deletion can only occur when this is 0)
|
||||
|
||||
// Index to itself
|
||||
ALuint buffer;
|
||||
} ALbuffer;
|
||||
|
||||
ALvoid ReleaseALBuffers(ALCdevice *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef _AL_DATABUFFER_H_
|
||||
#define _AL_DATABUFFER_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define UNMAPPED 0
|
||||
#define MAPPED 1
|
||||
|
||||
typedef struct ALdatabuffer
|
||||
{
|
||||
ALubyte *data;
|
||||
ALintptrEXT size;
|
||||
|
||||
ALenum state;
|
||||
ALenum usage;
|
||||
|
||||
/* Index to self */
|
||||
ALuint databuffer;
|
||||
|
||||
struct ALdatabuffer *next;
|
||||
} ALdatabuffer;
|
||||
|
||||
ALvoid ReleaseALDatabuffers(ALCdevice *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,83 +0,0 @@
|
|||
// NOTE: The effect structure is getting too large, it may be a good idea to
|
||||
// start using a union or another form of unified storage.
|
||||
#ifndef _AL_EFFECT_H_
|
||||
#define _AL_EFFECT_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
EAXREVERB = 0,
|
||||
REVERB,
|
||||
ECHO,
|
||||
MODULATOR,
|
||||
|
||||
MAX_EFFECTS
|
||||
};
|
||||
extern ALboolean DisabledEffects[MAX_EFFECTS];
|
||||
|
||||
typedef struct ALeffect
|
||||
{
|
||||
// Effect type (AL_EFFECT_NULL, ...)
|
||||
ALenum type;
|
||||
|
||||
struct {
|
||||
// Shared Reverb Properties
|
||||
ALfp Density;
|
||||
ALfp Diffusion;
|
||||
ALfp Gain;
|
||||
ALfp GainHF;
|
||||
ALfp DecayTime;
|
||||
ALfp DecayHFRatio;
|
||||
ALfp ReflectionsGain;
|
||||
ALfp ReflectionsDelay;
|
||||
ALfp LateReverbGain;
|
||||
ALfp LateReverbDelay;
|
||||
ALfp AirAbsorptionGainHF;
|
||||
ALfp RoomRolloffFactor;
|
||||
ALboolean DecayHFLimit;
|
||||
|
||||
// Additional EAX Reverb Properties
|
||||
ALfp GainLF;
|
||||
ALfp DecayLFRatio;
|
||||
ALfp ReflectionsPan[3];
|
||||
ALfp LateReverbPan[3];
|
||||
ALfp EchoTime;
|
||||
ALfp EchoDepth;
|
||||
ALfp ModulationTime;
|
||||
ALfp ModulationDepth;
|
||||
ALfp HFReference;
|
||||
ALfp LFReference;
|
||||
} Reverb;
|
||||
|
||||
struct {
|
||||
ALfp Delay;
|
||||
ALfp LRDelay;
|
||||
|
||||
ALfp Damping;
|
||||
ALfp Feedback;
|
||||
|
||||
ALfp Spread;
|
||||
} Echo;
|
||||
|
||||
struct {
|
||||
ALfp Frequency;
|
||||
ALfp HighPassCutoff;
|
||||
ALint Waveform;
|
||||
} Modulator;
|
||||
|
||||
// Index to itself
|
||||
ALuint effect;
|
||||
} ALeffect;
|
||||
|
||||
|
||||
ALvoid ReleaseALEffects(ALCdevice *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef _AL_ERROR_H_
|
||||
#define _AL_ERROR_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ALvoid alSetError(ALCcontext *Context, ALenum errorCode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,139 +0,0 @@
|
|||
#ifndef _AL_FILTER_H_
|
||||
#define _AL_FILTER_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "alu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
ALfp coeff;
|
||||
#ifndef _MSC_VER
|
||||
ALfp history[0];
|
||||
#else
|
||||
ALfp history[1];
|
||||
#endif
|
||||
} FILTER;
|
||||
|
||||
static __inline ALfp lpFilter4P(FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = output + ALfpMult((history[0]-output),a);
|
||||
history[0] = output;
|
||||
output = output + ALfpMult((history[1]-output),a);
|
||||
history[1] = output;
|
||||
output = output + ALfpMult((history[2]-output),a);
|
||||
history[2] = output;
|
||||
output = output + ALfpMult((history[3]-output),a);
|
||||
history[3] = output;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static __inline ALfp lpFilter2P(FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = output + ALfpMult((history[0]-output),a);
|
||||
history[0] = output;
|
||||
output = output + ALfpMult((history[1]-output),a);
|
||||
history[1] = output;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static __inline ALfp lpFilter1P(FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = output + ALfpMult((history[0]-output),a);
|
||||
history[0] = output;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static __inline ALfp lpFilter4PC(const FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
const ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = output + ALfpMult((history[0]-output),a);
|
||||
output = output + ALfpMult((history[1]-output),a);
|
||||
output = output + ALfpMult((history[2]-output),a);
|
||||
output = output + ALfpMult((history[3]-output),a);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static __inline ALfp lpFilter2PC(const FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
const ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = output + ALfpMult((history[0]-output),a);
|
||||
output = output + ALfpMult((history[1]-output),a);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static __inline ALfp lpFilter1PC(FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
const ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = output + ALfpMult((history[0]-output),a);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/* Calculates the low-pass filter coefficient given the pre-scaled gain and
|
||||
* cos(w) value. Note that g should be pre-scaled (sqr(gain) for one-pole,
|
||||
* sqrt(gain) for four-pole, etc) */
|
||||
static __inline ALfp lpCoeffCalc(ALfp g, ALfp cw)
|
||||
{
|
||||
ALfp a = int2ALfp(0);
|
||||
|
||||
/* Be careful with gains < 0.01, as that causes the coefficient
|
||||
* head towards 1, which will flatten the signal */
|
||||
g = __max(g, float2ALfp(0.01f));
|
||||
if(g < float2ALfp(0.9999f)) /* 1-epsilon */ {
|
||||
ALfp tmp; tmp = ALfpMult(ALfpMult(int2ALfp(2),g),(int2ALfp(1)-cw)) - ALfpMult(ALfpMult(g,g),(int2ALfp(1) - ALfpMult(cw,cw)));
|
||||
a = ALfpDiv((int2ALfp(1) - ALfpMult(g,cw) - aluSqrt(tmp)), (int2ALfp(1) - g));
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
typedef struct ALfilter
|
||||
{
|
||||
// Filter type (AL_FILTER_NULL, ...)
|
||||
ALenum type;
|
||||
|
||||
ALfp Gain;
|
||||
ALfp GainHF;
|
||||
|
||||
// Index to itself
|
||||
ALuint filter;
|
||||
} ALfilter;
|
||||
|
||||
|
||||
ALvoid ReleaseALFilters(ALCdevice *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef _AL_LISTENER_H_
|
||||
#define _AL_LISTENER_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ALlistener_struct
|
||||
{
|
||||
ALfp Position[3];
|
||||
ALfp Velocity[3];
|
||||
ALfp Forward[3];
|
||||
ALfp Up[3];
|
||||
ALfp Gain;
|
||||
ALfp MetersPerUnit;
|
||||
} ALlistener;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,503 +0,0 @@
|
|||
#ifndef AL_MAIN_H
|
||||
#define AL_MAIN_H
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef HAVE_FENV_H
|
||||
#include <fenv.h>
|
||||
#endif
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
#include "AL/alext.h"
|
||||
|
||||
#ifndef AL_EXT_sample_buffer_object
|
||||
#define AL_EXT_sample_buffer_object 1
|
||||
typedef ptrdiff_t ALintptrEXT;
|
||||
typedef ptrdiff_t ALsizeiptrEXT;
|
||||
#define AL_SAMPLE_SOURCE_EXT 0x1040
|
||||
#define AL_SAMPLE_SINK_EXT 0x1041
|
||||
#define AL_READ_ONLY_EXT 0x1042
|
||||
#define AL_WRITE_ONLY_EXT 0x1043
|
||||
#define AL_READ_WRITE_EXT 0x1044
|
||||
#define AL_STREAM_WRITE_EXT 0x1045
|
||||
#define AL_STREAM_READ_EXT 0x1046
|
||||
#define AL_STREAM_COPY_EXT 0x1047
|
||||
#define AL_STATIC_WRITE_EXT 0x1048
|
||||
#define AL_STATIC_READ_EXT 0x1049
|
||||
#define AL_STATIC_COPY_EXT 0x104A
|
||||
#define AL_DYNAMIC_WRITE_EXT 0x104B
|
||||
#define AL_DYNAMIC_READ_EXT 0x104C
|
||||
#define AL_DYNAMIC_COPY_EXT 0x104D
|
||||
typedef ALvoid (AL_APIENTRY*PFNALGENDATABUFFERSEXTPROC)(ALsizei n,ALuint *puiBuffers);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDELETEDATABUFFERSEXTPROC)(ALsizei n, const ALuint *puiBuffers);
|
||||
typedef ALboolean (AL_APIENTRY*PFNALISDATABUFFEREXTPROC)(ALuint uiBuffer);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDATABUFFERDATAEXTPROC)(ALuint buffer,const ALvoid *data,ALsizeiptrEXT size,ALenum usage);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDATABUFFERSUBDATAEXTPROC)(ALuint buffer, ALintptrEXT start, ALsizeiptrEXT length, const ALvoid *);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALGETDATABUFFERSUBDATAEXTPROC)(ALuint buffer, ALintptrEXT start, ALsizeiptrEXT length, ALvoid *);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDATABUFFERFEXTPROC)(ALuint buffer, ALenum eParam, ALfloat flValue);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDATABUFFERFVEXTPROC)(ALuint buffer, ALenum eParam, const ALfloat* flValues);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDATABUFFERIEXTPROC)(ALuint buffer, ALenum eParam, ALint lValue);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALDATABUFFERIVEXTPROC)(ALuint buffer, ALenum eParam, const ALint* plValues);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALGETDATABUFFERFEXTPROC)(ALuint buffer, ALenum eParam, ALfloat *pflValue);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALGETDATABUFFERFVEXTPROC)(ALuint buffer, ALenum eParam, ALfloat* pflValues);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALGETDATABUFFERIEXTPROC)(ALuint buffer, ALenum eParam, ALint *plValue);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALGETDATABUFFERIVEXTPROC)(ALuint buffer, ALenum eParam, ALint* plValues);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALSELECTDATABUFFEREXTPROC)(ALenum target, ALuint uiBuffer);
|
||||
typedef ALvoid* (AL_APIENTRY*PFNALMAPDATABUFFEREXTPROC)(ALuint uiBuffer, ALintptrEXT start, ALsizeiptrEXT length, ALenum access);
|
||||
typedef ALvoid (AL_APIENTRY*PFNALUNMAPDATABUFFEREXTPROC)(ALuint uiBuffer);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alGenDatabuffersEXT(ALsizei n,ALuint *puiBuffers);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteDatabuffersEXT(ALsizei n, const ALuint *puiBuffers);
|
||||
AL_API ALboolean AL_APIENTRY alIsDatabufferEXT(ALuint uiBuffer);
|
||||
AL_API ALvoid AL_APIENTRY alDatabufferDataEXT(ALuint buffer,const ALvoid *data,ALsizeiptrEXT size,ALenum usage);
|
||||
AL_API ALvoid AL_APIENTRY alDatabufferSubDataEXT(ALuint buffer, ALintptrEXT start, ALsizeiptrEXT length, const ALvoid *data);
|
||||
AL_API ALvoid AL_APIENTRY alGetDatabufferSubDataEXT(ALuint buffer, ALintptrEXT start, ALsizeiptrEXT length, ALvoid *data);
|
||||
AL_API ALvoid AL_APIENTRY alDatabufferfEXT(ALuint buffer, ALenum eParam, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alDatabufferfvEXT(ALuint buffer, ALenum eParam, const ALfloat* flValues);
|
||||
AL_API ALvoid AL_APIENTRY alDatabufferiEXT(ALuint buffer, ALenum eParam, ALint lValue);
|
||||
AL_API ALvoid AL_APIENTRY alDatabufferivEXT(ALuint buffer, ALenum eParam, const ALint* plValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetDatabufferfEXT(ALuint buffer, ALenum eParam, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetDatabufferfvEXT(ALuint buffer, ALenum eParam, ALfloat* pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetDatabufferiEXT(ALuint buffer, ALenum eParam, ALint *plValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetDatabufferivEXT(ALuint buffer, ALenum eParam, ALint* plValues);
|
||||
AL_API ALvoid AL_APIENTRY alSelectDatabufferEXT(ALenum target, ALuint uiBuffer);
|
||||
AL_API ALvoid* AL_APIENTRY alMapDatabufferEXT(ALuint uiBuffer, ALintptrEXT start, ALsizeiptrEXT length, ALenum access);
|
||||
AL_API ALvoid AL_APIENTRY alUnmapDatabufferEXT(ALuint uiBuffer);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
typedef int64_t ALint64;
|
||||
typedef uint64_t ALuint64;
|
||||
#elif defined(HAVE___INT64)
|
||||
typedef __int64 ALint64;
|
||||
typedef unsigned __int64 ALuint64;
|
||||
#elif (SIZEOF_LONG == 8)
|
||||
typedef long ALint64;
|
||||
typedef unsigned long ALuint64;
|
||||
#elif (SIZEOF_LONG_LONG == 8)
|
||||
typedef long long ALint64;
|
||||
typedef unsigned long long ALuint64;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GCC_FORMAT
|
||||
#define PRINTF_STYLE(x, y) __attribute__((format(__printf__, (x), (y))))
|
||||
#else
|
||||
#define PRINTF_STYLE(x, y)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
typedef DWORD tls_type;
|
||||
#define tls_create(x) (*(x) = TlsAlloc())
|
||||
#define tls_delete(x) TlsFree((x))
|
||||
#define tls_get(x) TlsGetValue((x))
|
||||
#define tls_set(x, a) TlsSetValue((x), (a))
|
||||
|
||||
#else
|
||||
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define IsBadWritePtr(a,b) ((a) == NULL && (b) != 0)
|
||||
|
||||
typedef pthread_key_t tls_type;
|
||||
#define tls_create(x) pthread_key_create((x), NULL)
|
||||
#define tls_delete(x) pthread_key_delete((x))
|
||||
#define tls_get(x) pthread_getspecific((x))
|
||||
#define tls_set(x, a) pthread_setspecific((x), (a))
|
||||
|
||||
typedef pthread_mutex_t CRITICAL_SECTION;
|
||||
static __inline void EnterCriticalSection(CRITICAL_SECTION *cs)
|
||||
{
|
||||
int ret;
|
||||
ret = pthread_mutex_lock(cs);
|
||||
assert(ret == 0);
|
||||
}
|
||||
static __inline void LeaveCriticalSection(CRITICAL_SECTION *cs)
|
||||
{
|
||||
int ret;
|
||||
ret = pthread_mutex_unlock(cs);
|
||||
assert(ret == 0);
|
||||
}
|
||||
static __inline void InitializeCriticalSection(CRITICAL_SECTION *cs)
|
||||
{
|
||||
pthread_mutexattr_t attrib;
|
||||
int ret;
|
||||
|
||||
ret = pthread_mutexattr_init(&attrib);
|
||||
assert(ret == 0);
|
||||
|
||||
ret = pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE);
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
if(ret != 0)
|
||||
ret = pthread_mutexattr_setkind_np(&attrib, PTHREAD_MUTEX_RECURSIVE);
|
||||
#endif
|
||||
assert(ret == 0);
|
||||
ret = pthread_mutex_init(cs, &attrib);
|
||||
assert(ret == 0);
|
||||
|
||||
pthread_mutexattr_destroy(&attrib);
|
||||
}
|
||||
|
||||
static __inline void DeleteCriticalSection(CRITICAL_SECTION *cs)
|
||||
{
|
||||
int ret;
|
||||
ret = pthread_mutex_destroy(cs);
|
||||
assert(ret == 0);
|
||||
}
|
||||
|
||||
/* NOTE: This wrapper isn't quite accurate as it returns an ALuint, as opposed
|
||||
* to the expected DWORD. Both are defined as unsigned 32-bit types, however.
|
||||
* Additionally, Win32 is supposed to measure the time since Windows started,
|
||||
* as opposed to the actual time. */
|
||||
static __inline ALuint timeGetTime(void)
|
||||
{
|
||||
#if _POSIX_TIMERS > 0
|
||||
struct timespec ts;
|
||||
int ret = -1;
|
||||
|
||||
#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK >= 0)
|
||||
#if _POSIX_MONOTONIC_CLOCK == 0
|
||||
static int hasmono = 0;
|
||||
if(hasmono > 0 || (hasmono == 0 &&
|
||||
(hasmono=sysconf(_SC_MONOTONIC_CLOCK)) > 0))
|
||||
#endif
|
||||
ret = clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
#endif
|
||||
if(ret != 0)
|
||||
ret = clock_gettime(CLOCK_REALTIME, &ts);
|
||||
assert(ret == 0);
|
||||
|
||||
return ts.tv_nsec/1000000 + ts.tv_sec*1000;
|
||||
#else
|
||||
struct timeval tv;
|
||||
int ret;
|
||||
|
||||
ret = gettimeofday(&tv, NULL);
|
||||
assert(ret == 0);
|
||||
|
||||
return tv.tv_usec/1000 + tv.tv_sec*1000;
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline void Sleep(ALuint t)
|
||||
{
|
||||
struct timespec tv, rem;
|
||||
tv.tv_nsec = (t*1000000)%1000000000;
|
||||
tv.tv_sec = t/1000;
|
||||
|
||||
while(nanosleep(&tv, &rem) == -1 && errno == EINTR)
|
||||
tv = rem;
|
||||
}
|
||||
#define min(x,y) (((x)<(y))?(x):(y))
|
||||
#define max(x,y) (((x)>(y))?(x):(y))
|
||||
#endif
|
||||
|
||||
#include "alListener.h"
|
||||
#include "alu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define SWMIXER_OUTPUT_RATE 44100
|
||||
|
||||
#define SPEEDOFSOUNDMETRESPERSEC (343.3f)
|
||||
#define AIRABSORBGAINDBHF (-0.05f)
|
||||
|
||||
#define LOWPASSFREQCUTOFF (5000)
|
||||
|
||||
#define DEFAULT_HEAD_DAMPEN (0.25f)
|
||||
|
||||
|
||||
// Find the next power-of-2 for non-power-of-2 numbers.
|
||||
static __inline ALuint NextPowerOf2(ALuint value)
|
||||
{
|
||||
ALuint powerOf2 = 1;
|
||||
|
||||
if(value)
|
||||
{
|
||||
value--;
|
||||
while(value)
|
||||
{
|
||||
value >>= 1;
|
||||
powerOf2 <<= 1;
|
||||
}
|
||||
}
|
||||
return powerOf2;
|
||||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
ALCboolean (*OpenPlayback)(ALCdevice*, const ALCchar*);
|
||||
void (*ClosePlayback)(ALCdevice*);
|
||||
ALCboolean (*ResetPlayback)(ALCdevice*);
|
||||
void (*StopPlayback)(ALCdevice*);
|
||||
|
||||
ALCboolean (*OpenCapture)(ALCdevice*, const ALCchar*);
|
||||
void (*CloseCapture)(ALCdevice*);
|
||||
void (*StartCapture)(ALCdevice*);
|
||||
void (*StopCapture)(ALCdevice*);
|
||||
void (*CaptureSamples)(ALCdevice*, void*, ALCuint);
|
||||
ALCuint (*AvailableSamples)(ALCdevice*);
|
||||
} BackendFuncs;
|
||||
|
||||
enum {
|
||||
DEVICE_PROBE,
|
||||
ALL_DEVICE_PROBE,
|
||||
CAPTURE_DEVICE_PROBE
|
||||
};
|
||||
|
||||
void alc_alsa_init(BackendFuncs *func_list);
|
||||
void alc_alsa_deinit(void);
|
||||
void alc_alsa_probe(int type);
|
||||
void alc_oss_init(BackendFuncs *func_list);
|
||||
void alc_oss_deinit(void);
|
||||
void alc_oss_probe(int type);
|
||||
void alc_solaris_init(BackendFuncs *func_list);
|
||||
void alc_solaris_deinit(void);
|
||||
void alc_solaris_probe(int type);
|
||||
void alcDSoundInit(BackendFuncs *func_list);
|
||||
void alcDSoundDeinit(void);
|
||||
void alcDSoundProbe(int type);
|
||||
void alcWinMMInit(BackendFuncs *FuncList);
|
||||
void alcWinMMDeinit(void);
|
||||
void alcWinMMProbe(int type);
|
||||
void alc_pa_init(BackendFuncs *func_list);
|
||||
void alc_pa_deinit(void);
|
||||
void alc_pa_probe(int type);
|
||||
void alc_wave_init(BackendFuncs *func_list);
|
||||
void alc_wave_deinit(void);
|
||||
void alc_wave_probe(int type);
|
||||
void alc_pulse_init(BackendFuncs *func_list);
|
||||
void alc_pulse_deinit(void);
|
||||
void alc_pulse_probe(int type);
|
||||
void alc_audiotrack_init(BackendFuncs *func_list);
|
||||
void alc_audiotrack_deinit(void);
|
||||
void alc_audiotrack_probe(int type);
|
||||
void alc_opensles_init(BackendFuncs *func_list);
|
||||
void alc_opensles_deinit(void);
|
||||
void alc_opensles_probe(int type);
|
||||
void alc_null_init(BackendFuncs *func_list);
|
||||
void alc_null_deinit(void);
|
||||
void alc_null_probe(int type);
|
||||
|
||||
|
||||
typedef struct UIntMap {
|
||||
struct {
|
||||
ALuint key;
|
||||
ALvoid *value;
|
||||
} *array;
|
||||
ALsizei size;
|
||||
ALsizei maxsize;
|
||||
} UIntMap;
|
||||
|
||||
void InitUIntMap(UIntMap *map);
|
||||
void ResetUIntMap(UIntMap *map);
|
||||
ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value);
|
||||
void RemoveUIntMapKey(UIntMap *map, ALuint key);
|
||||
ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key);
|
||||
|
||||
/* Device formats */
|
||||
enum DevFmtType {
|
||||
DevFmtByte, /* AL_BYTE */
|
||||
DevFmtUByte, /* AL_UNSIGNED_BYTE */
|
||||
DevFmtShort, /* AL_SHORT */
|
||||
DevFmtUShort, /* AL_UNSIGNED_SHORT */
|
||||
DevFmtFloat, /* AL_FLOAT */
|
||||
};
|
||||
enum DevFmtChannels {
|
||||
DevFmtMono, /* AL_MONO */
|
||||
DevFmtStereo, /* AL_STEREO */
|
||||
DevFmtQuad, /* AL_QUAD */
|
||||
DevFmtX51, /* AL_5POINT1 */
|
||||
DevFmtX61, /* AL_6POINT1 */
|
||||
DevFmtX71, /* AL_7POINT1 */
|
||||
};
|
||||
|
||||
ALuint BytesFromDevFmt(enum DevFmtType type);
|
||||
ALuint ChannelsFromDevFmt(enum DevFmtChannels chans);
|
||||
static __inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans,
|
||||
enum DevFmtType type)
|
||||
{
|
||||
return ChannelsFromDevFmt(chans) * BytesFromDevFmt(type);
|
||||
}
|
||||
|
||||
|
||||
struct ALCdevice_struct
|
||||
{
|
||||
ALCboolean Connected;
|
||||
ALboolean IsCaptureDevice;
|
||||
|
||||
ALuint Frequency;
|
||||
ALuint UpdateSize;
|
||||
ALuint NumUpdates;
|
||||
enum DevFmtChannels FmtChans;
|
||||
enum DevFmtType FmtType;
|
||||
|
||||
ALCchar *szDeviceName;
|
||||
|
||||
ALCenum LastError;
|
||||
|
||||
// Maximum number of sources that can be created
|
||||
ALuint MaxNoOfSources;
|
||||
// Maximum number of slots that can be created
|
||||
ALuint AuxiliaryEffectSlotMax;
|
||||
|
||||
ALCuint NumMonoSources;
|
||||
ALCuint NumStereoSources;
|
||||
ALuint NumAuxSends;
|
||||
|
||||
// Map of Buffers for this device
|
||||
UIntMap BufferMap;
|
||||
|
||||
// Map of Effects for this device
|
||||
UIntMap EffectMap;
|
||||
|
||||
// Map of Filters for this device
|
||||
UIntMap FilterMap;
|
||||
|
||||
// Map of Databuffers for this device
|
||||
UIntMap DatabufferMap;
|
||||
|
||||
// Stereo-to-binaural filter
|
||||
struct bs2b *Bs2b;
|
||||
ALCint Bs2bLevel;
|
||||
|
||||
// Simulated dampening from head occlusion
|
||||
ALfp HeadDampen;
|
||||
|
||||
// Duplicate stereo sources on the side/rear channels
|
||||
ALboolean DuplicateStereo;
|
||||
|
||||
// Dry path buffer mix
|
||||
ALfp DryBuffer[BUFFERSIZE][MAXCHANNELS];
|
||||
|
||||
ALuint DevChannels[MAXCHANNELS];
|
||||
|
||||
ALfp ChannelMatrix[MAXCHANNELS][MAXCHANNELS];
|
||||
|
||||
Channel Speaker2Chan[MAXCHANNELS];
|
||||
ALfp PanningLUT[MAXCHANNELS * LUT_NUM];
|
||||
ALuint NumChan;
|
||||
|
||||
ALfp ClickRemoval[MAXCHANNELS];
|
||||
ALfp PendingClicks[MAXCHANNELS];
|
||||
|
||||
// Contexts created on this device
|
||||
ALCcontext **Contexts;
|
||||
ALuint NumContexts;
|
||||
|
||||
BackendFuncs *Funcs;
|
||||
void *ExtraData; // For the backend's use
|
||||
|
||||
ALCdevice *next;
|
||||
};
|
||||
|
||||
#define ALCdevice_OpenPlayback(a,b) ((a)->Funcs->OpenPlayback((a), (b)))
|
||||
#define ALCdevice_ClosePlayback(a) ((a)->Funcs->ClosePlayback((a)))
|
||||
#define ALCdevice_ResetPlayback(a) ((a)->Funcs->ResetPlayback((a)))
|
||||
#define ALCdevice_StopPlayback(a) ((a)->Funcs->StopPlayback((a)))
|
||||
#define ALCdevice_OpenCapture(a,b) ((a)->Funcs->OpenCapture((a), (b)))
|
||||
#define ALCdevice_CloseCapture(a) ((a)->Funcs->CloseCapture((a)))
|
||||
#define ALCdevice_StartCapture(a) ((a)->Funcs->StartCapture((a)))
|
||||
#define ALCdevice_StopCapture(a) ((a)->Funcs->StopCapture((a)))
|
||||
#define ALCdevice_CaptureSamples(a,b,c) ((a)->Funcs->CaptureSamples((a), (b), (c)))
|
||||
#define ALCdevice_AvailableSamples(a) ((a)->Funcs->AvailableSamples((a)))
|
||||
|
||||
struct ALCcontext_struct
|
||||
{
|
||||
ALlistener Listener;
|
||||
|
||||
UIntMap SourceMap;
|
||||
UIntMap EffectSlotMap;
|
||||
|
||||
struct ALdatabuffer *SampleSource;
|
||||
struct ALdatabuffer *SampleSink;
|
||||
|
||||
ALenum LastError;
|
||||
|
||||
ALboolean Suspended;
|
||||
|
||||
ALenum DistanceModel;
|
||||
ALboolean SourceDistanceModel;
|
||||
|
||||
ALfp DopplerFactor;
|
||||
ALfp DopplerVelocity;
|
||||
ALfp flSpeedOfSound;
|
||||
|
||||
struct ALsource **ActiveSources;
|
||||
ALsizei ActiveSourceCount;
|
||||
ALsizei MaxActiveSources;
|
||||
|
||||
// Apportable Extension
|
||||
ALsizei PrioritySlots;
|
||||
|
||||
ALCdevice *Device;
|
||||
const ALCchar *ExtensionList;
|
||||
|
||||
ALCcontext *next;
|
||||
};
|
||||
|
||||
void AppendDeviceList(const ALCchar *name);
|
||||
void AppendAllDeviceList(const ALCchar *name);
|
||||
void AppendCaptureDeviceList(const ALCchar *name);
|
||||
|
||||
ALCvoid alcSetError(ALCdevice *device, ALenum errorCode);
|
||||
|
||||
ALCvoid SuspendContext(ALCcontext *context);
|
||||
ALCvoid ProcessContext(ALCcontext *context);
|
||||
|
||||
ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr);
|
||||
ALuint StopThread(ALvoid *thread);
|
||||
|
||||
ALCcontext *GetContextSuspended(void);
|
||||
|
||||
typedef struct RingBuffer RingBuffer;
|
||||
RingBuffer *CreateRingBuffer(ALsizei frame_size, ALsizei length);
|
||||
void DestroyRingBuffer(RingBuffer *ring);
|
||||
ALsizei RingBufferSize(RingBuffer *ring);
|
||||
void WriteRingBuffer(RingBuffer *ring, const ALubyte *data, ALsizei len);
|
||||
void ReadRingBuffer(RingBuffer *ring, ALubyte *data, ALsizei len);
|
||||
|
||||
void ReadALConfig(void);
|
||||
void FreeALConfig(void);
|
||||
int ConfigValueExists(const char *blockName, const char *keyName);
|
||||
const char *GetConfigValue(const char *blockName, const char *keyName, const char *def);
|
||||
int GetConfigValueInt(const char *blockName, const char *keyName, int def);
|
||||
float GetConfigValueFloat(const char *blockName, const char *keyName, float def);
|
||||
int GetConfigValueBool(const char *blockName, const char *keyName, int def);
|
||||
|
||||
void SetRTPriority(void);
|
||||
|
||||
void SetDefaultChannelOrder(ALCdevice *device);
|
||||
void SetDefaultWFXChannelOrder(ALCdevice *device);
|
||||
|
||||
void al_print(const char *fname, unsigned int line, const char *fmt, ...)
|
||||
PRINTF_STYLE(3,4);
|
||||
#define AL_PRINT(...) al_print(__FILE__, __LINE__, __VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,124 +0,0 @@
|
|||
#ifndef _AL_SOURCE_H_
|
||||
#define _AL_SOURCE_H_
|
||||
|
||||
#define MAX_SENDS 4
|
||||
|
||||
#include "alFilter.h"
|
||||
#include "alu.h"
|
||||
#include "AL/al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
POINT_RESAMPLER = 0,
|
||||
LINEAR_RESAMPLER,
|
||||
CUBIC_RESAMPLER,
|
||||
|
||||
RESAMPLER_MAX,
|
||||
RESAMPLER_MIN = -1,
|
||||
RESAMPLER_DEFAULT = LINEAR_RESAMPLER
|
||||
} resampler_t;
|
||||
extern resampler_t DefaultResampler;
|
||||
|
||||
extern const ALsizei ResamplerPadding[RESAMPLER_MAX];
|
||||
extern const ALsizei ResamplerPrePadding[RESAMPLER_MAX];
|
||||
|
||||
|
||||
typedef struct ALbufferlistitem
|
||||
{
|
||||
struct ALbuffer *buffer;
|
||||
struct ALbufferlistitem *next;
|
||||
struct ALbufferlistitem *prev;
|
||||
} ALbufferlistitem;
|
||||
|
||||
typedef struct ALsource
|
||||
{
|
||||
ALfp flPitch;
|
||||
ALfp flGain;
|
||||
ALfp flOuterGain;
|
||||
ALfp flMinGain;
|
||||
ALfp flMaxGain;
|
||||
ALfp flInnerAngle;
|
||||
ALfp flOuterAngle;
|
||||
ALfp flRefDistance;
|
||||
ALfp flMaxDistance;
|
||||
ALfp flRollOffFactor;
|
||||
ALfp vPosition[3];
|
||||
ALfp vVelocity[3];
|
||||
ALfp vOrientation[3];
|
||||
ALboolean bHeadRelative;
|
||||
ALboolean bLooping;
|
||||
ALenum DistanceModel;
|
||||
|
||||
// Apportably Extension
|
||||
ALuint priority;
|
||||
|
||||
resampler_t Resampler;
|
||||
|
||||
ALenum state;
|
||||
ALuint position;
|
||||
ALuint position_fraction;
|
||||
|
||||
struct ALbuffer *Buffer;
|
||||
|
||||
ALbufferlistitem *queue; // Linked list of buffers in queue
|
||||
ALuint BuffersInQueue; // Number of buffers in queue
|
||||
ALuint BuffersPlayed; // Number of buffers played on this loop
|
||||
|
||||
ALfilter DirectFilter;
|
||||
|
||||
struct {
|
||||
struct ALeffectslot *Slot;
|
||||
ALfilter WetFilter;
|
||||
} Send[MAX_SENDS];
|
||||
|
||||
ALboolean DryGainHFAuto;
|
||||
ALboolean WetGainAuto;
|
||||
ALboolean WetGainHFAuto;
|
||||
ALfp OuterGainHF;
|
||||
|
||||
ALfp AirAbsorptionFactor;
|
||||
ALfp RoomRolloffFactor;
|
||||
ALfp DopplerFactor;
|
||||
|
||||
ALint lOffset;
|
||||
ALint lOffsetType;
|
||||
|
||||
// Source Type (Static, Streaming, or Undetermined)
|
||||
ALint lSourceType;
|
||||
|
||||
// Current target parameters used for mixing
|
||||
ALboolean NeedsUpdate;
|
||||
struct {
|
||||
ALint Step;
|
||||
|
||||
/* A mixing matrix. First subscript is the channel number of the input
|
||||
* data (regardless of channel configuration) and the second is the
|
||||
* channel target (eg. FRONT_LEFT) */
|
||||
ALfp DryGains[MAXCHANNELS][MAXCHANNELS];
|
||||
FILTER iirFilter;
|
||||
ALfp history[MAXCHANNELS*2];
|
||||
|
||||
struct {
|
||||
ALfp WetGain;
|
||||
FILTER iirFilter;
|
||||
ALfp history[MAXCHANNELS];
|
||||
} Send[MAX_SENDS];
|
||||
} Params;
|
||||
|
||||
ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
|
||||
|
||||
// Index to itself
|
||||
ALuint source;
|
||||
} ALsource;
|
||||
#define ALsource_Update(s,a) ((s)->Update(s,a))
|
||||
|
||||
ALvoid ReleaseALSources(ALCcontext *Context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,14 +0,0 @@
|
|||
#ifndef _AL_STATE_H_
|
||||
#define _AL_STATE_H_
|
||||
|
||||
#include "AL/al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,42 +0,0 @@
|
|||
#ifndef _AL_THUNK_H_
|
||||
#define _AL_THUNK_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void alThunkInit(void);
|
||||
void alThunkExit(void);
|
||||
ALuint alThunkAddEntry(ALvoid *ptr);
|
||||
void alThunkRemoveEntry(ALuint index);
|
||||
ALvoid *alThunkLookupEntry(ALuint index);
|
||||
|
||||
#if (SIZEOF_VOIDP > SIZEOF_UINT)
|
||||
|
||||
#define ALTHUNK_INIT() alThunkInit()
|
||||
#define ALTHUNK_EXIT() alThunkExit()
|
||||
#define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p)
|
||||
#define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i)
|
||||
#define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i)
|
||||
|
||||
#else
|
||||
|
||||
#define ALTHUNK_INIT()
|
||||
#define ALTHUNK_EXIT()
|
||||
#define ALTHUNK_ADDENTRY(p) ((ALuint)p)
|
||||
#define ALTHUNK_REMOVEENTRY(i) ((ALvoid)i)
|
||||
#define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i))
|
||||
|
||||
#endif // (SIZEOF_VOIDP > SIZEOF_INT)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //_AL_THUNK_H_
|
||||
|
|
@ -1,338 +0,0 @@
|
|||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 1999-2007 by authors.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef __MINGW64__
|
||||
#define _WIN32_IE 0x501
|
||||
#else
|
||||
#define _WIN32_IE 0x400
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alMain.h"
|
||||
|
||||
#ifdef _WIN32_IE
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
typedef struct ConfigEntry {
|
||||
char *key;
|
||||
char *value;
|
||||
} ConfigEntry;
|
||||
|
||||
typedef struct ConfigBlock {
|
||||
char *name;
|
||||
ConfigEntry *entries;
|
||||
size_t entryCount;
|
||||
} ConfigBlock;
|
||||
|
||||
static ConfigBlock *cfgBlocks;
|
||||
static size_t cfgCount;
|
||||
|
||||
static char buffer[1024];
|
||||
|
||||
static void LoadConfigFromFile(FILE *f)
|
||||
{
|
||||
ConfigBlock *curBlock = cfgBlocks;
|
||||
ConfigEntry *ent;
|
||||
|
||||
while(fgets(buffer, sizeof(buffer), f))
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
while(isspace(buffer[i]))
|
||||
i++;
|
||||
if(!buffer[i] || buffer[i] == '#')
|
||||
continue;
|
||||
|
||||
memmove(buffer, buffer+i, strlen(buffer+i)+1);
|
||||
|
||||
if(buffer[0] == '[')
|
||||
{
|
||||
ConfigBlock *nextBlock;
|
||||
|
||||
i = 1;
|
||||
while(buffer[i] && buffer[i] != ']')
|
||||
i++;
|
||||
|
||||
if(!buffer[i])
|
||||
{
|
||||
AL_PRINT("config parse error: bad line \"%s\"\n", buffer);
|
||||
continue;
|
||||
}
|
||||
buffer[i] = 0;
|
||||
|
||||
do {
|
||||
i++;
|
||||
if(buffer[i] && !isspace(buffer[i]))
|
||||
{
|
||||
if(buffer[i] != '#')
|
||||
AL_PRINT("config warning: extra data after block: \"%s\"\n", buffer+i);
|
||||
break;
|
||||
}
|
||||
} while(buffer[i]);
|
||||
|
||||
nextBlock = NULL;
|
||||
for(i = 0;i < cfgCount;i++)
|
||||
{
|
||||
if(strcasecmp(cfgBlocks[i].name, buffer+1) == 0)
|
||||
{
|
||||
nextBlock = cfgBlocks+i;
|
||||
// AL_PRINT("found block '%s'\n", nextBlock->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!nextBlock)
|
||||
{
|
||||
nextBlock = realloc(cfgBlocks, (cfgCount+1)*sizeof(ConfigBlock));
|
||||
if(!nextBlock)
|
||||
{
|
||||
AL_PRINT("config parse error: error reallocating config blocks\n");
|
||||
continue;
|
||||
}
|
||||
cfgBlocks = nextBlock;
|
||||
nextBlock = cfgBlocks+cfgCount;
|
||||
cfgCount++;
|
||||
|
||||
nextBlock->name = strdup(buffer+1);
|
||||
nextBlock->entries = NULL;
|
||||
nextBlock->entryCount = 0;
|
||||
|
||||
// AL_PRINT("found new block '%s'\n", nextBlock->name);
|
||||
}
|
||||
curBlock = nextBlock;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Look for the option name */
|
||||
i = 0;
|
||||
while(buffer[i] && buffer[i] != '#' && buffer[i] != '=' &&
|
||||
!isspace(buffer[i]))
|
||||
i++;
|
||||
|
||||
if(!buffer[i] || buffer[i] == '#' || i == 0)
|
||||
{
|
||||
AL_PRINT("config parse error: malformed option line: \"%s\"\n", buffer);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Seperate the option */
|
||||
if(buffer[i] != '=')
|
||||
{
|
||||
buffer[i++] = 0;
|
||||
|
||||
while(isspace(buffer[i]))
|
||||
i++;
|
||||
if(buffer[i] != '=')
|
||||
{
|
||||
AL_PRINT("config parse error: option without a value: \"%s\"\n", buffer);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* Find the start of the value */
|
||||
buffer[i++] = 0;
|
||||
while(isspace(buffer[i]))
|
||||
i++;
|
||||
|
||||
/* Check if we already have this option set */
|
||||
ent = curBlock->entries;
|
||||
while((size_t)(ent-curBlock->entries) < curBlock->entryCount)
|
||||
{
|
||||
if(strcasecmp(ent->key, buffer) == 0)
|
||||
break;
|
||||
ent++;
|
||||
}
|
||||
|
||||
if((size_t)(ent-curBlock->entries) >= curBlock->entryCount)
|
||||
{
|
||||
/* Allocate a new option entry */
|
||||
ent = realloc(curBlock->entries, (curBlock->entryCount+1)*sizeof(ConfigEntry));
|
||||
if(!ent)
|
||||
{
|
||||
AL_PRINT("config parse error: error reallocating config entries\n");
|
||||
continue;
|
||||
}
|
||||
curBlock->entries = ent;
|
||||
ent = curBlock->entries + curBlock->entryCount;
|
||||
curBlock->entryCount++;
|
||||
|
||||
ent->key = strdup(buffer);
|
||||
ent->value = NULL;
|
||||
}
|
||||
|
||||
/* Look for the end of the line (Null term, new-line, or #-symbol) and
|
||||
eat up the trailing whitespace */
|
||||
memmove(buffer, buffer+i, strlen(buffer+i)+1);
|
||||
|
||||
i = 0;
|
||||
while(buffer[i] && buffer[i] != '#' && buffer[i] != '\n')
|
||||
i++;
|
||||
do {
|
||||
i--;
|
||||
} while(isspace(buffer[i]));
|
||||
buffer[++i] = 0;
|
||||
|
||||
free(ent->value);
|
||||
ent->value = strdup(buffer);
|
||||
|
||||
// AL_PRINT("found '%s' = '%s'\n", ent->key, ent->value);
|
||||
}
|
||||
}
|
||||
|
||||
void ReadALConfig(void)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
cfgBlocks = calloc(1, sizeof(ConfigBlock));
|
||||
cfgBlocks->name = strdup("general");
|
||||
cfgCount = 1;
|
||||
|
||||
#ifdef _WIN32
|
||||
if(SHGetSpecialFolderPathA(NULL, buffer, CSIDL_APPDATA, FALSE) != FALSE)
|
||||
{
|
||||
size_t p = strlen(buffer);
|
||||
snprintf(buffer+p, sizeof(buffer)-p, "\\alsoft.ini");
|
||||
f = fopen(buffer, "rt");
|
||||
if(f)
|
||||
{
|
||||
LoadConfigFromFile(f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
#else
|
||||
f = fopen("/etc/openal/alsoft.conf", "r");
|
||||
if(f)
|
||||
{
|
||||
LoadConfigFromFile(f);
|
||||
fclose(f);
|
||||
}
|
||||
if(getenv("HOME") && *(getenv("HOME")))
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "%s/.alsoftrc", getenv("HOME"));
|
||||
f = fopen(buffer, "r");
|
||||
if(f)
|
||||
{
|
||||
LoadConfigFromFile(f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(getenv("ALSOFT_CONF"))
|
||||
{
|
||||
f = fopen(getenv("ALSOFT_CONF"), "r");
|
||||
if(f)
|
||||
{
|
||||
LoadConfigFromFile(f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FreeALConfig(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for(i = 0;i < cfgCount;i++)
|
||||
{
|
||||
size_t j;
|
||||
for(j = 0;j < cfgBlocks[i].entryCount;j++)
|
||||
{
|
||||
free(cfgBlocks[i].entries[j].key);
|
||||
free(cfgBlocks[i].entries[j].value);
|
||||
}
|
||||
free(cfgBlocks[i].entries);
|
||||
free(cfgBlocks[i].name);
|
||||
}
|
||||
free(cfgBlocks);
|
||||
cfgBlocks = NULL;
|
||||
cfgCount = 0;
|
||||
}
|
||||
|
||||
const char *GetConfigValue(const char *blockName, const char *keyName, const char *def)
|
||||
{
|
||||
size_t i, j;
|
||||
|
||||
if(!keyName)
|
||||
return def;
|
||||
|
||||
if(!blockName)
|
||||
blockName = "general";
|
||||
|
||||
for(i = 0;i < cfgCount;i++)
|
||||
{
|
||||
if(strcasecmp(cfgBlocks[i].name, blockName) != 0)
|
||||
continue;
|
||||
|
||||
for(j = 0;j < cfgBlocks[i].entryCount;j++)
|
||||
{
|
||||
if(strcasecmp(cfgBlocks[i].entries[j].key, keyName) == 0)
|
||||
{
|
||||
if(cfgBlocks[i].entries[j].value[0])
|
||||
return cfgBlocks[i].entries[j].value;
|
||||
return def;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
int ConfigValueExists(const char *blockName, const char *keyName)
|
||||
{
|
||||
const char *val = GetConfigValue(blockName, keyName, "");
|
||||
return !!val[0];
|
||||
}
|
||||
|
||||
int GetConfigValueInt(const char *blockName, const char *keyName, int def)
|
||||
{
|
||||
const char *val = GetConfigValue(blockName, keyName, "");
|
||||
|
||||
if(!val[0]) return def;
|
||||
return strtol(val, NULL, 0);
|
||||
}
|
||||
|
||||
float GetConfigValueFloat(const char *blockName, const char *keyName, float def)
|
||||
{
|
||||
const char *val = GetConfigValue(blockName, keyName, "");
|
||||
|
||||
if(!val[0]) return def;
|
||||
#ifdef HAVE_STRTOF
|
||||
return strtof(val, NULL);
|
||||
#else
|
||||
return (float)strtod(val, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
int GetConfigValueBool(const char *blockName, const char *keyName, int def)
|
||||
{
|
||||
const char *val = GetConfigValue(blockName, keyName, "");
|
||||
|
||||
if(!val[0]) return !!def;
|
||||
return (strcasecmp(val, "true") == 0 || strcasecmp(val, "yes") == 0 ||
|
||||
strcasecmp(val, "on") == 0 || atoi(val) != 0);
|
||||
}
|
|
@ -1,203 +0,0 @@
|
|||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 2009 by Chris Robinson.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alMain.h"
|
||||
#include "alFilter.h"
|
||||
#include "alAuxEffectSlot.h"
|
||||
#include "alError.h"
|
||||
#include "alu.h"
|
||||
|
||||
|
||||
typedef struct ALechoState {
|
||||
// Must be first in all effects!
|
||||
ALeffectState state;
|
||||
|
||||
ALfp *SampleBuffer;
|
||||
ALuint BufferLength;
|
||||
|
||||
// The echo is two tap. The delay is the number of samples from before the
|
||||
// current offset
|
||||
struct {
|
||||
ALuint delay;
|
||||
} Tap[2];
|
||||
ALuint Offset;
|
||||
// The LR gains for the first tap. The second tap uses the reverse
|
||||
ALfp GainL;
|
||||
ALfp GainR;
|
||||
|
||||
ALfp FeedGain;
|
||||
|
||||
ALfp Gain[MAXCHANNELS];
|
||||
|
||||
FILTER iirFilter;
|
||||
ALfp history[2];
|
||||
} ALechoState;
|
||||
|
||||
static ALvoid EchoDestroy(ALeffectState *effect)
|
||||
{
|
||||
ALechoState *state = (ALechoState*)effect;
|
||||
if(state)
|
||||
{
|
||||
free(state->SampleBuffer);
|
||||
state->SampleBuffer = NULL;
|
||||
free(state);
|
||||
}
|
||||
}
|
||||
|
||||
static ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
|
||||
{
|
||||
ALechoState *state = (ALechoState*)effect;
|
||||
ALuint maxlen, i;
|
||||
|
||||
// Use the next power of 2 for the buffer length, so the tap offsets can be
|
||||
// wrapped using a mask instead of a modulo
|
||||
maxlen = (ALuint)(AL_ECHO_MAX_DELAY * Device->Frequency) + 1;
|
||||
maxlen += (ALuint)(AL_ECHO_MAX_LRDELAY * Device->Frequency) + 1;
|
||||
maxlen = NextPowerOf2(maxlen);
|
||||
|
||||
if(maxlen != state->BufferLength)
|
||||
{
|
||||
void *temp;
|
||||
|
||||
temp = realloc(state->SampleBuffer, maxlen * sizeof(ALfp));
|
||||
if(!temp)
|
||||
return AL_FALSE;
|
||||
state->SampleBuffer = temp;
|
||||
state->BufferLength = maxlen;
|
||||
}
|
||||
for(i = 0;i < state->BufferLength;i++)
|
||||
state->SampleBuffer[i] = int2ALfp(0);
|
||||
|
||||
for(i = 0;i < MAXCHANNELS;i++)
|
||||
state->Gain[i] = int2ALfp(0);
|
||||
for(i = 0;i < Device->NumChan;i++)
|
||||
{
|
||||
Channel chan = Device->Speaker2Chan[i];
|
||||
state->Gain[chan] = int2ALfp(1);
|
||||
}
|
||||
|
||||
return AL_TRUE;
|
||||
}
|
||||
|
||||
static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffect *Effect)
|
||||
{
|
||||
ALechoState *state = (ALechoState*)effect;
|
||||
ALuint frequency = Context->Device->Frequency;
|
||||
ALfp lrpan, cw, a, g;
|
||||
|
||||
state->Tap[0].delay = (ALuint)ALfp2int((ALfpMult(Effect->Echo.Delay, int2ALfp(frequency)) + int2ALfp(1)));
|
||||
state->Tap[1].delay = (ALuint)ALfp2int(ALfpMult(Effect->Echo.LRDelay, int2ALfp(frequency)));
|
||||
state->Tap[1].delay += state->Tap[0].delay;
|
||||
|
||||
lrpan = (ALfpMult(Effect->Echo.Spread, float2ALfp(0.5f)) + float2ALfp(0.5f));
|
||||
state->GainL = aluSqrt( lrpan);
|
||||
state->GainR = aluSqrt((int2ALfp(1)-lrpan));
|
||||
|
||||
state->FeedGain = Effect->Echo.Feedback;
|
||||
|
||||
cw = __cos(ALfpDiv(float2ALfp(2.0*M_PI * LOWPASSFREQCUTOFF), int2ALfp(frequency)));
|
||||
g = (int2ALfp(1) - Effect->Echo.Damping);
|
||||
a = int2ALfp(0);
|
||||
if(g < float2ALfp(0.9999f)) /* 1-epsilon */ {
|
||||
// a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / (1 - g);
|
||||
a = ALfpDiv((int2ALfp(1) - ALfpMult(g,cw) - aluSqrt((ALfpMult(ALfpMult(int2ALfp(2),g),(int2ALfp(1)-cw)) -
|
||||
ALfpMult(ALfpMult(g,g),(int2ALfp(1) - ALfpMult(cw,cw)))))),
|
||||
(int2ALfp(1) - g));
|
||||
}
|
||||
state->iirFilter.coeff = a;
|
||||
}
|
||||
|
||||
static ALvoid EchoProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfp *SamplesIn, ALfp (*SamplesOut)[MAXCHANNELS])
|
||||
{
|
||||
ALechoState *state = (ALechoState*)effect;
|
||||
const ALuint mask = state->BufferLength-1;
|
||||
const ALuint tap1 = state->Tap[0].delay;
|
||||
const ALuint tap2 = state->Tap[1].delay;
|
||||
ALuint offset = state->Offset;
|
||||
const ALfp gain = Slot->Gain;
|
||||
ALfp samp[2], smp;
|
||||
ALuint i;
|
||||
|
||||
for(i = 0;i < SamplesToDo;i++,offset++)
|
||||
{
|
||||
// Sample first tap
|
||||
smp = state->SampleBuffer[(offset-tap1) & mask];
|
||||
samp[0] = ALfpMult(smp, state->GainL);
|
||||
samp[1] = ALfpMult(smp, state->GainR);
|
||||
// Sample second tap. Reverse LR panning
|
||||
smp = state->SampleBuffer[(offset-tap2) & mask];
|
||||
samp[0] += ALfpMult(smp, state->GainR);
|
||||
samp[1] += ALfpMult(smp, state->GainL);
|
||||
|
||||
// Apply damping and feedback gain to the second tap, and mix in the
|
||||
// new sample
|
||||
smp = lpFilter2P(&state->iirFilter, 0, (smp+SamplesIn[i]));
|
||||
state->SampleBuffer[offset&mask] = ALfpMult(smp, state->FeedGain);
|
||||
|
||||
// Apply slot gain
|
||||
samp[0] = ALfpMult(samp[0], gain);
|
||||
samp[1] = ALfpMult(samp[1], gain);
|
||||
|
||||
SamplesOut[i][FRONT_LEFT] += ALfpMult(state->Gain[FRONT_LEFT], samp[0]);
|
||||
SamplesOut[i][FRONT_RIGHT] += ALfpMult(state->Gain[FRONT_RIGHT], samp[1]);
|
||||
#ifdef APPORTABLE_OPTIMIZED_OUT
|
||||
SamplesOut[i][SIDE_LEFT] += ALfpMult(state->Gain[SIDE_LEFT], samp[0]);
|
||||
SamplesOut[i][SIDE_RIGHT] += ALfpMult(state->Gain[SIDE_RIGHT], samp[1]);
|
||||
SamplesOut[i][BACK_LEFT] += ALfpMult(state->Gain[BACK_LEFT], samp[0]);
|
||||
SamplesOut[i][BACK_RIGHT] += ALfpMult(state->Gain[BACK_RIGHT], samp[1]);
|
||||
#endif
|
||||
|
||||
}
|
||||
state->Offset = offset;
|
||||
}
|
||||
|
||||
ALeffectState *EchoCreate(void)
|
||||
{
|
||||
ALechoState *state;
|
||||
|
||||
state = malloc(sizeof(*state));
|
||||
if(!state)
|
||||
return NULL;
|
||||
|
||||
state->state.Destroy = EchoDestroy;
|
||||
state->state.DeviceUpdate = EchoDeviceUpdate;
|
||||
state->state.Update = EchoUpdate;
|
||||
state->state.Process = EchoProcess;
|
||||
|
||||
state->BufferLength = 0;
|
||||
state->SampleBuffer = NULL;
|
||||
|
||||
state->Tap[0].delay = 0;
|
||||
state->Tap[1].delay = 0;
|
||||
state->Offset = 0;
|
||||
state->GainL = int2ALfp(0);
|
||||
state->GainR = int2ALfp(0);
|
||||
|
||||
state->iirFilter.coeff = int2ALfp(0);
|
||||
state->iirFilter.history[0] = int2ALfp(0);
|
||||
state->iirFilter.history[1] = int2ALfp(0);
|
||||
|
||||
return &state->state;
|
||||
}
|
|
@ -1,229 +0,0 @@
|
|||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 2009 by Chris Robinson.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alMain.h"
|
||||
#include "alFilter.h"
|
||||
#include "alAuxEffectSlot.h"
|
||||
#include "alError.h"
|
||||
#include "alu.h"
|
||||
|
||||
|
||||
typedef struct ALmodulatorState {
|
||||
// Must be first in all effects!
|
||||
ALeffectState state;
|
||||
|
||||
enum {
|
||||
SINUSOID,
|
||||
SAWTOOTH,
|
||||
SQUARE
|
||||
} Waveform;
|
||||
|
||||
ALuint index;
|
||||
ALuint step;
|
||||
|
||||
ALfp Gain[MAXCHANNELS];
|
||||
|
||||
FILTER iirFilter;
|
||||
ALfp history[1];
|
||||
} ALmodulatorState;
|
||||
|
||||
#define WAVEFORM_FRACBITS 16
|
||||
#define WAVEFORM_FRACMASK ((1<<WAVEFORM_FRACBITS)-1)
|
||||
|
||||
static __inline ALfp sin_func(ALuint index)
|
||||
{
|
||||
return __sin(ALdfpMult(ALdfpDiv(int2ALdfp(index),double2ALdfp(1<<WAVEFORM_FRACBITS)), double2ALdfp(M_PI * 2.0f)));
|
||||
}
|
||||
|
||||
static __inline ALfp saw_func(ALuint index)
|
||||
{
|
||||
return (ALfpDiv(int2ALfp(index*2), int2ALfp(1<<WAVEFORM_FRACBITS)) - int2ALfp(1));
|
||||
}
|
||||
|
||||
static __inline ALfp square_func(ALuint index)
|
||||
{
|
||||
return int2ALfp((float)((index>>(WAVEFORM_FRACBITS-1))&1) ? -1 : 1);
|
||||
}
|
||||
|
||||
|
||||
static __inline ALfp hpFilter1P(FILTER *iir, ALuint offset, ALfp input)
|
||||
{
|
||||
ALfp *history = &iir->history[offset];
|
||||
ALfp a = iir->coeff;
|
||||
ALfp output = input;
|
||||
|
||||
output = (output + ALfpMult((history[0]-output),a));
|
||||
history[0] = output;
|
||||
|
||||
return (input - output);
|
||||
}
|
||||
|
||||
|
||||
static ALvoid ModulatorDestroy(ALeffectState *effect)
|
||||
{
|
||||
ALmodulatorState *state = (ALmodulatorState*)effect;
|
||||
free(state);
|
||||
}
|
||||
|
||||
static ALboolean ModulatorDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
|
||||
{
|
||||
ALmodulatorState *state = (ALmodulatorState*)effect;
|
||||
ALuint index;
|
||||
|
||||
for(index = 0;index < MAXCHANNELS;index++)
|
||||
state->Gain[index] = int2ALfp(0);
|
||||
for(index = 0;index < Device->NumChan;index++)
|
||||
{
|
||||
Channel chan = Device->Speaker2Chan[index];
|
||||
state->Gain[chan] = int2ALfp(1);
|
||||
}
|
||||
|
||||
return AL_TRUE;
|
||||
}
|
||||
|
||||
static ALvoid ModulatorUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffect *Effect)
|
||||
{
|
||||
ALmodulatorState *state = (ALmodulatorState*)effect;
|
||||
ALfp cw, a;
|
||||
a = int2ALfp(0);
|
||||
|
||||
if(Effect->Modulator.Waveform == AL_RING_MODULATOR_SINUSOID)
|
||||
state->Waveform = SINUSOID;
|
||||
else if(Effect->Modulator.Waveform == AL_RING_MODULATOR_SAWTOOTH)
|
||||
state->Waveform = SAWTOOTH;
|
||||
else if(Effect->Modulator.Waveform == AL_RING_MODULATOR_SQUARE)
|
||||
state->Waveform = SQUARE;
|
||||
|
||||
state->step = ALfp2int(ALfpDiv(ALfpMult(Effect->Modulator.Frequency,
|
||||
int2ALfp(1<<WAVEFORM_FRACBITS)),
|
||||
int2ALfp(Context->Device->Frequency)));
|
||||
if(!state->step)
|
||||
state->step = 1;
|
||||
|
||||
cw = __cos(ALfpDiv(ALfpMult(float2ALfp(2.0*M_PI),
|
||||
Effect->Modulator.HighPassCutoff),
|
||||
int2ALfp(Context->Device->Frequency)));
|
||||
a = ((int2ALfp(2)-cw) -
|
||||
aluSqrt((aluPow((int2ALfp(2)-cw), int2ALfp(2)) - int2ALfp(1))));
|
||||
state->iirFilter.coeff = a;
|
||||
}
|
||||
|
||||
static ALvoid ModulatorProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfp *SamplesIn, ALfp (*SamplesOut)[MAXCHANNELS])
|
||||
{
|
||||
ALmodulatorState *state = (ALmodulatorState*)effect;
|
||||
const ALfp gain = Slot->Gain;
|
||||
const ALuint step = state->step;
|
||||
ALuint index = state->index;
|
||||
ALfp samp;
|
||||
ALuint i;
|
||||
|
||||
switch(state->Waveform)
|
||||
{
|
||||
case SINUSOID:
|
||||
for(i = 0;i < SamplesToDo;i++)
|
||||
{
|
||||
#ifdef APPORTABLE_OPTIMIZED_OUT
|
||||
#define FILTER_OUT(func) do { \
|
||||
samp = SamplesIn[i]; \
|
||||
\
|
||||
index += step; \
|
||||
index &= WAVEFORM_FRACMASK; \
|
||||
samp *= func(index); \
|
||||
\
|
||||
samp = hpFilter1P(&state->iirFilter, 0, samp); \
|
||||
\
|
||||
/* Apply slot gain */ \
|
||||
samp *= gain; \
|
||||
\
|
||||
SamplesOut[i][FRONT_LEFT] += state->Gain[FRONT_LEFT] * samp; \
|
||||
SamplesOut[i][FRONT_RIGHT] += state->Gain[FRONT_RIGHT] * samp; \
|
||||
SamplesOut[i][FRONT_CENTER] += state->Gain[FRONT_CENTER] * samp; \
|
||||
SamplesOut[i][SIDE_LEFT] += state->Gain[SIDE_LEFT] * samp; \
|
||||
SamplesOut[i][SIDE_RIGHT] += state->Gain[SIDE_RIGHT] * samp; \
|
||||
SamplesOut[i][BACK_LEFT] += state->Gain[BACK_LEFT] * samp; \
|
||||
SamplesOut[i][BACK_RIGHT] += state->Gain[BACK_RIGHT] * samp; \
|
||||
SamplesOut[i][BACK_CENTER] += state->Gain[BACK_CENTER] * samp; \
|
||||
} while(0)
|
||||
#else
|
||||
//Apportable optimized version
|
||||
#define FILTER_OUT(func) do { \
|
||||
samp = SamplesIn[i]; \
|
||||
\
|
||||
index += step; \
|
||||
index &= WAVEFORM_FRACMASK; \
|
||||
samp = ALfpMult(samp, func(index)); \
|
||||
\
|
||||
samp = hpFilter1P(&state->iirFilter, 0, samp); \
|
||||
\
|
||||
/* Apply slot gain */ \
|
||||
samp = ALfpMult(samp, gain); \
|
||||
\
|
||||
SamplesOut[i][FRONT_LEFT] += ALfpMult(state->Gain[FRONT_LEFT], samp); \
|
||||
SamplesOut[i][FRONT_RIGHT] += ALfpMult(state->Gain[FRONT_RIGHT], samp); \
|
||||
} while(0)
|
||||
#endif
|
||||
FILTER_OUT(sin_func);
|
||||
}
|
||||
break;
|
||||
|
||||
case SAWTOOTH:
|
||||
for(i = 0;i < SamplesToDo;i++)
|
||||
{
|
||||
FILTER_OUT(saw_func);
|
||||
}
|
||||
break;
|
||||
|
||||
case SQUARE:
|
||||
for(i = 0;i < SamplesToDo;i++)
|
||||
{
|
||||
FILTER_OUT(square_func);
|
||||
#undef FILTER_OUT
|
||||
}
|
||||
break;
|
||||
}
|
||||
state->index = index;
|
||||
}
|
||||
|
||||
ALeffectState *ModulatorCreate(void)
|
||||
{
|
||||
ALmodulatorState *state;
|
||||
|
||||
state = malloc(sizeof(*state));
|
||||
if(!state)
|
||||
return NULL;
|
||||
|
||||
state->state.Destroy = ModulatorDestroy;
|
||||
state->state.DeviceUpdate = ModulatorDeviceUpdate;
|
||||
state->state.Update = ModulatorUpdate;
|
||||
state->state.Process = ModulatorProcess;
|
||||
|
||||
state->index = 0;
|
||||
state->step = 1;
|
||||
|
||||
state->iirFilter.coeff = int2ALfp(0);
|
||||
state->iirFilter.history[0] = int2ALfp(0);
|
||||
|
||||
return &state->state;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,131 +0,0 @@
|
|||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 1999-2007 by authors.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alMain.h"
|
||||
|
||||
|
||||
struct RingBuffer {
|
||||
ALubyte *mem;
|
||||
|
||||
ALsizei frame_size;
|
||||
ALsizei length;
|
||||
ALint read_pos;
|
||||
ALint write_pos;
|
||||
|
||||
CRITICAL_SECTION cs;
|
||||
};
|
||||
|
||||
|
||||
RingBuffer *CreateRingBuffer(ALsizei frame_size, ALsizei length)
|
||||
{
|
||||
RingBuffer *ring = calloc(1, sizeof(*ring));
|
||||
if(ring)
|
||||
{
|
||||
ring->frame_size = frame_size;
|
||||
ring->length = length+1;
|
||||
ring->write_pos = 1;
|
||||
ring->mem = malloc(ring->length * ring->frame_size);
|
||||
if(!ring->mem)
|
||||
{
|
||||
free(ring);
|
||||
ring = NULL;
|
||||
}
|
||||
|
||||
InitializeCriticalSection(&ring->cs);
|
||||
}
|
||||
return ring;
|
||||
}
|
||||
|
||||
void DestroyRingBuffer(RingBuffer *ring)
|
||||
{
|
||||
if(ring)
|
||||
{
|
||||
DeleteCriticalSection(&ring->cs);
|
||||
free(ring->mem);
|
||||
free(ring);
|
||||
}
|
||||
}
|
||||
|
||||
ALsizei RingBufferSize(RingBuffer *ring)
|
||||
{
|
||||
ALsizei s;
|
||||
|
||||
EnterCriticalSection(&ring->cs);
|
||||
s = (ring->write_pos-ring->read_pos-1+ring->length) % ring->length;
|
||||
LeaveCriticalSection(&ring->cs);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void WriteRingBuffer(RingBuffer *ring, const ALubyte *data, ALsizei len)
|
||||
{
|
||||
int remain;
|
||||
|
||||
EnterCriticalSection(&ring->cs);
|
||||
|
||||
remain = (ring->read_pos-ring->write_pos+ring->length) % ring->length;
|
||||
if(remain < len) len = remain;
|
||||
|
||||
if(len > 0)
|
||||
{
|
||||
remain = ring->length - ring->write_pos;
|
||||
if(remain < len)
|
||||
{
|
||||
memcpy(ring->mem+(ring->write_pos*ring->frame_size), data,
|
||||
remain*ring->frame_size);
|
||||
memcpy(ring->mem, data+(remain*ring->frame_size),
|
||||
(len-remain)*ring->frame_size);
|
||||
}
|
||||
else
|
||||
memcpy(ring->mem+(ring->write_pos*ring->frame_size), data,
|
||||
len*ring->frame_size);
|
||||
|
||||
ring->write_pos += len;
|
||||
ring->write_pos %= ring->length;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&ring->cs);
|
||||
}
|
||||
|
||||
void ReadRingBuffer(RingBuffer *ring, ALubyte *data, ALsizei len)
|
||||
{
|
||||
int remain;
|
||||
|
||||
EnterCriticalSection(&ring->cs);
|
||||
|
||||
remain = ring->length - ring->read_pos;
|
||||
if(remain < len)
|
||||
{
|
||||
memcpy(data, ring->mem+(ring->read_pos*ring->frame_size), remain*ring->frame_size);
|
||||
memcpy(data+(remain*ring->frame_size), ring->mem, (len-remain)*ring->frame_size);
|
||||
}
|
||||
else
|
||||
memcpy(data, ring->mem+(ring->read_pos*ring->frame_size), len*ring->frame_size);
|
||||
|
||||
ring->read_pos += len;
|
||||
ring->read_pos %= ring->length;
|
||||
|
||||
LeaveCriticalSection(&ring->cs);
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 1999-2007 by authors.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alMain.h"
|
||||
#include "alThunk.h"
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
typedef struct {
|
||||
ALuint (*func)(ALvoid*);
|
||||
ALvoid *ptr;
|
||||
HANDLE thread;
|
||||
} ThreadInfo;
|
||||
|
||||
static DWORD CALLBACK StarterFunc(void *ptr)
|
||||
{
|
||||
ThreadInfo *inf = (ThreadInfo*)ptr;
|
||||
ALint ret;
|
||||
|
||||
ret = inf->func(inf->ptr);
|
||||
ExitThread((DWORD)ret);
|
||||
|
||||
return (DWORD)ret;
|
||||
}
|
||||
|
||||
ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr)
|
||||
{
|
||||
DWORD dummy;
|
||||
ThreadInfo *inf = malloc(sizeof(ThreadInfo));
|
||||
if(!inf) return 0;
|
||||
|
||||
inf->func = func;
|
||||
inf->ptr = ptr;
|
||||
|
||||
inf->thread = CreateThread(NULL, 0, StarterFunc, inf, 0, &dummy);
|
||||
if(!inf->thread)
|
||||
{
|
||||
free(inf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return inf;
|
||||
}
|
||||
|
||||
ALuint StopThread(ALvoid *thread)
|
||||
{
|
||||
ThreadInfo *inf = thread;
|
||||
DWORD ret = 0;
|
||||
|
||||
WaitForSingleObject(inf->thread, INFINITE);
|
||||
GetExitCodeThread(inf->thread, &ret);
|
||||
CloseHandle(inf->thread);
|
||||
|
||||
free(inf);
|
||||
|
||||
return (ALuint)ret;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
typedef struct {
|
||||
ALuint (*func)(ALvoid*);
|
||||
ALvoid *ptr;
|
||||
ALuint ret;
|
||||
pthread_t thread;
|
||||
} ThreadInfo;
|
||||
|
||||
static void *StarterFunc(void *ptr)
|
||||
{
|
||||
ThreadInfo *inf = (ThreadInfo*)ptr;
|
||||
inf->ret = inf->func(inf->ptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr)
|
||||
{
|
||||
ThreadInfo *inf = malloc(sizeof(ThreadInfo));
|
||||
if(!inf) return NULL;
|
||||
|
||||
inf->func = func;
|
||||
inf->ptr = ptr;
|
||||
if(pthread_create(&inf->thread, NULL, StarterFunc, inf) != 0)
|
||||
{
|
||||
free(inf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return inf;
|
||||
}
|
||||
|
||||
ALuint StopThread(ALvoid *thread)
|
||||
{
|
||||
ThreadInfo *inf = thread;
|
||||
ALuint ret;
|
||||
|
||||
pthread_join(inf->thread, NULL);
|
||||
ret = inf->ret;
|
||||
|
||||
free(inf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,140 +0,0 @@
|
|||
#ifndef _ALU_H_
|
||||
#define _ALU_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
#include "AL/alext.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#ifdef HAVE_FLOAT_H
|
||||
#include <float.h>
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 /* pi */
|
||||
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POWF
|
||||
#define aluPow(x,y) (float2ALfp(powf(ALfp2float(x), ALfp2float(y))))
|
||||
#else
|
||||
#define aluPow(x,y) (float2ALfp((float)pow((double)ALfp2float(x), (double)ALfp2float(y))))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SQRTF
|
||||
#define aluSqrt(x) (float2ALfp(sqrtf(ALfp2float(x))))
|
||||
#else
|
||||
#define aluSqrt(x) (float2ALfp((float)sqrt((double)ALfp2float(x))))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ACOSF
|
||||
#define aluAcos(x) (float2ALfp(acosf(ALfp2float(x))))
|
||||
#else
|
||||
#define aluAcos(x) (float2ALfp((float)acos((double)ALfp2float(x))))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ATANF
|
||||
#define aluAtan(x) (float2ALfp(atanf(ALfp2float(x))))
|
||||
#else
|
||||
#define aluAtan(x) (float2ALfp((float)atan((double)ALfp2float(x))))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FABSF
|
||||
#define aluFabs(x) (float2ALfp(fabsf(ALfp2float(x))))
|
||||
#else
|
||||
#define aluFabs(x) (float2ALfp((float)fabs((double)ALfp2float(x))))
|
||||
#endif
|
||||
|
||||
// FIXME make this better
|
||||
#if defined(max) && !defined(__max)
|
||||
#define __max(x,y) float2ALfp(max(ALfp2float(x),ALfp2float(y)))
|
||||
#endif
|
||||
#if defined(min) && !defined(__min)
|
||||
#define __min(x,y) float2ALfp(min(ALfp2float(x),ALfp2float(y)))
|
||||
#endif
|
||||
|
||||
#define QUADRANT_NUM 128
|
||||
#define LUT_NUM (4 * QUADRANT_NUM)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
FRONT_LEFT = 0,
|
||||
FRONT_RIGHT,
|
||||
FRONT_CENTER,
|
||||
LFE,
|
||||
BACK_LEFT,
|
||||
BACK_RIGHT,
|
||||
BACK_CENTER,
|
||||
SIDE_LEFT,
|
||||
SIDE_RIGHT,
|
||||
} Channel;
|
||||
|
||||
#ifndef MAXCHANNELS
|
||||
#define MAXCHANNELS (SIDE_RIGHT+1)
|
||||
#error MAXCHANNELS
|
||||
#endif
|
||||
|
||||
#define BUFFERSIZE 4096
|
||||
|
||||
#define FRACTIONBITS (14)
|
||||
#define FRACTIONONE (1<<FRACTIONBITS)
|
||||
#define FRACTIONMASK (FRACTIONONE-1)
|
||||
|
||||
/* Size for temporary stack storage of buffer data. Larger values need more
|
||||
* stack, while smaller values may need more iterations. The value needs to be
|
||||
* a sensible size, however, as it constrains the max stepping value used for
|
||||
* mixing.
|
||||
* The mixer requires being able to do two samplings per mixing loop. A 16KB
|
||||
* buffer can hold 512 sample frames for a 7.1 float buffer. With the cubic
|
||||
* resampler (which requires 3 padding sample frames), this limits the maximum
|
||||
* step to about 508. This means that buffer_freq*source_pitch cannot exceed
|
||||
* device_freq*508 for an 8-channel 32-bit buffer. */
|
||||
#ifndef STACK_DATA_SIZE
|
||||
#define STACK_DATA_SIZE 16384
|
||||
#endif
|
||||
|
||||
//FIXME this code assumes ALfp==ALdfp
|
||||
static __inline ALdfp lerp(ALdfp val1, ALdfp val2, ALdfp mu)
|
||||
{
|
||||
ALdfp retval;
|
||||
retval = val1 + ALfpMult((val2-val1),mu);
|
||||
return retval;
|
||||
}
|
||||
static __inline ALdfp cubic(ALdfp val0, ALdfp val1, ALdfp val2, ALdfp val3, ALdfp mu)
|
||||
{
|
||||
ALdfp retval;
|
||||
ALdfp mu2;mu2 = ALfpMult(mu,mu);
|
||||
ALdfp a0;a0 = ALfpMult(float2ALfp(-0.5f),val0) + ALfpMult(float2ALfp( 1.5f),val1) + ALfpMult(float2ALfp(-1.5f),val2) + ALfpMult(float2ALfp( 0.5), val3);
|
||||
ALdfp a1;a1 = val0 + ALfpMult(float2ALfp(-2.5f),val1) + ALfpMult(float2ALfp( 2.0), val2) + ALfpMult(float2ALfp(-0.5f),val3);
|
||||
ALdfp a2;a2 = ALfpMult(float2ALfp(-0.5f),val0) + ALfpMult(float2ALfp( 0.5), val2);
|
||||
ALdfp a3;a3 = val1;
|
||||
|
||||
retval = ALfpMult(ALfpMult(a0,mu),mu2) + ALfpMult(a1,mu2) + ALfpMult(a2,mu) + a3;
|
||||
return retval;
|
||||
}
|
||||
|
||||
struct ALsource;
|
||||
|
||||
ALvoid aluInitPanning(ALCdevice *Device);
|
||||
ALint aluCart2LUTpos(ALfp re, ALfp im);
|
||||
|
||||
ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);
|
||||
ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);
|
||||
|
||||
ALvoid MixSource(struct ALsource *Source, ALCdevice *Device, ALuint SamplesToDo);
|
||||
|
||||
ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size);
|
||||
ALvoid aluHandleDisconnect(ALCdevice *device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#ifdef ANDROID
|
||||
#include <jni.h>
|
||||
#include "alMain.h"
|
||||
#include "apportable_openal_funcs.h"
|
||||
|
||||
static JavaVM *javaVM = NULL;
|
||||
JavaVM *alcGetJavaVM(void) {
|
||||
return javaVM;
|
||||
}
|
||||
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
BackendFuncs func_list;
|
||||
if (apportableOpenALFuncs.alc_android_set_java_vm) {
|
||||
apportableOpenALFuncs.alc_android_set_java_vm(vm);
|
||||
}
|
||||
javaVM = vm;
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
||||
void JNICALL JNI_OnUnload (JavaVM *vm, void *reserved)
|
||||
{
|
||||
if (apportableOpenALFuncs.alc_android_set_java_vm) {
|
||||
apportableOpenALFuncs.alc_android_set_java_vm(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
ALC_API void ALC_APIENTRY alcSuspend(void) {
|
||||
if (apportableOpenALFuncs.alc_android_suspend) {
|
||||
apportableOpenALFuncs.alc_android_suspend();
|
||||
}
|
||||
}
|
||||
|
||||
ALC_API void ALC_APIENTRY alcResume(void) {
|
||||
if (apportableOpenALFuncs.alc_android_resume) {
|
||||
apportableOpenALFuncs.alc_android_resume();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue