mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-18 02:25:11 +00:00
Compare commits
No commits in common. "master" and "dev123" have entirely different histories.
3842 changed files with 192308 additions and 1586919 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1 +0,0 @@
|
||||||
*.sfd text
|
|
1
.github/issue_template.md
vendored
1
.github/issue_template.md
vendored
|
@ -1 +0,0 @@
|
||||||
please do not post suggestions, feature requests or non-issue discussions here. go to Discussions if you want to post these instead.
|
|
1
.github/issue_template/config.yml
vendored
1
.github/issue_template/config.yml
vendored
|
@ -1 +0,0 @@
|
||||||
blank_issues_enabled: false
|
|
33
.github/issue_template/issue.yml
vendored
33
.github/issue_template/issue.yml
vendored
|
@ -1,33 +0,0 @@
|
||||||
name: Issue Report
|
|
||||||
description: for issues (bugs, annoyances, crashes and similar).
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Suggestions, feature requests, questions, showcase or anything else? Go to the Discussions section.
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
- type: textarea
|
|
||||||
id: steps
|
|
||||||
attributes:
|
|
||||||
label: Steps to Reproduce (if applicable)
|
|
||||||
- type: textarea
|
|
||||||
id: info
|
|
||||||
attributes:
|
|
||||||
label: Additional Information
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: Furnace version? (help > about)
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: checkboxes
|
|
||||||
id: terms
|
|
||||||
attributes:
|
|
||||||
label: This is an issue
|
|
||||||
description: By submitting this issue, you affirm that this is an actual issue (not a suggestion, question or otherwise non-issue).
|
|
||||||
options:
|
|
||||||
- label: I hereby certify that the ticket I am submitting is an issue.
|
|
||||||
required: true
|
|
5
.github/pull_request_template.md
vendored
5
.github/pull_request_template.md
vendored
|
@ -1,4 +1 @@
|
||||||
<!--
|
<!-- NOTICE: if you are contributing a new system, please be sure to ask tildearrow first in order to get system IDs allocated! -->
|
||||||
NOTICE: if you are contributing a new system, please be sure to ask tildearrow first in order to get system IDs allocated!
|
|
||||||
Do NOT Force-Push after submitting Pull Request! If you do so, your pull request will be closed.
|
|
||||||
-->
|
|
||||||
|
|
200
.github/workflows/build.yml
vendored
200
.github/workflows/build.yml
vendored
|
@ -2,7 +2,7 @@ name: Build furnace
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master, theUltimateFix]
|
branches: master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: master
|
branches: master
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ defaults:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: Debug
|
BUILD_TYPE: Release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -20,20 +20,20 @@ jobs:
|
||||||
config:
|
config:
|
||||||
- { name: 'Windows MSVC x86', os: windows-latest, compiler: msvc, arch: x86 }
|
- { name: 'Windows MSVC x86', os: windows-latest, compiler: msvc, arch: x86 }
|
||||||
- { name: 'Windows MSVC x86_64', os: windows-latest, compiler: msvc, arch: x86_64 }
|
- { name: 'Windows MSVC x86_64', os: windows-latest, compiler: msvc, arch: x86_64 }
|
||||||
#- { name: 'Windows MinGW x86', os: ubuntu-20.04, compiler: mingw, arch: x86 }
|
- { name: 'Windows MinGW x86', os: ubuntu-20.04, compiler: mingw, arch: x86 }
|
||||||
#- { name: 'Windows MinGW x86_64', os: ubuntu-20.04, compiler: mingw, arch: x86_64 }
|
- { name: 'Windows MinGW x86_64', os: ubuntu-20.04, compiler: mingw, arch: x86_64 }
|
||||||
- { name: 'macOS x86_64', os: macos-13, arch: x86_64 }
|
- { name: 'macOS x86_64', os: macos-latest, arch: x86_64 }
|
||||||
- { name: 'macOS ARM', os: macos-latest, arch: arm64 }
|
- { name: 'macOS ARM', os: macos-latest, arch: arm64 }
|
||||||
- { name: 'Linux x86_64', os: ubuntu-20.04, arch: x86_64 }
|
- { name: 'Linux x86_64', os: ubuntu-18.04, arch: x86_64 }
|
||||||
#- { name: 'Linux ARM', os: ubuntu-18.04, arch: armhf }
|
- { name: 'Linux ARM', os: ubuntu-18.04, arch: armhf }
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
|
|
||||||
name: ${{ matrix.config.name }}
|
name: ${{ matrix.config.name }}
|
||||||
runs-on: ${{ matrix.config.os }}
|
runs-on: ${{ matrix.config.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v3.1.0
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ jobs:
|
||||||
package_ext=".dmg"
|
package_ext=".dmg"
|
||||||
else
|
else
|
||||||
package_name="${package_name}-Linux-${{ matrix.config.arch }}"
|
package_name="${package_name}-Linux-${{ matrix.config.arch }}"
|
||||||
package_ext=".tar.gz"
|
package_ext=".AppImage"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Package identifier: ${package_name}"
|
echo "Package identifier: ${package_name}"
|
||||||
|
@ -106,7 +106,7 @@ jobs:
|
||||||
|
|
||||||
- name: Setup Toolchain [Windows MSVC]
|
- name: Setup Toolchain [Windows MSVC]
|
||||||
if: ${{ matrix.config.compiler == 'msvc' }}
|
if: ${{ matrix.config.compiler == 'msvc' }}
|
||||||
uses: lunathir/gha-setup-vsdevenv@avoid-deprecation-warnings
|
uses: vadz/gha-setup-vsdevenv@avoid-deprecation-warnings
|
||||||
with:
|
with:
|
||||||
arch: ${{ steps.windows-identify.outputs.vswhere-target }}
|
arch: ${{ steps.windows-identify.outputs.vswhere-target }}
|
||||||
|
|
||||||
|
@ -129,7 +129,9 @@ jobs:
|
||||||
libsndfile1-dev \
|
libsndfile1-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
libjack-jackd2-dev \
|
libjack-jackd2-dev \
|
||||||
gettext
|
appstream
|
||||||
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" || wget "https://tildearrow.org/storage/furnace/ci/appimagetool-x86_64.AppImage"
|
||||||
|
chmod +x appimagetool-x86_64.AppImage
|
||||||
|
|
||||||
- name: Install Dependencies [Linux armhf]
|
- name: Install Dependencies [Linux armhf]
|
||||||
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' && matrix.config.arch == 'armhf' }}
|
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' && matrix.config.arch == 'armhf' }}
|
||||||
|
@ -141,8 +143,7 @@ jobs:
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install \
|
sudo apt install \
|
||||||
crossbuild-essential-armhf \
|
crossbuild-essential-armhf \
|
||||||
appstream \
|
appstream
|
||||||
gettext
|
|
||||||
sudo apt install \
|
sudo apt install \
|
||||||
libsdl2-dev:armhf \
|
libsdl2-dev:armhf \
|
||||||
libfmt-dev:armhf \
|
libfmt-dev:armhf \
|
||||||
|
@ -150,12 +151,61 @@ jobs:
|
||||||
libsndfile1-dev:armhf \
|
libsndfile1-dev:armhf \
|
||||||
zlib1g-dev:armhf \
|
zlib1g-dev:armhf \
|
||||||
libjack-jackd2-dev:armhf
|
libjack-jackd2-dev:armhf
|
||||||
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" || wget "https://tildearrow.org/storage/furnace/ci/appimagetool-x86_64.AppImage"
|
||||||
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-armhf" || wget "https://tildearrow.org/storage/furnace/ci/runtime-armhf"
|
||||||
|
chmod +x appimagetool-x86_64.AppImage
|
||||||
ls /usr/arm-linux-gnueabihf/lib
|
ls /usr/arm-linux-gnueabihf/lib
|
||||||
|
|
||||||
- name: Build Language Files
|
- name: Configure (System Libraries)
|
||||||
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' }}
|
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' && matrix.config.arch == 'x86_64' }}
|
||||||
run: |
|
run: |
|
||||||
./scripts/build-po.sh
|
export USE_WAE=ON
|
||||||
|
export CMAKE_EXTRA_ARGS=()
|
||||||
|
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
||||||
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_GENERATOR_PLATFORM=${{ steps.windows-identify.outputs.msvc-target }}')
|
||||||
|
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
||||||
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-${{ steps.windows-identify.outputs.mingw-target }}.cmake')
|
||||||
|
else
|
||||||
|
# Test with system libs
|
||||||
|
CMAKE_EXTRA_ARGS+=(
|
||||||
|
'-DSYSTEM_FMT=OFF'
|
||||||
|
'-DSYSTEM_LIBSNDFILE=ON'
|
||||||
|
'-DSYSTEM_RTMIDI=ON'
|
||||||
|
'-DSYSTEM_ZLIB=ON'
|
||||||
|
'-DWITH_JACK=ON'
|
||||||
|
)
|
||||||
|
# Too old on Ubuntu
|
||||||
|
if [ '${{ runner.os }}' == 'macOS' ]; then
|
||||||
|
CMAKE_EXTRA_ARGS+=('-DSYSTEM_SDL2=ON')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
cmake \
|
||||||
|
-B ${PWD}/build \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${PWD}/target \
|
||||||
|
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
|
||||||
|
-DWARNINGS_ARE_ERRORS=${USE_WAE} \
|
||||||
|
"${CMAKE_EXTRA_ARGS[@]}"
|
||||||
|
|
||||||
|
- name: Build (System Libraries)
|
||||||
|
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' && matrix.config.arch == 'x86_64' }}
|
||||||
|
run: |
|
||||||
|
cmake \
|
||||||
|
--build ${PWD}/build \
|
||||||
|
--config ${{ env.BUILD_TYPE }} \
|
||||||
|
--parallel ${{ steps.build-cores.outputs.amount }}
|
||||||
|
|
||||||
|
- name: Install (System Libraries)
|
||||||
|
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' && matrix.config.arch == 'x86_64' }}
|
||||||
|
run: |
|
||||||
|
cmake \
|
||||||
|
--install ${PWD}/build \
|
||||||
|
--config ${{ env.BUILD_TYPE }}
|
||||||
|
|
||||||
|
- name: Cleanup (System Libraries)
|
||||||
|
if: ${{ runner.os == 'Linux' && matrix.config.compiler != 'mingw' && matrix.config.arch == 'x86_64' }}
|
||||||
|
run: |
|
||||||
|
rm -rf build/ target/
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
|
@ -175,14 +225,11 @@ jobs:
|
||||||
fi
|
fi
|
||||||
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
elif [ '${{ matrix.config.compiler }}' == 'mingw' ]; then
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-${{ steps.windows-identify.outputs.mingw-target }}.cmake')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-MinGW-${{ steps.windows-identify.outputs.mingw-target }}.cmake')
|
||||||
if [ '${{ matrix.config.arch }}' == 'x86' ]; then
|
|
||||||
CMAKE_EXTRA_ARGS+=('-DSUPPORT_XP=ON')
|
|
||||||
fi
|
|
||||||
elif [ '${{ runner.os }}' == 'macOS' ]; then
|
elif [ '${{ runner.os }}' == 'macOS' ]; then
|
||||||
if [ '${{ matrix.config.arch }}' == 'arm64' ]; then
|
if [ '${{ matrix.config.arch }}' == 'arm64' ]; then
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0"' '-DCMAKE_OSX_ARCHITECTURES=arm64' '-DMAKE_BUNDLE=ON')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0"' '-DCMAKE_OSX_ARCHITECTURES=arm64')
|
||||||
else
|
else
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="10.9"' '-DCMAKE_OSX_ARCHITECTURES=x86_64' '-DMAKE_BUNDLE=ON' '-DCMAKE_C_FLAGS=-march=core2' '-DCMAKE_CXX_FLAGS=-march=core2')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_OSX_DEPLOYMENT_TARGET="10.9"')
|
||||||
fi
|
fi
|
||||||
elif [ '${{ runner.os }}' == 'Linux' ] && [ '${{ matrix.config.arch }}' == 'armhf' ]; then
|
elif [ '${{ runner.os }}' == 'Linux' ] && [ '${{ matrix.config.arch }}' == 'armhf' ]; then
|
||||||
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-Linux-armhf.cmake')
|
CMAKE_EXTRA_ARGS+=('-DCMAKE_TOOLCHAIN_FILE=scripts/Cross-Linux-armhf.cmake')
|
||||||
|
@ -193,7 +240,6 @@ jobs:
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
|
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
|
||||||
-DWARNINGS_ARE_ERRORS=${USE_WAE} \
|
-DWARNINGS_ARE_ERRORS=${USE_WAE} \
|
||||||
-DWITH_DEMOS=OFF -DWITH_INSTRUMENTS=OFF -DWITH_WAVETABLES=OFF \
|
|
||||||
"${CMAKE_EXTRA_ARGS[@]}"
|
"${CMAKE_EXTRA_ARGS[@]}"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
@ -227,15 +273,8 @@ jobs:
|
||||||
pushd ${{ steps.package-identify.outputs.filename }}
|
pushd ${{ steps.package-identify.outputs.filename }}
|
||||||
|
|
||||||
cp -v ../LICENSE LICENSE.txt
|
cp -v ../LICENSE LICENSE.txt
|
||||||
cp -v ../res/releaseReadme/unstable-win.txt README.txt
|
cp -v ../README.md README.txt
|
||||||
cp -vr ../po/locale locale
|
cp -vr ../{papers,demos,instruments} ../${binPath}/furnace.exe ./
|
||||||
cp -vr ../papers ../${binPath}/furnace.exe ./
|
|
||||||
if [ '${{ matrix.config.compiler }}' == 'msvc' ]; then
|
|
||||||
if [ -e ../${binPath}/furnace.pdb ]; then
|
|
||||||
cp -v ../${binPath}/furnace.pdb ./
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
sha256sum ../${binPath}/furnace.exe > checksum.txt
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -243,47 +282,8 @@ jobs:
|
||||||
if: ${{ runner.os == 'macOS' }}
|
if: ${{ runner.os == 'macOS' }}
|
||||||
run: |
|
run: |
|
||||||
pushd build
|
pushd build
|
||||||
|
cpack
|
||||||
echo "preparing bundle"
|
mv Furnace-*-Darwin.dmg ../${{ steps.package-identify.outputs.filename }}
|
||||||
mkdir -p Furnace.app/Contents/Resources
|
|
||||||
cp -v -r ../po/locale Furnace.app/Contents/Resources/locale
|
|
||||||
cp -v ../res/icon.icns Furnace.app/Contents/Resources/Furnace.icns
|
|
||||||
|
|
||||||
codesign --deep -f -s - Furnace.app
|
|
||||||
|
|
||||||
echo "making dirs"
|
|
||||||
mkdir new
|
|
||||||
|
|
||||||
echo "copying"
|
|
||||||
cp -v -r Furnace.app new/Furnace.app
|
|
||||||
ln -s /Applications new/Applications
|
|
||||||
echo "synchronizing"
|
|
||||||
sync
|
|
||||||
|
|
||||||
echo "copying extra stuff"
|
|
||||||
cp -v ../LICENSE new/LICENSE.txt
|
|
||||||
cp -v ../res/releaseReadme/stable-mac.txt new/README
|
|
||||||
cp -v -r ../demos new/demos
|
|
||||||
cp -v -r ../instruments new/instruments
|
|
||||||
cp -v -r ../wavetables new/wavetables
|
|
||||||
cd new
|
|
||||||
wget https://tildearrow.org/furnace/doc/latest/manual.pdf
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
echo "creating new image"
|
|
||||||
retries=0
|
|
||||||
while ! hdiutil create -srcfolder new -volname Furnace -format UDZO -fs HFS+ furnace.dmg; do
|
|
||||||
echo "TRYING AGAIN..."
|
|
||||||
retries=$((retries+1))
|
|
||||||
if [ $retries -gt 5 ]; then
|
|
||||||
echo "OH NO, WE'VE FAILED..."
|
|
||||||
exit 1
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
mv furnace.dmg ../${{ steps.package-identify.outputs.filename }}
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
- name: Package [Linux]
|
- name: Package [Linux]
|
||||||
|
@ -293,50 +293,28 @@ jobs:
|
||||||
# strip -s build/furnace
|
# strip -s build/furnace
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
mkdir -p target/furnace
|
mkdir -p target/furnace.AppDir
|
||||||
make -C ${PWD}/build DESTDIR=${PWD}/target/furnace install
|
make -C ${PWD}/build DESTDIR=${PWD}/target/furnace.AppDir install
|
||||||
pushd target/furnace
|
pushd target
|
||||||
|
|
||||||
cp -v ../../res/logo.png .DirIcon
|
|
||||||
|
|
||||||
cd usr
|
|
||||||
|
|
||||||
mv bin/furnace ..
|
|
||||||
rmdir bin
|
|
||||||
|
|
||||||
rm -r share/applications
|
|
||||||
rm -r share/doc
|
|
||||||
rm -r share/icons
|
|
||||||
rm -r share/licenses
|
|
||||||
rm -r share/metainfo
|
|
||||||
rm -r share/mime
|
|
||||||
mv share/locale ..
|
|
||||||
|
|
||||||
rmdir share
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
cp ../../LICENSE .
|
|
||||||
cp ../../res/releaseReadme/unstable-other.txt .
|
|
||||||
cp -r ../../papers papers
|
|
||||||
rmdir usr
|
|
||||||
|
|
||||||
|
pushd furnace.AppDir
|
||||||
|
cp -v usr/share/{icons/hicolor/1024x1024/apps/furnace.png,applications/furnace.desktop} ./
|
||||||
|
ln -s furnace.png .DirIcon
|
||||||
|
mv -v usr/share/metainfo/{furnace.appdata,org.tildearrow.furnace.metainfo}.xml
|
||||||
|
cp -v ../../res/AppRun ./
|
||||||
popd
|
popd
|
||||||
|
|
||||||
cd target
|
if [ '${{ matrix.config.arch }}' == 'armhf' ]; then
|
||||||
|
../appimagetool-x86_64.AppImage --runtime-file=../runtime-armhf furnace.AppDir
|
||||||
tar -zcv -f ../${{ steps.package-identify.outputs.filename }} furnace
|
else
|
||||||
|
../appimagetool-x86_64.AppImage furnace.AppDir
|
||||||
|
fi
|
||||||
|
mv Furnace-*.AppImage ../${{ steps.package-identify.outputs.filename }}
|
||||||
|
popd
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: ${{ github.repository == 'tildearrow/furnace' && github.ref_name == 'master' }}
|
if: ${{ github.repository == 'tildearrow/furnace' && github.ref_name == 'master' }}
|
||||||
uses: actions/upload-artifact@v4.3.0
|
uses: actions/upload-artifact@v3.1.1
|
||||||
with:
|
|
||||||
name: ${{ steps.package-identify.outputs.id }}
|
|
||||||
path: ${{ steps.package-identify.outputs.filename }}
|
|
||||||
|
|
||||||
- name: Upload 30xx artifact
|
|
||||||
if: ${{ github.repository == 'tildearrow/furnace' && github.ref_name == 'theUltimateFix' }}
|
|
||||||
uses: actions/upload-artifact@v4.3.0
|
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package-identify.outputs.id }}
|
name: ${{ steps.package-identify.outputs.id }}
|
||||||
path: ${{ steps.package-identify.outputs.filename }}
|
path: ${{ steps.package-identify.outputs.filename }}
|
||||||
|
|
15
.gitignore
vendored
15
.gitignore
vendored
|
@ -5,9 +5,7 @@ nosdl/
|
||||||
release/
|
release/
|
||||||
t/
|
t/
|
||||||
winbuild/
|
winbuild/
|
||||||
winCbuild/
|
|
||||||
win32build/
|
win32build/
|
||||||
xpbuild/
|
|
||||||
macbuild/
|
macbuild/
|
||||||
linuxbuild/
|
linuxbuild/
|
||||||
*.swp
|
*.swp
|
||||||
|
@ -17,8 +15,6 @@ test/songs/
|
||||||
test/delta/
|
test/delta/
|
||||||
test/result/
|
test/result/
|
||||||
test/assert_delta
|
test/assert_delta
|
||||||
android/local.properties
|
|
||||||
android/.idea/
|
|
||||||
android/.gradle/
|
android/.gradle/
|
||||||
android/app/build/
|
android/app/build/
|
||||||
android/app/.cxx/
|
android/app/.cxx/
|
||||||
|
@ -26,14 +22,3 @@ android/app/.cxx/
|
||||||
CMakeSettings.json
|
CMakeSettings.json
|
||||||
CMakePresets.json
|
CMakePresets.json
|
||||||
extern/imgui_patched/examples/
|
extern/imgui_patched/examples/
|
||||||
src/asm/68k/amigatest/*.bin
|
|
||||||
src/asm/68k/amigatest/player
|
|
||||||
src/check/calc_checksum
|
|
||||||
res/binary_to_compressed_c
|
|
||||||
res/binary_to_compressed_c.exe
|
|
||||||
res/docpdf/manual.html
|
|
||||||
res/docpdf/manual.pdf
|
|
||||||
res/docpdf/.venv
|
|
||||||
res/docpdf/htmldoc/
|
|
||||||
res/fonts/compressed/
|
|
||||||
res/furnace.appdata.xml
|
|
||||||
|
|
8
.gitmodules
vendored
8
.gitmodules
vendored
|
@ -1,7 +1,10 @@
|
||||||
|
[submodule "extern/Nuked-OPN2"]
|
||||||
|
path = extern/Nuked-OPN2
|
||||||
|
url = https://github.com/nukeykt/Nuked-OPN2
|
||||||
[submodule "extern/SDL"]
|
[submodule "extern/SDL"]
|
||||||
path = extern/SDL
|
path = extern/SDL
|
||||||
url = https://github.com/libsdl-org/SDL.git
|
url = https://github.com/libsdl-org/SDL.git
|
||||||
branch = release-2.28.x
|
branch = 2.0.22
|
||||||
[submodule "extern/libsndfile"]
|
[submodule "extern/libsndfile"]
|
||||||
path = extern/libsndfile
|
path = extern/libsndfile
|
||||||
url = https://github.com/libsndfile/libsndfile.git
|
url = https://github.com/libsndfile/libsndfile.git
|
||||||
|
@ -12,6 +15,3 @@
|
||||||
[submodule "extern/adpcm"]
|
[submodule "extern/adpcm"]
|
||||||
path = extern/adpcm
|
path = extern/adpcm
|
||||||
url = https://github.com/superctr/adpcm
|
url = https://github.com/superctr/adpcm
|
||||||
[submodule "extern/portaudio"]
|
|
||||||
path = extern/portaudio
|
|
||||||
url = https://github.com/PortAudio/portaudio.git
|
|
||||||
|
|
638
CMakeLists.txt
638
CMakeLists.txt
|
@ -8,7 +8,6 @@ project(furnace)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
enable_language(OBJC)
|
enable_language(OBJC)
|
||||||
enable_language(OBJCXX)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
@ -16,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
set(CMAKE_PROJECT_VERSION_MAJOR 0)
|
set(CMAKE_PROJECT_VERSION_MAJOR 0)
|
||||||
set(CMAKE_PROJECT_VERSION_MINOR 6)
|
set(CMAKE_PROJECT_VERSION_MINOR 6)
|
||||||
set(CMAKE_PROJECT_VERSION_PATCH 6)
|
set(CMAKE_PROJECT_VERSION_PATCH 0)
|
||||||
|
|
||||||
set(BUILD_GUI_DEFAULT ON)
|
set(BUILD_GUI_DEFAULT ON)
|
||||||
set(USE_SDL2_DEFAULT ON)
|
set(USE_SDL2_DEFAULT ON)
|
||||||
|
@ -26,18 +25,8 @@ set(SYSTEM_SDL2_DEFAULT OFF)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
include(TestBigEndian)
|
include(TestBigEndian)
|
||||||
|
|
||||||
execute_process(COMMAND git status RESULT_VARIABLE DONT_HAVE_GIT WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
|
||||||
if (NOT DONT_HAVE_GIT)
|
|
||||||
message(STATUS "Git is available")
|
|
||||||
else()
|
|
||||||
message(WARNING "either Git is not available, or this Git repository has not been initialized.
|
|
||||||
if you have used the \"Source code\" option in the GitHub release page, you are doing it wrong! unless you manually initialize submodules, the build is guaranteed to FAIL spectacularly!
|
|
||||||
read the \"developer info\" section of README.md for more information.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(USE_RTMIDI_DEFAULT OFF)
|
set(USE_RTMIDI_DEFAULT OFF)
|
||||||
set(WITH_PORTAUDIO_DEFAULT OFF)
|
|
||||||
set(USE_BACKWARD_DEFAULT OFF)
|
set(USE_BACKWARD_DEFAULT OFF)
|
||||||
find_library(TERMUX rt)
|
find_library(TERMUX rt)
|
||||||
if (TERMUX)
|
if (TERMUX)
|
||||||
|
@ -45,7 +34,6 @@ if (ANDROID)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(USE_RTMIDI_DEFAULT ON)
|
set(USE_RTMIDI_DEFAULT ON)
|
||||||
set(WITH_PORTAUDIO_DEFAULT ON)
|
|
||||||
if (WIN32 OR APPLE)
|
if (WIN32 OR APPLE)
|
||||||
set(USE_BACKWARD_DEFAULT ON)
|
set(USE_BACKWARD_DEFAULT ON)
|
||||||
else()
|
else()
|
||||||
|
@ -66,87 +54,23 @@ else()
|
||||||
set(WITH_JACK_DEFAULT OFF)
|
set(WITH_JACK_DEFAULT OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(WITH_RENDER_SDL_DEFAULT ON)
|
|
||||||
set(WITH_RENDER_OPENGL_DEFAULT ON)
|
|
||||||
if (WIN32)
|
|
||||||
set(WITH_RENDER_DX11_DEFAULT ON)
|
|
||||||
set(WITH_RENDER_DX9_DEFAULT ON)
|
|
||||||
else()
|
|
||||||
set(WITH_RENDER_DX11_DEFAULT OFF)
|
|
||||||
set(WITH_RENDER_DX9_DEFAULT OFF)
|
|
||||||
endif()
|
|
||||||
if (APPLE)
|
|
||||||
set(WITH_RENDER_METAL_DEFAULT ON)
|
|
||||||
else()
|
|
||||||
set(WITH_RENDER_METAL_DEFAULT OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ANDROID)
|
|
||||||
set(USE_GLES_DEFAULT ON)
|
|
||||||
set(WITH_RENDER_OPENGL1_DEFAULT OFF)
|
|
||||||
else()
|
|
||||||
set(USE_GLES_DEFAULT OFF)
|
|
||||||
if (APPLE)
|
|
||||||
set(WITH_RENDER_OPENGL1_DEFAULT OFF)
|
|
||||||
else()
|
|
||||||
set(WITH_RENDER_OPENGL1_DEFAULT ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(WITH_LOCALE_DEFAULT ON)
|
|
||||||
|
|
||||||
try_compile(HAVE_SETLOCALE ${CMAKE_BINARY_DIR}/check SOURCES ${CMAKE_SOURCE_DIR}/src/check/check_setlocale.c)
|
|
||||||
include(FindIntl)
|
|
||||||
|
|
||||||
if (HAVE_SETLOCALE AND Intl_FOUND AND NOT APPLE)
|
|
||||||
set(USE_MOMO_DEFAULT OFF)
|
|
||||||
else()
|
|
||||||
set(USE_MOMO_DEFAULT ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(BUILD_GUI "Build the tracker (disable to build only a headless player)" ${BUILD_GUI_DEFAULT})
|
option(BUILD_GUI "Build the tracker (disable to build only a headless player)" ${BUILD_GUI_DEFAULT})
|
||||||
option(WITH_LOCALE "Use libintl for language support" ${WITH_LOCALE_DEFAULT})
|
|
||||||
option(USE_RTMIDI "Build with MIDI support using RtMidi." ${USE_RTMIDI_DEFAULT})
|
option(USE_RTMIDI "Build with MIDI support using RtMidi." ${USE_RTMIDI_DEFAULT})
|
||||||
option(USE_SDL2 "Build with SDL2. Required to build with GUI." ${USE_SDL2_DEFAULT})
|
option(USE_SDL2 "Build with SDL2. Required to build with GUI." ${USE_SDL2_DEFAULT})
|
||||||
option(USE_SNDFILE "Build with libsndfile. Required in order to work with audio files." ${USE_SNDFILE_DEFAULT})
|
option(USE_SNDFILE "Build with libsndfile. Required in order to work with audio files." ${USE_SNDFILE_DEFAULT})
|
||||||
option(USE_BACKWARD "Use backward-cpp to print a backtrace on crash/abort." ${USE_BACKWARD_DEFAULT})
|
option(USE_BACKWARD "Use backward-cpp to print a backtrace on crash/abort." ${USE_BACKWARD_DEFAULT})
|
||||||
option(USE_MOMO "Build a libintl implementation instead of using the system one." ${USE_MOMO_DEFAULT})
|
|
||||||
option(WITH_JACK "Whether to build with JACK support. Auto-detects if JACK is available" ${WITH_JACK_DEFAULT})
|
option(WITH_JACK "Whether to build with JACK support. Auto-detects if JACK is available" ${WITH_JACK_DEFAULT})
|
||||||
option(WITH_PORTAUDIO "Whether to build with PortAudio for audio output." ${WITH_PORTAUDIO_DEFAULT})
|
|
||||||
option(WITH_RENDER_SDL "Whether to build with the SDL_Renderer render backend." ${WITH_RENDER_SDL_DEFAULT})
|
|
||||||
option(WITH_RENDER_OPENGL "Whether to build with the OpenGL render backend." ${WITH_RENDER_OPENGL_DEFAULT})
|
|
||||||
option(WITH_RENDER_OPENGL1 "Whether to build with the OpenGL 1.1 render backend." ${WITH_RENDER_OPENGL1_DEFAULT})
|
|
||||||
option(WITH_RENDER_DX11 "Whether to build with the DirectX 11 render backend." ${WITH_RENDER_DX11_DEFAULT})
|
|
||||||
option(WITH_RENDER_DX9 "Whether to build with the DirectX 9 render backend." ${WITH_RENDER_DX9_DEFAULT})
|
|
||||||
option(WITH_RENDER_METAL "Whether to build with the Metal render backend." ${WITH_RENDER_METAL_DEFAULT})
|
|
||||||
option(USE_GLES "Use OpenGL ES for the OpenGL render backend." ${USE_GLES_DEFAULT})
|
|
||||||
option(USE_FREETYPE "Use FreeType for font rendering." ON)
|
|
||||||
option(SYSTEM_FFTW "Use a system-installed version of FFTW instead of the vendored one" OFF)
|
option(SYSTEM_FFTW "Use a system-installed version of FFTW instead of the vendored one" OFF)
|
||||||
option(SYSTEM_FMT "Use a system-installed version of fmt instead of the vendored one" OFF)
|
option(SYSTEM_FMT "Use a system-installed version of fmt instead of the vendored one" OFF)
|
||||||
option(SYSTEM_FREETYPE "Use a system-installed version of FreeType instead of the vendored one" OFF)
|
|
||||||
option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead of the vendored one" OFF)
|
option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead of the vendored one" OFF)
|
||||||
option(SYSTEM_PORTAUDIO "Use a system-installed version of PortAudio instead of the vendored one" OFF)
|
|
||||||
option(SYSTEM_RTMIDI "Use a system-installed version of RtMidi instead of the vendored one" OFF)
|
option(SYSTEM_RTMIDI "Use a system-installed version of RtMidi instead of the vendored one" OFF)
|
||||||
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
|
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
|
||||||
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
|
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
|
||||||
option(SUPPORT_XP "Build a Windows XP-compatible binary" OFF)
|
|
||||||
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
|
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
|
||||||
option(WITH_DEMOS "Install demo songs" ON)
|
option(WITH_DEMOS "Install demo songs" ON)
|
||||||
option(WITH_INSTRUMENTS "Install instruments" ON)
|
option(WITH_INSTRUMENTS "Install instruments" ON)
|
||||||
option(WITH_WAVETABLES "Install wavetables" ON)
|
|
||||||
option(SHOW_OPEN_ASSETS_MENU_ENTRY "Show option to open built-in assets directory (on supported platforms)" OFF)
|
|
||||||
option(CONSOLE_SUBSYSTEM "Build Furnace with Console subsystem on Windows" OFF)
|
|
||||||
option(FLATPAK_WORKAROUNDS "Enable Flatpak-specific workaround for system file picker" OFF)
|
|
||||||
if (APPLE)
|
|
||||||
option(FORCE_APPLE_BIN "Force enable binary installation to /bin" OFF)
|
|
||||||
option(MAKE_BUNDLE "Make a bundle" OFF)
|
|
||||||
else()
|
|
||||||
# not Apple - not needed
|
|
||||||
set(FORCE_APPLE_BIN OFF)
|
|
||||||
set(MAKE_BUNDLE OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(DEPENDENCIES_INCLUDE_DIRS extern/IconFontCppHeaders src/icon)
|
set(DEPENDENCIES_INCLUDE_DIRS "")
|
||||||
|
|
||||||
if (ANDROID AND NOT TERMUX)
|
if (ANDROID AND NOT TERMUX)
|
||||||
set(DEPENDENCIES_DEFINES "IS_MOBILE")
|
set(DEPENDENCIES_DEFINES "IS_MOBILE")
|
||||||
|
@ -160,37 +84,24 @@ if (IS_BIG_ENDIAN)
|
||||||
list(APPEND DEPENDENCIES_DEFINES "TA_BIG_ENDIAN")
|
list(APPEND DEPENDENCIES_DEFINES "TA_BIG_ENDIAN")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (FLATPAK_WORKAROUNDS)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES "FLATPAK_WORKAROUNDS")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(DEPENDENCIES_COMPILE_OPTIONS "")
|
set(DEPENDENCIES_COMPILE_OPTIONS "")
|
||||||
set(DEPENDENCIES_LIBRARIES "")
|
set(DEPENDENCIES_LIBRARIES "")
|
||||||
set(DEPENDENCIES_LIBRARY_DIRS "")
|
set(DEPENDENCIES_LIBRARY_DIRS "")
|
||||||
set(DEPENDENCIES_LINK_OPTIONS "")
|
set(DEPENDENCIES_LINK_OPTIONS "")
|
||||||
set(DEPENDENCIES_LEGACY_LDFLAGS "")
|
set(DEPENDENCIES_LEGACY_LDFLAGS "")
|
||||||
|
|
||||||
if (BUILD_GUI AND WITH_RENDER_SDL)
|
if (BUILD_GUI)
|
||||||
set(SYSTEM_SDL_MIN_VER 2.0.18)
|
set(SYSTEM_SDL_MIN_VER 2.0.18)
|
||||||
else()
|
else()
|
||||||
set(SYSTEM_SDL_MIN_VER 2.0.0)
|
set(SYSTEM_SDL_MIN_VER 2.0.0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#list(APPEND DEPENDENCIES_INCLUDE_DIRS "extern/SAASound/include")
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS "extern/SAASound/include")
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS "extern/vgsound_emu-modified")
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS "extern/vgsound_emu-modified")
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
list(APPEND DEPENDENCIES_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
# support Windows XP
|
|
||||||
if (SUPPORT_XP)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES "_WIN32_WINNT=0x0501")
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES "SUPPORT_XP")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (SYSTEM_FFTW)
|
if (SYSTEM_FFTW)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(FFTW REQUIRED fftw3>=3.3)
|
pkg_check_modules(FFTW REQUIRED fftw3>=3.3)
|
||||||
|
@ -236,39 +147,6 @@ else()
|
||||||
message(STATUS "Using vendored fmt")
|
message(STATUS "Using vendored fmt")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BUILD_GUI AND USE_FREETYPE)
|
|
||||||
# TODO: FIX FIX FIX FIX FIX
|
|
||||||
if (SYSTEM_FREETYPE)
|
|
||||||
if (PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(FREETYPE freetype2>=2.0.0)
|
|
||||||
if (FREETYPE_FOUND)
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
|
|
||||||
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${FREETYPE_CFLAGS_OTHER})
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES ${FREETYPE_LIBRARIES})
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${FREETYPE_LIBRARY_DIRS})
|
|
||||||
list(APPEND DEPENDENCIES_LINK_OPTIONS ${FREETYPE_LDFLAGS_OTHER})
|
|
||||||
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${FREETYPE_LDFLAGS})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (NOT FREETYPE_FOUND)
|
|
||||||
find_package(freetype REQUIRED)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES freetype::freetype)
|
|
||||||
endif()
|
|
||||||
message(STATUS "Using system-installed FreeType")
|
|
||||||
else()
|
|
||||||
set(FT_DISABLE_BROTLI ON CACHE BOOL "one" FORCE)
|
|
||||||
set(FT_DISABLE_BZIP2 ON CACHE BOOL "two" FORCE)
|
|
||||||
set(FT_DISABLE_HARFBUZZ ON CACHE BOOL "three" FORCE)
|
|
||||||
set(FT_DISABLE_PNG ON CACHE BOOL "four" FORCE)
|
|
||||||
set(FT_DISABLE_ZLIB ON CACHE BOOL "five" FORCE)
|
|
||||||
add_subdirectory(extern/freetype EXCLUDE_FROM_ALL)
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/freetype/include)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES freetype)
|
|
||||||
message(STATUS "Using vendored FreeType")
|
|
||||||
endif()
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_FREETYPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_SNDFILE)
|
if (USE_SNDFILE)
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_SNDFILE)
|
list(APPEND DEPENDENCIES_DEFINES HAVE_SNDFILE)
|
||||||
if (SYSTEM_LIBSNDFILE)
|
if (SYSTEM_LIBSNDFILE)
|
||||||
|
@ -295,27 +173,6 @@ else()
|
||||||
message(STATUS "Not using libsndfile")
|
message(STATUS "Not using libsndfile")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_PORTAUDIO)
|
|
||||||
if (SYSTEM_PORTAUDIO)
|
|
||||||
find_package(PkgConfig REQUIRED)
|
|
||||||
pkg_check_modules(PORTAUDIO REQUIRED portaudio-2.0)
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${PORTAUDIO_INCLUDE_DIRS})
|
|
||||||
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${PORTAUDIO_CFLAGS_OTHER})
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES ${PORTAUDIO_LIBRARIES})
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${PORTAUDIO_LIBRARY_DIRS})
|
|
||||||
list(APPEND DEPENDENCIES_LINK_OPTIONS ${PORTAUDIO_LDFLAGS_OTHER})
|
|
||||||
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${PORTAUDIO_LDFLAGS})
|
|
||||||
message(STATUS "Using system-installed PortAudio")
|
|
||||||
else()
|
|
||||||
set(PA_BUILD_SHARED_LIBS OFF CACHE BOOL "Build dynamic library" FORCE)
|
|
||||||
# don't - Furnace has its own implementation
|
|
||||||
set(PA_USE_JACK OFF CACHE BOOL "Enable support for JACK Audio Connection Kit" FORCE)
|
|
||||||
add_subdirectory(extern/portaudio EXCLUDE_FROM_ALL)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES PortAudio)
|
|
||||||
message(STATUS "Using vendored PortAudio")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_RTMIDI)
|
if (USE_RTMIDI)
|
||||||
if (SYSTEM_RTMIDI)
|
if (SYSTEM_RTMIDI)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
|
@ -395,18 +252,6 @@ if (USE_SDL2)
|
||||||
# If you link SDL statically, you also need to define HAVE_LIBC so it builds with the C runtime that your application uses.
|
# If you link SDL statically, you also need to define HAVE_LIBC so it builds with the C runtime that your application uses.
|
||||||
# This should probably go in a FAQ.
|
# This should probably go in a FAQ.
|
||||||
set(SDL_LIBC ON CACHE BOOL "Tell SDL that we want it to use our C runtime (required for proper static linking)" FORCE)
|
set(SDL_LIBC ON CACHE BOOL "Tell SDL that we want it to use our C runtime (required for proper static linking)" FORCE)
|
||||||
|
|
||||||
# https://github.com/tildearrow/furnace/issues/1237
|
|
||||||
# enabling this will result in SDL finding the Direct3D headers, forcing _WIN32_WINNT to an undesirable value (which makes the Wine headers define GetTickCount64)
|
|
||||||
if (SUPPORT_XP)
|
|
||||||
set(SDL_RENDER_D3D OFF CACHE BOOL "Enable the Direct3D render driver" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
CHECK_INCLUDE_FILE(GLES/gl.h GLES_GL_FOUND)
|
|
||||||
if (NOT GLES_GL_FOUND AND NOT USE_GLES)
|
|
||||||
set(SDL_OPENGLES OFF CACHE BOOL "Enable OpenGL ES" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(extern/SDL EXCLUDE_FROM_ALL)
|
add_subdirectory(extern/SDL EXCLUDE_FROM_ALL)
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_SDL2)
|
list(APPEND DEPENDENCIES_DEFINES HAVE_SDL2)
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/SDL/include)
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/SDL/include)
|
||||||
|
@ -419,9 +264,6 @@ if (USE_SDL2)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
list(APPEND DEPENDENCIES_COMPILE_OPTIONS "/DHAVE_LIBC")
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS "/DHAVE_LIBC")
|
||||||
endif()
|
endif()
|
||||||
if (WIN32)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES SDL2main)
|
|
||||||
endif()
|
|
||||||
message(STATUS "Using vendored SDL2")
|
message(STATUS "Using vendored SDL2")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
@ -434,7 +276,6 @@ endif()
|
||||||
set(AUDIO_SOURCES
|
set(AUDIO_SOURCES
|
||||||
src/audio/abstract.cpp
|
src/audio/abstract.cpp
|
||||||
src/audio/midi.cpp
|
src/audio/midi.cpp
|
||||||
src/audio/pipe.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (USE_SDL2)
|
if (USE_SDL2)
|
||||||
|
@ -444,29 +285,19 @@ endif()
|
||||||
if (WITH_JACK)
|
if (WITH_JACK)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(JACK REQUIRED jack)
|
pkg_check_modules(JACK REQUIRED jack)
|
||||||
list(APPEND AUDIO_SOURCES extern/weakjack/weak_libjack.c)
|
|
||||||
list(APPEND AUDIO_SOURCES src/audio/jack.cpp)
|
list(APPEND AUDIO_SOURCES src/audio/jack.cpp)
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${JACK_INCLUDE_DIRS})
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${JACK_INCLUDE_DIRS})
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_JACK)
|
list(APPEND DEPENDENCIES_DEFINES HAVE_JACK)
|
||||||
list(APPEND DEPENDENCIES_DEFINES USE_WEAK_JACK)
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${JACK_CFLAGS_OTHER})
|
||||||
#list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${JACK_CFLAGS_OTHER})
|
list(APPEND DEPENDENCIES_LIBRARIES ${JACK_LIBRARIES})
|
||||||
#list(APPEND DEPENDENCIES_LIBRARIES ${JACK_LIBRARIES})
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${JACK_LIBRARY_DIRS})
|
||||||
#list(APPEND DEPENDENCIES_LIBRARY_DIRS ${JACK_LIBRARY_DIRS})
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${JACK_LDFLAGS_OTHER})
|
||||||
#list(APPEND DEPENDENCIES_LINK_OPTIONS ${JACK_LDFLAGS_OTHER})
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${JACK_LDFLAGS})
|
||||||
#list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${JACK_LDFLAGS})
|
|
||||||
message(STATUS "Building with JACK support")
|
message(STATUS "Building with JACK support")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Building without JACK support")
|
message(STATUS "Building without JACK support")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_PORTAUDIO)
|
|
||||||
list(APPEND AUDIO_SOURCES src/audio/pa.cpp)
|
|
||||||
message(STATUS "Building with PortAudio")
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_PA)
|
|
||||||
else()
|
|
||||||
message(STATUS "Building without PortAudio")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_RTMIDI)
|
if (USE_RTMIDI)
|
||||||
list(APPEND AUDIO_SOURCES src/audio/rtmidi.cpp)
|
list(APPEND AUDIO_SOURCES src/audio/rtmidi.cpp)
|
||||||
message(STATUS "Building with RtMidi")
|
message(STATUS "Building with RtMidi")
|
||||||
|
@ -477,12 +308,9 @@ endif()
|
||||||
|
|
||||||
set(ENGINE_SOURCES
|
set(ENGINE_SOURCES
|
||||||
src/log.cpp
|
src/log.cpp
|
||||||
src/baseutils.cpp
|
|
||||||
src/fileutils.cpp
|
src/fileutils.cpp
|
||||||
src/utfutils.cpp
|
src/utfutils.cpp
|
||||||
|
|
||||||
extern/itcompress/compression.c
|
|
||||||
|
|
||||||
extern/SAASound/src/SAAAmp.cpp
|
extern/SAASound/src/SAAAmp.cpp
|
||||||
extern/SAASound/src/SAADevice.cpp
|
extern/SAASound/src/SAADevice.cpp
|
||||||
extern/SAASound/src/SAAEnv.cpp
|
extern/SAASound/src/SAAEnv.cpp
|
||||||
|
@ -523,32 +351,15 @@ extern/adpcm/yma_codec.c
|
||||||
extern/adpcm/ymb_codec.c
|
extern/adpcm/ymb_codec.c
|
||||||
extern/adpcm/ymz_codec.c
|
extern/adpcm/ymz_codec.c
|
||||||
|
|
||||||
extern/adpcm-xq-s/adpcm-lib.c
|
extern/Nuked-OPN2/ym3438.c
|
||||||
|
|
||||||
extern/opn/ym3438.c
|
|
||||||
extern/Nuked-PSG/ympsg.c
|
extern/Nuked-PSG/ympsg.c
|
||||||
extern/opm/opm.c
|
extern/opm/opm.c
|
||||||
extern/Nuked-OPLL/opll.c
|
extern/Nuked-OPLL/opll.c
|
||||||
extern/opl/opl3.c
|
extern/opl/opl3.c
|
||||||
extern/YM3812-LLE/fmopl2.c
|
|
||||||
extern/YMF262-LLE/fmopl3.c
|
|
||||||
extern/YMF276-LLE/fmopn2.c
|
|
||||||
extern/ESFMu/esfm.c
|
|
||||||
extern/ESFMu/esfm_registers.c
|
|
||||||
extern/emu2413/emu2413.c
|
|
||||||
extern/YM2608-LLE/fmopna_2608.c
|
|
||||||
extern/YM2608-LLE/fmopna_2610.c
|
|
||||||
extern/YM2608-LLE/fmopna_2612.c
|
|
||||||
|
|
||||||
extern/pwrnoise/pwrnoise.c
|
|
||||||
|
|
||||||
src/pch.cpp
|
|
||||||
|
|
||||||
src/engine/platform/sound/sn76496.cpp
|
src/engine/platform/sound/sn76496.cpp
|
||||||
src/engine/platform/sound/ay8910.cpp
|
src/engine/platform/sound/ay8910.cpp
|
||||||
src/engine/platform/sound/saa1099.cpp
|
src/engine/platform/sound/saa1099.cpp
|
||||||
src/engine/platform/sound/namco.cpp
|
src/engine/platform/sound/namco.cpp
|
||||||
src/engine/platform/sound/segapcm.cpp
|
|
||||||
src/engine/platform/sound/gb/apu.c
|
src/engine/platform/sound/gb/apu.c
|
||||||
src/engine/platform/sound/gb/timing.c
|
src/engine/platform/sound/gb/timing.c
|
||||||
src/engine/platform/sound/pce_psg.cpp
|
src/engine/platform/sound/pce_psg.cpp
|
||||||
|
@ -557,12 +368,7 @@ src/engine/platform/sound/nes/fds.c
|
||||||
src/engine/platform/sound/nes/mmc5.c
|
src/engine/platform/sound/nes/mmc5.c
|
||||||
src/engine/platform/sound/vera_psg.c
|
src/engine/platform/sound/vera_psg.c
|
||||||
src/engine/platform/sound/vera_pcm.c
|
src/engine/platform/sound/vera_pcm.c
|
||||||
src/engine/platform/sound/ymf278b/ymf278.cpp
|
|
||||||
|
|
||||||
src/engine/platform/sound/atomicssg/ssg.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/nes_nsfplay/5e01_apu.cpp
|
|
||||||
src/engine/platform/sound/nes_nsfplay/5e01_dmc.cpp
|
|
||||||
src/engine/platform/sound/nes_nsfplay/nes_apu.cpp
|
src/engine/platform/sound/nes_nsfplay/nes_apu.cpp
|
||||||
src/engine/platform/sound/nes_nsfplay/nes_dmc.cpp
|
src/engine/platform/sound/nes_nsfplay/nes_dmc.cpp
|
||||||
src/engine/platform/sound/nes_nsfplay/nes_fds.cpp
|
src/engine/platform/sound/nes_nsfplay/nes_fds.cpp
|
||||||
|
@ -588,7 +394,6 @@ src/engine/platform/sound/c64/wave8580_PST.cc
|
||||||
src/engine/platform/sound/c64/wave8580_P_T.cc
|
src/engine/platform/sound/c64/wave8580_P_T.cc
|
||||||
src/engine/platform/sound/c64/wave8580__ST.cc
|
src/engine/platform/sound/c64/wave8580__ST.cc
|
||||||
|
|
||||||
src/engine/platform/sound/c64_fp/array.cpp
|
|
||||||
src/engine/platform/sound/c64_fp/Dac.cpp
|
src/engine/platform/sound/c64_fp/Dac.cpp
|
||||||
src/engine/platform/sound/c64_fp/EnvelopeGenerator.cpp
|
src/engine/platform/sound/c64_fp/EnvelopeGenerator.cpp
|
||||||
src/engine/platform/sound/c64_fp/ExternalFilter.cpp
|
src/engine/platform/sound/c64_fp/ExternalFilter.cpp
|
||||||
|
@ -607,24 +412,17 @@ src/engine/platform/sound/c64_fp/WaveformCalculator.cpp
|
||||||
src/engine/platform/sound/c64_fp/WaveformGenerator.cpp
|
src/engine/platform/sound/c64_fp/WaveformGenerator.cpp
|
||||||
src/engine/platform/sound/c64_fp/resample/SincResampler.cpp
|
src/engine/platform/sound/c64_fp/resample/SincResampler.cpp
|
||||||
|
|
||||||
src/engine/platform/sound/c64_d/dsid.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/tia/AudioChannel.cpp
|
src/engine/platform/sound/tia/AudioChannel.cpp
|
||||||
src/engine/platform/sound/tia/Audio.cpp
|
src/engine/platform/sound/tia/Audio.cpp
|
||||||
|
|
||||||
src/engine/platform/sound/ymfm/ymfm_adpcm.cpp
|
src/engine/platform/sound/ymfm/ymfm_adpcm.cpp
|
||||||
src/engine/platform/sound/ymfm/ymfm_opl.cpp
|
|
||||||
src/engine/platform/sound/ymfm/ymfm_opm.cpp
|
src/engine/platform/sound/ymfm/ymfm_opm.cpp
|
||||||
src/engine/platform/sound/ymfm/ymfm_opn.cpp
|
src/engine/platform/sound/ymfm/ymfm_opn.cpp
|
||||||
src/engine/platform/sound/ymfm/ymfm_opz.cpp
|
src/engine/platform/sound/ymfm/ymfm_opz.cpp
|
||||||
src/engine/platform/sound/ymfm/ymfm_pcm.cpp
|
|
||||||
src/engine/platform/sound/ymfm/ymfm_ssg.cpp
|
src/engine/platform/sound/ymfm/ymfm_ssg.cpp
|
||||||
|
|
||||||
src/engine/platform/sound/lynx/Mikey.cpp
|
src/engine/platform/sound/lynx/Mikey.cpp
|
||||||
|
|
||||||
src/engine/platform/sound/pokey/mzpokeysnd.c
|
|
||||||
src/engine/platform/sound/pokey/AltASAP.cpp
|
|
||||||
|
|
||||||
src/engine/platform/sound/qsound.c
|
src/engine/platform/sound/qsound.c
|
||||||
|
|
||||||
src/engine/platform/sound/swan.cpp
|
src/engine/platform/sound/swan.cpp
|
||||||
|
@ -646,90 +444,33 @@ src/engine/platform/sound/oki/okim6258.cpp
|
||||||
|
|
||||||
src/engine/platform/sound/snes/SPC_DSP.cpp
|
src/engine/platform/sound/snes/SPC_DSP.cpp
|
||||||
|
|
||||||
src/engine/platform/sound/ga20/iremga20.cpp
|
|
||||||
|
|
||||||
src/engine/platform/sound/sm8521.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/supervision.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/upd1771c.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/d65modified.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/ted-sound.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/c140_c219.c
|
|
||||||
|
|
||||||
src/engine/platform/sound/dave/dave.cpp
|
|
||||||
|
|
||||||
src/engine/platform/sound/nds.cpp
|
|
||||||
|
|
||||||
src/engine/platform/sound/sid2/envelope.cc
|
|
||||||
src/engine/platform/sound/sid2/filter.cc
|
|
||||||
src/engine/platform/sound/sid2/sid.cc
|
|
||||||
src/engine/platform/sound/sid2/version.cc
|
|
||||||
src/engine/platform/sound/sid2/voice.cc
|
|
||||||
src/engine/platform/sound/sid2/wave8580_PS_.cc
|
|
||||||
src/engine/platform/sound/sid2/wave8580_PST.cc
|
|
||||||
src/engine/platform/sound/sid2/wave8580_P_T.cc
|
|
||||||
src/engine/platform/sound/sid2/wave8580__ST.cc
|
|
||||||
src/engine/platform/sound/sid2/wave.cc
|
|
||||||
|
|
||||||
src/engine/platform/sound/sid3.c
|
|
||||||
|
|
||||||
src/engine/platform/oplAInterface.cpp
|
src/engine/platform/oplAInterface.cpp
|
||||||
src/engine/platform/ym2608Interface.cpp
|
src/engine/platform/ym2608Interface.cpp
|
||||||
src/engine/platform/ym2610Interface.cpp
|
src/engine/platform/ym2610Interface.cpp
|
||||||
|
|
||||||
src/engine/fileOps/fileOpsCommon.cpp
|
|
||||||
src/engine/fileOps/dmf.cpp
|
|
||||||
src/engine/fileOps/fc.cpp
|
|
||||||
src/engine/fileOps/ftm.cpp
|
|
||||||
src/engine/fileOps/fur.cpp
|
|
||||||
src/engine/fileOps/it.cpp
|
|
||||||
src/engine/fileOps/mod.cpp
|
|
||||||
src/engine/fileOps/s3m.cpp
|
|
||||||
src/engine/fileOps/text.cpp
|
|
||||||
src/engine/fileOps/tfm.cpp
|
|
||||||
src/engine/fileOps/xm.cpp
|
|
||||||
|
|
||||||
src/engine/fileOps/p.cpp
|
|
||||||
src/engine/fileOps/p86.cpp
|
|
||||||
src/engine/fileOps/pdx.cpp
|
|
||||||
src/engine/fileOps/ppc.cpp
|
|
||||||
src/engine/fileOps/pps.cpp
|
|
||||||
src/engine/fileOps/pvi.cpp
|
|
||||||
src/engine/fileOps/pzi.cpp
|
|
||||||
|
|
||||||
src/engine/blip_buf.c
|
src/engine/blip_buf.c
|
||||||
src/engine/brrUtils.c
|
src/engine/brrUtils.c
|
||||||
src/engine/safeReader.cpp
|
src/engine/safeReader.cpp
|
||||||
src/engine/safeWriter.cpp
|
src/engine/safeWriter.cpp
|
||||||
src/engine/workPool.cpp
|
|
||||||
src/engine/cmdStream.cpp
|
|
||||||
src/engine/cmdStreamOps.cpp
|
|
||||||
src/engine/config.cpp
|
src/engine/config.cpp
|
||||||
src/engine/configEngine.cpp
|
src/engine/configEngine.cpp
|
||||||
src/engine/dispatchContainer.cpp
|
src/engine/dispatchContainer.cpp
|
||||||
src/engine/engine.cpp
|
src/engine/engine.cpp
|
||||||
src/engine/export.cpp
|
src/engine/fileOps.cpp
|
||||||
src/engine/exportDef.cpp
|
|
||||||
src/engine/fileOpsIns.cpp
|
src/engine/fileOpsIns.cpp
|
||||||
src/engine/fileOpsSample.cpp
|
|
||||||
src/engine/filter.cpp
|
src/engine/filter.cpp
|
||||||
src/engine/instrument.cpp
|
src/engine/instrument.cpp
|
||||||
src/engine/macroInt.cpp
|
src/engine/macroInt.cpp
|
||||||
src/engine/pattern.cpp
|
src/engine/pattern.cpp
|
||||||
src/engine/pitchTable.cpp
|
|
||||||
src/engine/playback.cpp
|
src/engine/playback.cpp
|
||||||
src/engine/sample.cpp
|
src/engine/sample.cpp
|
||||||
src/engine/song.cpp
|
src/engine/song.cpp
|
||||||
src/engine/sysDef.cpp
|
src/engine/sysDef.cpp
|
||||||
src/engine/wavetable.cpp
|
src/engine/wavetable.cpp
|
||||||
src/engine/waveSynth.cpp
|
src/engine/waveSynth.cpp
|
||||||
src/engine/wavOps.cpp
|
|
||||||
src/engine/vgmOps.cpp
|
src/engine/vgmOps.cpp
|
||||||
|
src/engine/zsmOps.cpp
|
||||||
|
src/engine/zsm.cpp
|
||||||
src/engine/platform/abstract.cpp
|
src/engine/platform/abstract.cpp
|
||||||
src/engine/platform/genesis.cpp
|
src/engine/platform/genesis.cpp
|
||||||
src/engine/platform/genesisext.cpp
|
src/engine/platform/genesisext.cpp
|
||||||
|
@ -764,7 +505,6 @@ src/engine/platform/pcspkr.cpp
|
||||||
src/engine/platform/segapcm.cpp
|
src/engine/platform/segapcm.cpp
|
||||||
src/engine/platform/qsound.cpp
|
src/engine/platform/qsound.cpp
|
||||||
src/engine/platform/x1_010.cpp
|
src/engine/platform/x1_010.cpp
|
||||||
src/engine/platform/pokey.cpp
|
|
||||||
src/engine/platform/lynx.cpp
|
src/engine/platform/lynx.cpp
|
||||||
src/engine/platform/su.cpp
|
src/engine/platform/su.cpp
|
||||||
src/engine/platform/swan.cpp
|
src/engine/platform/swan.cpp
|
||||||
|
@ -772,49 +512,19 @@ src/engine/platform/t6w28.cpp
|
||||||
src/engine/platform/vb.cpp
|
src/engine/platform/vb.cpp
|
||||||
src/engine/platform/vera.cpp
|
src/engine/platform/vera.cpp
|
||||||
src/engine/platform/zxbeeper.cpp
|
src/engine/platform/zxbeeper.cpp
|
||||||
src/engine/platform/zxbeeperquadtone.cpp
|
|
||||||
src/engine/platform/bubsyswsg.cpp
|
src/engine/platform/bubsyswsg.cpp
|
||||||
src/engine/platform/n163.cpp
|
src/engine/platform/n163.cpp
|
||||||
src/engine/platform/pet.cpp
|
src/engine/platform/pet.cpp
|
||||||
src/engine/platform/pokemini.cpp
|
|
||||||
src/engine/platform/pong.cpp
|
src/engine/platform/pong.cpp
|
||||||
src/engine/platform/vic20.cpp
|
src/engine/platform/vic20.cpp
|
||||||
src/engine/platform/vrc6.cpp
|
src/engine/platform/vrc6.cpp
|
||||||
src/engine/platform/es5506.cpp
|
|
||||||
src/engine/platform/scc.cpp
|
src/engine/platform/scc.cpp
|
||||||
src/engine/platform/ymz280b.cpp
|
src/engine/platform/ymz280b.cpp
|
||||||
src/engine/platform/namcowsg.cpp
|
src/engine/platform/namcowsg.cpp
|
||||||
src/engine/platform/rf5c68.cpp
|
src/engine/platform/rf5c68.cpp
|
||||||
src/engine/platform/snes.cpp
|
src/engine/platform/snes.cpp
|
||||||
src/engine/platform/k007232.cpp
|
|
||||||
src/engine/platform/ga20.cpp
|
|
||||||
src/engine/platform/sm8521.cpp
|
|
||||||
src/engine/platform/supervision.cpp
|
|
||||||
src/engine/platform/upd1771c.cpp
|
|
||||||
src/engine/platform/pv1000.cpp
|
|
||||||
src/engine/platform/k053260.cpp
|
|
||||||
src/engine/platform/ted.cpp
|
|
||||||
src/engine/platform/c140.cpp
|
|
||||||
src/engine/platform/esfm.cpp
|
|
||||||
src/engine/platform/powernoise.cpp
|
|
||||||
src/engine/platform/dave.cpp
|
|
||||||
src/engine/platform/gbadma.cpp
|
|
||||||
src/engine/platform/gbaminmod.cpp
|
|
||||||
src/engine/platform/nds.cpp
|
|
||||||
src/engine/platform/bifurcator.cpp
|
|
||||||
src/engine/platform/sid2.cpp
|
|
||||||
src/engine/platform/sid3.cpp
|
|
||||||
src/engine/platform/pcmdac.cpp
|
src/engine/platform/pcmdac.cpp
|
||||||
src/engine/platform/dummy.cpp
|
src/engine/platform/dummy.cpp
|
||||||
|
|
||||||
src/engine/export/abstract.cpp
|
|
||||||
src/engine/export/amigaValidation.cpp
|
|
||||||
src/engine/export/sapr.cpp
|
|
||||||
src/engine/export/tiuna.cpp
|
|
||||||
src/engine/export/zsm.cpp
|
|
||||||
|
|
||||||
src/engine/effect/abstract.cpp
|
|
||||||
src/engine/effect/dummy.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (USE_SNDFILE)
|
if (USE_SNDFILE)
|
||||||
|
@ -827,13 +537,6 @@ if (WIN32)
|
||||||
list(APPEND ENGINE_SOURCES res/furnace.rc)
|
list(APPEND ENGINE_SOURCES res/furnace.rc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.12)
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/macports-legacy-support/include)
|
|
||||||
list(APPEND ENGINE_SOURCES extern/macports-legacy-support/src/time.c)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CLI_SOURCES
|
set(CLI_SOURCES
|
||||||
src/cli/cli.cpp
|
src/cli/cli.cpp
|
||||||
)
|
)
|
||||||
|
@ -843,55 +546,32 @@ extern/imgui_patched/imgui.cpp
|
||||||
extern/imgui_patched/imgui_draw.cpp
|
extern/imgui_patched/imgui_draw.cpp
|
||||||
extern/imgui_patched/imgui_tables.cpp
|
extern/imgui_patched/imgui_tables.cpp
|
||||||
extern/imgui_patched/imgui_widgets.cpp
|
extern/imgui_patched/imgui_widgets.cpp
|
||||||
extern/imgui_patched/backends/imgui_impl_sdl2.cpp
|
extern/imgui_patched/backends/imgui_impl_sdlrenderer.cpp
|
||||||
extern/imgui_software_renderer/imgui_sw.cpp
|
extern/imgui_patched/backends/imgui_impl_sdl.cpp
|
||||||
extern/imgui_patched/misc/cpp/imgui_stdlib.cpp
|
extern/imgui_patched/misc/cpp/imgui_stdlib.cpp
|
||||||
extern/igfd/ImGuiFileDialog.cpp
|
extern/igfd/ImGuiFileDialog.cpp
|
||||||
|
|
||||||
src/gui/plot_nolerp.cpp
|
src/gui/plot_nolerp.cpp
|
||||||
|
|
||||||
src/gui/render.cpp
|
|
||||||
src/gui/render/abstract.cpp
|
|
||||||
src/gui/render/renderSoftware.cpp
|
|
||||||
|
|
||||||
src/gui/font_exo.cpp
|
src/gui/font_exo.cpp
|
||||||
src/gui/font_liberationSans.cpp
|
src/gui/font_liberationSans.cpp
|
||||||
src/gui/font_mononoki.cpp
|
src/gui/font_mononoki.cpp
|
||||||
src/gui/font_plexMono.cpp
|
src/gui/font_plexMono.cpp
|
||||||
src/gui/font_plexSans.cpp
|
src/gui/font_plexSans.cpp
|
||||||
src/gui/font_plexSansJP.cpp
|
|
||||||
src/gui/font_plexSansKR.cpp
|
|
||||||
src/gui/font_proggyClean.cpp
|
src/gui/font_proggyClean.cpp
|
||||||
src/gui/font_ptMono.cpp
|
src/gui/font_ptMono.cpp
|
||||||
src/gui/font_unifont.cpp
|
src/gui/font_unifont.cpp
|
||||||
src/gui/font_icon.cpp
|
src/gui/font_icon.cpp
|
||||||
src/gui/font_furicon.cpp
|
|
||||||
src/gui/fonts.cpp
|
src/gui/fonts.cpp
|
||||||
src/gui/fontzlib.cpp
|
|
||||||
|
|
||||||
src/gui/image_icon.cpp
|
|
||||||
src/gui/image_talogo.cpp
|
|
||||||
src/gui/image_tachip.cpp
|
|
||||||
src/gui/image_logo.cpp
|
|
||||||
src/gui/image_wordmark.cpp
|
|
||||||
src/gui/image_introbg.cpp
|
|
||||||
src/gui/image_pat.cpp
|
|
||||||
src/gui/image.cpp
|
|
||||||
|
|
||||||
src/gui/debug.cpp
|
src/gui/debug.cpp
|
||||||
src/gui/fileDialog.cpp
|
src/gui/fileDialog.cpp
|
||||||
|
|
||||||
src/gui/intConst.cpp
|
src/gui/intConst.cpp
|
||||||
src/gui/guiConst.cpp
|
src/gui/guiConst.cpp
|
||||||
|
|
||||||
src/gui/introTune.cpp
|
|
||||||
|
|
||||||
src/gui/about.cpp
|
src/gui/about.cpp
|
||||||
src/gui/channels.cpp
|
src/gui/channels.cpp
|
||||||
src/gui/chanOsc.cpp
|
src/gui/chanOsc.cpp
|
||||||
src/gui/clock.cpp
|
|
||||||
src/gui/compatFlags.cpp
|
src/gui/compatFlags.cpp
|
||||||
src/gui/csPlayer.cpp
|
|
||||||
src/gui/cursor.cpp
|
src/gui/cursor.cpp
|
||||||
src/gui/dataList.cpp
|
src/gui/dataList.cpp
|
||||||
src/gui/debugWindow.cpp
|
src/gui/debugWindow.cpp
|
||||||
|
@ -899,19 +579,13 @@ src/gui/doAction.cpp
|
||||||
src/gui/editing.cpp
|
src/gui/editing.cpp
|
||||||
src/gui/editControls.cpp
|
src/gui/editControls.cpp
|
||||||
src/gui/effectList.cpp
|
src/gui/effectList.cpp
|
||||||
src/gui/exportOptions.cpp
|
|
||||||
src/gui/findReplace.cpp
|
src/gui/findReplace.cpp
|
||||||
src/gui/fmPreview.cpp
|
|
||||||
src/gui/gradient.cpp
|
src/gui/gradient.cpp
|
||||||
src/gui/grooves.cpp
|
|
||||||
src/gui/insEdit.cpp
|
src/gui/insEdit.cpp
|
||||||
src/gui/intro.cpp
|
|
||||||
src/gui/log.cpp
|
src/gui/log.cpp
|
||||||
src/gui/memory.cpp
|
|
||||||
src/gui/mixer.cpp
|
src/gui/mixer.cpp
|
||||||
src/gui/midiMap.cpp
|
src/gui/midiMap.cpp
|
||||||
src/gui/newSong.cpp
|
src/gui/newSong.cpp
|
||||||
src/gui/commandPalette.cpp
|
|
||||||
src/gui/orders.cpp
|
src/gui/orders.cpp
|
||||||
src/gui/osc.cpp
|
src/gui/osc.cpp
|
||||||
src/gui/patManager.cpp
|
src/gui/patManager.cpp
|
||||||
|
@ -924,126 +598,35 @@ src/gui/scaling.cpp
|
||||||
src/gui/settings.cpp
|
src/gui/settings.cpp
|
||||||
src/gui/songInfo.cpp
|
src/gui/songInfo.cpp
|
||||||
src/gui/songNotes.cpp
|
src/gui/songNotes.cpp
|
||||||
src/gui/speed.cpp
|
|
||||||
src/gui/spoiler.cpp
|
src/gui/spoiler.cpp
|
||||||
src/gui/stats.cpp
|
src/gui/stats.cpp
|
||||||
src/gui/subSongs.cpp
|
src/gui/subSongs.cpp
|
||||||
src/gui/sysConf.cpp
|
src/gui/sysConf.cpp
|
||||||
src/gui/sysEx.cpp
|
src/gui/sysEx.cpp
|
||||||
src/gui/sysManager.cpp
|
src/gui/sysManager.cpp
|
||||||
src/gui/sysMiscInfo.cpp
|
|
||||||
src/gui/sysPicker.cpp
|
src/gui/sysPicker.cpp
|
||||||
src/gui/tutorial.cpp
|
|
||||||
src/gui/userPresets.cpp
|
|
||||||
src/gui/util.cpp
|
src/gui/util.cpp
|
||||||
src/gui/waveEdit.cpp
|
src/gui/waveEdit.cpp
|
||||||
src/gui/volMeter.cpp
|
src/gui/volMeter.cpp
|
||||||
src/gui/xyOsc.cpp
|
|
||||||
src/gui/gui.cpp
|
src/gui/gui.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32 AND NOT SUPPORT_XP)
|
if (WIN32 OR APPLE)
|
||||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
|
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_win.cpp)
|
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_win.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (USE_FREETYPE)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/misc/freetype/imgui_freetype.cpp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
|
|
||||||
list(APPEND GUI_SOURCES src/gui/macstuff.m)
|
list(APPEND GUI_SOURCES src/gui/macstuff.m)
|
||||||
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_cocoa.mm)
|
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_cocoa.mm)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_RENDER_SDL)
|
|
||||||
list(APPEND GUI_SOURCES src/gui/render/renderSDL.cpp)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_sdlrenderer2.cpp)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_SDL)
|
|
||||||
message(STATUS "UI render backend: SDL_Renderer")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WITH_RENDER_OPENGL)
|
|
||||||
list(APPEND GUI_SOURCES src/gui/render/renderGL.cpp)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_opengl3.cpp)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_GL)
|
|
||||||
if (USE_GLES)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES USE_GLES)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES IMGUI_IMPL_OPENGL_ES2)
|
|
||||||
endif()
|
|
||||||
if (WIN32)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES opengl32)
|
|
||||||
elseif(APPLE)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES "-framework OpenGL")
|
|
||||||
elseif(USE_GLES)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES GLESv2)
|
|
||||||
else()
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES GL)
|
|
||||||
endif()
|
|
||||||
if (USE_GLES)
|
|
||||||
message(STATUS "UI render backend: OpenGL ES 2.0")
|
|
||||||
else()
|
|
||||||
message(STATUS "UI render backend: OpenGL 3.0/2.0")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WITH_RENDER_OPENGL1)
|
|
||||||
list(APPEND GUI_SOURCES src/gui/render/renderGL1.cpp)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_opengl2.cpp)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_GL1)
|
|
||||||
if (NOT WITH_RENDER_OPENGL)
|
|
||||||
if (WIN32)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES opengl32)
|
|
||||||
else()
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES GL)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
message(STATUS "UI render backend: OpenGL 1.1")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WITH_RENDER_DX11)
|
|
||||||
if (WIN32)
|
|
||||||
if (SUPPORT_XP)
|
|
||||||
message(FATAL_ERROR "SUPPORT_XP is on. cannot enable DirectX 11 backend.")
|
|
||||||
else()
|
|
||||||
list(APPEND GUI_SOURCES src/gui/render/renderDX11.cpp)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_dx11.cpp)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_DX11)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES d3d11 dxgi)
|
|
||||||
message(STATUS "UI render backend: DirectX 11")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "DirectX 11 render backend only for Windows!")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WITH_RENDER_DX9)
|
|
||||||
if (WIN32)
|
|
||||||
list(APPEND GUI_SOURCES src/gui/render/renderDX9.cpp)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_dx9.cpp)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_DX9)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES d3d9)
|
|
||||||
message(STATUS "UI render backend: DirectX 9")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "DirectX 9 render backend only for Windows!")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WITH_RENDER_METAL)
|
|
||||||
if (APPLE)
|
|
||||||
list(APPEND GUI_SOURCES src/gui/render/renderMetal.mm)
|
|
||||||
list(APPEND GUI_SOURCES extern/imgui_patched/backends/imgui_impl_metal.mm)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_RENDER_METAL)
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES "-framework Metal")
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES "-framework MetalKit")
|
|
||||||
message(STATUS "UI render backend: Metal")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Metal render backend only for Apple operating systems!")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT WIN32 AND NOT APPLE)
|
if (NOT WIN32 AND NOT APPLE)
|
||||||
|
list(APPEND GUI_SOURCES src/gui/icon.c)
|
||||||
|
|
||||||
CHECK_INCLUDE_FILE(sys/io.h SYS_IO_FOUND)
|
CHECK_INCLUDE_FILE(sys/io.h SYS_IO_FOUND)
|
||||||
CHECK_INCLUDE_FILE(linux/input.h LINUX_INPUT_FOUND)
|
CHECK_INCLUDE_FILE(linux/input.h LINUX_INPUT_FOUND)
|
||||||
CHECK_INCLUDE_FILE(linux/kd.h LINUX_KD_FOUND)
|
CHECK_INCLUDE_FILE(linux/kd.h LINUX_KD_FOUND)
|
||||||
|
@ -1073,56 +656,12 @@ if (NOT WIN32)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_LOCALE)
|
|
||||||
if (HAVE_SETLOCALE)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_SETLOCALE)
|
|
||||||
message(STATUS "setlocale() found")
|
|
||||||
else()
|
|
||||||
if (NOT USE_MOMO)
|
|
||||||
message(FATAL_ERROR "setlocale() is not defined! This means the C library in your system does not support locale at all. Try enabling USE_MOMO.")
|
|
||||||
else()
|
|
||||||
message(STATUS "setlocale() is not defined")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (USE_MOMO)
|
|
||||||
list(APPEND ENGINE_SOURCES src/momo/momo.c)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_LOCALE)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_MOMO)
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS src/momo)
|
|
||||||
message(STATUS "Using libintl (Momo)")
|
|
||||||
else()
|
|
||||||
if ("${CMAKE_VERSION}" VERSION_LESS "3.2")
|
|
||||||
message(FATAL_ERROR "CMake 3.2 or later required for locale support.")
|
|
||||||
else()
|
|
||||||
if (NOT Intl_FOUND)
|
|
||||||
message(FATAL_ERROR "Could not find libintl! Try enabling USE_MOMO.")
|
|
||||||
endif()
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES HAVE_LOCALE)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES GNULIB_overrides_sprintf)
|
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${Intl_INCLUDE_DIRS})
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES ${Intl_LIBRARIES})
|
|
||||||
message(STATUS "Using libintl (system)")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(USED_SOURCES ${ENGINE_SOURCES} ${AUDIO_SOURCES} ${CLI_SOURCES} src/main.cpp)
|
set(USED_SOURCES ${ENGINE_SOURCES} ${AUDIO_SOURCES} ${CLI_SOURCES} src/main.cpp)
|
||||||
|
|
||||||
if (USE_BACKWARD)
|
if (USE_BACKWARD)
|
||||||
list(APPEND USED_SOURCES src/backtrace.cpp)
|
list(APPEND USED_SOURCES src/backtrace.cpp)
|
||||||
if (WIN32)
|
if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
list(APPEND DEPENDENCIES_LIBRARIES dbghelp psapi)
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
check_cxx_compiler_flag(-gcodeview GCC_CODEVIEW)
|
|
||||||
if (GCC_CODEVIEW)
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--pdb= ")
|
|
||||||
add_compile_options(-gcodeview)
|
|
||||||
message(STATUS "Enabling -gcodeview flag for backward-cpp.")
|
|
||||||
else()
|
|
||||||
message(WARNING "Could not enable -gcodeview! backward-cpp will not work.")
|
|
||||||
endif()
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES dbghelp psapi)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
find_library(EXECINFO_IS_LIBRARY execinfo)
|
find_library(EXECINFO_IS_LIBRARY execinfo)
|
||||||
if (EXECINFO_IS_LIBRARY)
|
if (EXECINFO_IS_LIBRARY)
|
||||||
|
@ -1137,8 +676,9 @@ if (BUILD_GUI)
|
||||||
list(APPEND USED_SOURCES ${GUI_SOURCES})
|
list(APPEND USED_SOURCES ${GUI_SOURCES})
|
||||||
list(APPEND DEPENDENCIES_INCLUDE_DIRS
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS
|
||||||
extern/imgui_patched
|
extern/imgui_patched
|
||||||
|
extern/imgui_conf
|
||||||
extern/imgui_patched/backends
|
extern/imgui_patched/backends
|
||||||
extern/imgui_software_renderer
|
extern/IconFontCppHeaders
|
||||||
extern/igfd
|
extern/igfd
|
||||||
)
|
)
|
||||||
if (WIN32 OR APPLE)
|
if (WIN32 OR APPLE)
|
||||||
|
@ -1157,11 +697,11 @@ if (WIN32)
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES -static)
|
list(APPEND DEPENDENCIES_LIBRARIES -static)
|
||||||
endif()
|
endif()
|
||||||
elseif (APPLE)
|
endif()
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
find_library(COCOA Cocoa REQUIRED)
|
find_library(COCOA Cocoa REQUIRED)
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES ${COCOA})
|
list(APPEND DEPENDENCIES_LIBRARIES ${COCOA})
|
||||||
else()
|
|
||||||
list(APPEND DEPENDENCIES_LIBRARIES ${CMAKE_DL_LIBS})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
|
@ -1193,105 +733,50 @@ endif()
|
||||||
string(REPLACE ";" " " WARNING_FLAGS_STRING "${WARNING_FLAGS}")
|
string(REPLACE ";" " " WARNING_FLAGS_STRING "${WARNING_FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_STRING}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_STRING}")
|
||||||
if (WARNINGS_ARE_ERRORS)
|
if (WARNINGS_ARE_ERRORS)
|
||||||
message(STATUS
|
message(WARNING
|
||||||
"Treating all warnings in furnace's C++ code as errors! "
|
"Treating all warnings in furnace's C++ code as errors! "
|
||||||
"Please report any errors you encounter on the bug tracker."
|
"Please report any errors you encounter on the bug tracker."
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT ANDROID OR TERMUX)
|
if (MSVC)
|
||||||
if (NOT WIN32 AND NOT APPLE)
|
add_executable(furnace WIN32 ${USED_SOURCES})
|
||||||
if (NOT DONT_HAVE_GIT)
|
elseif(ANDROID AND NOT TERMUX)
|
||||||
add_custom_command(OUTPUT furnace.appdata.xml COMMAND res/make-appdata.sh ARGS ${CMAKE_SOURCE_DIR}/res/furnace.appdata.xml.in ${CMAKE_BINARY_DIR}/furnace.appdata.xml DEPENDS res/furnace.appdata.xml.in WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
add_library(furnace SHARED ${USED_SOURCES})
|
||||||
list(APPEND USED_SOURCES furnace.appdata.xml)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32 AND CONSOLE_SUBSYSTEM)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES "TA_SUBSYSTEM_CONSOLE")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MAKE_BUNDLE)
|
|
||||||
set(FURNACE Furnace)
|
|
||||||
else()
|
else()
|
||||||
set(FURNACE furnace)
|
add_executable(furnace ${USED_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID AND NOT TERMUX)
|
target_include_directories(furnace SYSTEM PRIVATE ${DEPENDENCIES_INCLUDE_DIRS})
|
||||||
add_library(${FURNACE} SHARED ${USED_SOURCES})
|
target_compile_definitions(furnace PRIVATE ${DEPENDENCIES_DEFINES} IMGUI_USER_CONFIG="imconfig_fur.h")
|
||||||
elseif(WIN32 AND NOT CONSOLE_SUBSYSTEM)
|
target_compile_options(furnace PRIVATE ${DEPENDENCIES_COMPILE_OPTIONS})
|
||||||
add_executable(${FURNACE} WIN32 ${USED_SOURCES})
|
target_link_libraries(furnace PRIVATE ${DEPENDENCIES_LIBRARIES})
|
||||||
else()
|
|
||||||
add_executable(${FURNACE} ${USED_SOURCES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MAKE_BUNDLE AND NOT FORCE_APPLE_BIN)
|
|
||||||
set_target_properties(${FURNACE} PROPERTIES
|
|
||||||
MACOSX_BUNDLE True
|
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/Info.plist)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(${FURNACE} SYSTEM PRIVATE ${DEPENDENCIES_INCLUDE_DIRS})
|
|
||||||
target_compile_options(${FURNACE} PRIVATE ${DEPENDENCIES_COMPILE_OPTIONS})
|
|
||||||
target_link_libraries(${FURNACE} PRIVATE ${DEPENDENCIES_LIBRARIES})
|
|
||||||
if (PKG_CONFIG_FOUND AND (SYSTEM_FMT OR SYSTEM_LIBSNDFILE OR SYSTEM_ZLIB OR SYSTEM_SDL2 OR SYSTEM_RTMIDI OR WITH_JACK))
|
if (PKG_CONFIG_FOUND AND (SYSTEM_FMT OR SYSTEM_LIBSNDFILE OR SYSTEM_ZLIB OR SYSTEM_SDL2 OR SYSTEM_RTMIDI OR WITH_JACK))
|
||||||
if ("${CMAKE_VERSION}" VERSION_LESS "3.13")
|
if ("${CMAKE_VERSION}" VERSION_LESS "3.13")
|
||||||
message(WARNING
|
message(WARNING
|
||||||
"CMake version is <3.13, using old pkg-config LDFLAGS. "
|
"CMake version is <3.13, using old pkg-config LDFLAGS. "
|
||||||
"You may encounter linking problems with these!"
|
"You may encounter linking problems with these!"
|
||||||
)
|
)
|
||||||
target_link_libraries(${FURNACE} PRIVATE ${DEPENDENCIES_LEGACY_LDFLAGS})
|
target_link_libraries(furnace PRIVATE ${DEPENDENCIES_LEGACY_LDFLAGS})
|
||||||
else()
|
else()
|
||||||
target_link_directories(${FURNACE} PRIVATE ${DEPENDENCIES_LIBRARY_DIRS})
|
target_link_directories(furnace PRIVATE ${DEPENDENCIES_LIBRARY_DIRS})
|
||||||
target_link_options(${FURNACE} PRIVATE ${DEPENDENCIES_LINK_OPTIONS})
|
target_link_options(furnace PRIVATE ${DEPENDENCIES_LINK_OPTIONS})
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# why 3.16..... why not 3.0?
|
|
||||||
if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.16")
|
|
||||||
if (BUILD_GUI)
|
|
||||||
target_precompile_headers(${FURNACE} PUBLIC
|
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/src/pch.h>
|
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/extern/imgui_patched/imgui.h>
|
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/extern/imgui_patched/imgui_internal.h>
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
target_precompile_headers(${FURNACE} PUBLIC
|
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/src/pch.h>
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT ANDROID OR TERMUX)
|
if (NOT ANDROID OR TERMUX)
|
||||||
if (NOT WIN32 AND NOT APPLE)
|
if (NOT WIN32 AND NOT APPLE)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
install(TARGETS ${FURNACE} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS furnace RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
install(FILES res/furnace.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
install(FILES res/furnace.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||||
install(FILES res/mime.xml RENAME furnace.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
|
install(FILES res/furnace.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
||||||
if (NOT DONT_HAVE_GIT)
|
install(DIRECTORY papers DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/furnace.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
|
||||||
endif()
|
|
||||||
install(DIRECTORY doc DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
||||||
install(DIRECTORY papers DESTINATION ${CMAKE_INSTALL_DOCDIR}/other)
|
|
||||||
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/furnace)
|
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/furnace)
|
||||||
list(APPEND DEPENDENCIES_DEFINES LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
|
if (WITH_DEMOS)
|
||||||
install(DIRECTORY po/locale/ DESTINATION ${CMAKE_INSTALL_LOCALEDIR})
|
install(DIRECTORY demos DESTINATION ${CMAKE_INSTALL_DATADIR}/furnace)
|
||||||
if (WITH_DEMOS OR WITH_INSTRUMENTS OR WITH_WAVETABLES)
|
endif()
|
||||||
set(FURNACE_DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/furnace)
|
if (WITH_INSTRUMENTS)
|
||||||
if (WITH_DEMOS)
|
install(DIRECTORY instruments DESTINATION ${CMAKE_INSTALL_DATADIR}/furnace)
|
||||||
install(DIRECTORY demos DESTINATION ${FURNACE_DATADIR})
|
|
||||||
endif()
|
|
||||||
if (WITH_INSTRUMENTS)
|
|
||||||
install(DIRECTORY instruments DESTINATION ${FURNACE_DATADIR})
|
|
||||||
endif()
|
|
||||||
if (WITH_WAVETABLES)
|
|
||||||
install(DIRECTORY wavetables DESTINATION ${FURNACE_DATADIR})
|
|
||||||
endif()
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES FURNACE_DATADIR="${FURNACE_DATADIR}")
|
|
||||||
if (SHOW_OPEN_ASSETS_MENU_ENTRY)
|
|
||||||
list(APPEND DEPENDENCIES_DEFINES SHOW_OPEN_ASSETS_MENU_ENTRY)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
foreach(num 16 32 64 128 256 512)
|
foreach(num 16 32 64 128 256 512)
|
||||||
set(res ${num}x${num})
|
set(res ${num}x${num})
|
||||||
|
@ -1300,12 +785,23 @@ if (NOT ANDROID OR TERMUX)
|
||||||
endforeach()
|
endforeach()
|
||||||
install(FILES res/logo.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/1024x1024/apps)
|
install(FILES res/logo.png RENAME furnace.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/1024x1024/apps)
|
||||||
else()
|
else()
|
||||||
if (MAKE_BUNDLE)
|
install(TARGETS furnace RUNTIME DESTINATION bin)
|
||||||
install(TARGETS ${FURNACE} BUNDLE DESTINATION Applications RESOURCE DESTINATION Resources)
|
|
||||||
else()
|
|
||||||
install(TARGETS ${FURNACE} RUNTIME DESTINATION bin)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_definitions(${FURNACE} PRIVATE ${DEPENDENCIES_DEFINES})
|
set(CPACK_PACKAGE_NAME "Furnace")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "tildearrow")
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION "free and open-source chiptune tracker")
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(CPACK_GENERATOR Bundle)
|
||||||
|
set(CPACK_DMG_SLA_DIR ${CMAKE_SOURCE_DIR}/res/macLicense)
|
||||||
|
set(CPACK_DMG_SLA_LANGUAGES en)
|
||||||
|
set(CPACK_BUNDLE_NAME "Furnace")
|
||||||
|
set(CPACK_DMG_VOLUME_NAME "Furnace")
|
||||||
|
set(CPACK_BUNDLE_PLIST ${CMAKE_SOURCE_DIR}/res/Info.plist)
|
||||||
|
set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/res/icon.icns)
|
||||||
|
set(CPACK_BUNDLE_STARTUP_COMMAND "furnace")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CPack)
|
||||||
|
endif()
|
||||||
|
|
|
@ -2,19 +2,7 @@
|
||||||
|
|
||||||
contributions to Furnace are welcome!
|
contributions to Furnace are welcome!
|
||||||
|
|
||||||
# Issue reports
|
# Getting ready
|
||||||
|
|
||||||
if you find an issue with Furnace, see the Issues section.
|
|
||||||
|
|
||||||
# Suggestions and other types of discussions
|
|
||||||
|
|
||||||
see the Discussions section.
|
|
||||||
|
|
||||||
**DO NOT USE THE ISSUES SECTION FOR THESE - it is only for ISSUES.**
|
|
||||||
|
|
||||||
# Other
|
|
||||||
|
|
||||||
## Getting ready
|
|
||||||
|
|
||||||
log into your Github account, and click the Fork button in the header of the project's page.
|
log into your Github account, and click the Fork button in the header of the project's page.
|
||||||
|
|
||||||
|
@ -26,9 +14,9 @@ git clone git@github.com:USERNAME/furnace.git
|
||||||
|
|
||||||
(replace `USERNAME` with your username)
|
(replace `USERNAME` with your username)
|
||||||
|
|
||||||
## Working
|
# Working
|
||||||
|
|
||||||
### Code
|
## Code
|
||||||
|
|
||||||
bug fixes, improvements and several other things accepted.
|
bug fixes, improvements and several other things accepted.
|
||||||
|
|
||||||
|
@ -41,13 +29,11 @@ the coding style is described here:
|
||||||
- no spaces in operations except for `||` and `&&`
|
- no spaces in operations except for `||` and `&&`
|
||||||
- no space between variable name and assignment
|
- no space between variable name and assignment
|
||||||
- space between macro in string literals
|
- space between macro in string literals
|
||||||
- space after comment delimiter
|
|
||||||
- C++ pointer style: `void* variable` rather than `void *variable`
|
- C++ pointer style: `void* variable` rather than `void *variable`
|
||||||
- indent switch cases
|
- indent switch cases
|
||||||
- preprocessor directives not intended
|
- preprocessor directives not intended
|
||||||
- if macro comprises more than one line, indent
|
- if macro comprises more than one line, indent
|
||||||
- no new line after `template<>`
|
- no new line after `template<>`
|
||||||
- do not use `_t` types, except for 64-bit integers and `size_t`.
|
|
||||||
- prefer built-in types:
|
- prefer built-in types:
|
||||||
- `bool`
|
- `bool`
|
||||||
- `signed char` or `unsigned char` are 8-bit
|
- `signed char` or `unsigned char` are 8-bit
|
||||||
|
@ -61,13 +47,11 @@ the coding style is described here:
|
||||||
- `long long int` or `unsigned long long int` are 64-bit
|
- `long long int` or `unsigned long long int` are 64-bit
|
||||||
- avoid using 64-bit numbers as I still build for 32-bit systems.
|
- avoid using 64-bit numbers as I still build for 32-bit systems.
|
||||||
- two `long`s are required to make Windows happy.
|
- two `long`s are required to make Windows happy.
|
||||||
- prefer using `int64_t` or `uint64_t` for this specific case.
|
|
||||||
- `size_t` are 32-bit or 64-bit, depending on architecture.
|
- `size_t` are 32-bit or 64-bit, depending on architecture.
|
||||||
- in float/double operations, always use decimal and `f` if single-precision.
|
- in float/double operations, always use decimal and `f` if single-precision.
|
||||||
- e.g. `1.0f` or `1.0` instead of `1`.
|
- e.g. `1.0f` or `1.0` instead of `1`.
|
||||||
- prefer `NULL` over `nullptr` or any other proprietary null.
|
- prefer `NULL` over `nullptr` or any other proprietary null.
|
||||||
- only use `auto` if needed.
|
- don't use `auto` unless needed.
|
||||||
- avoid using `goto` unless absolutely required.
|
|
||||||
- use `String` for `std::string` (this is typedef'd in ta-utils.h).
|
- use `String` for `std::string` (this is typedef'd in ta-utils.h).
|
||||||
- prefer using operator for String (std::string) comparisons (a=="").
|
- prefer using operator for String (std::string) comparisons (a=="").
|
||||||
- if you have to work with C strings, only use safe C string operations:
|
- if you have to work with C strings, only use safe C string operations:
|
||||||
|
@ -92,31 +76,22 @@ additional guidelines:
|
||||||
- I will run a test suite to make sure this is the case.
|
- I will run a test suite to make sure this is the case.
|
||||||
- if something breaks, you might want to add a compatibility flag (this requires changing the format though).
|
- if something breaks, you might want to add a compatibility flag (this requires changing the format though).
|
||||||
- do not use `#pragma once`.
|
- do not use `#pragma once`.
|
||||||
- do not memcmp() structs.
|
|
||||||
- on a switch block, **always** put `default` last and not in any other position.
|
- on a switch block, **always** put `default` last and not in any other position.
|
||||||
- I have fear of some C/C++ compilers ignoring the rest of cases upon hitting default.
|
- I have fear of some C/C++ compilers ignoring the rest of cases upon hitting default.
|
||||||
|
|
||||||
### Do NOT Force-Push after submitting Pull Request
|
## Demo Songs
|
||||||
|
|
||||||
if you do so, your pull request will be closed.
|
|
||||||
|
|
||||||
### Demo Songs
|
|
||||||
|
|
||||||
just put your demo song in `demos/`! be noted there are some guidelines:
|
just put your demo song in `demos/`! be noted there are some guidelines:
|
||||||
|
|
||||||
- avoid Nintendo song covers.
|
- avoid Nintendo song covers.
|
||||||
- avoid big label song covers.
|
- avoid big label song covers.
|
||||||
- low effort compositions/covers may not be accepted at all.
|
- avoid poor quality songs.
|
||||||
- the following systems are not acceptable:
|
|
||||||
- YMU759/MA-2: exists only for compatibility.
|
|
||||||
- Pong: it is a joke system.
|
|
||||||
- the song shall be in Furnace file format.
|
|
||||||
|
|
||||||
## Finishing
|
# Finishing
|
||||||
|
|
||||||
after you've done your modifications, commit the changes and push.
|
after you've done your modifications, commit the changes and push.
|
||||||
then open your fork on GitHub and send a pull request.
|
then open your fork on GitHub and send a pull request.
|
||||||
|
|
||||||
## I don't know how to use Git but I want to contribute with a demo song
|
# I don't know how to use Git but I want to contribute with a demo song
|
||||||
|
|
||||||
you can also contact me directly! [find me here.](https://tildearrow.org/?p=contact)
|
you can also contact me directly! [find me here.](https://tildearrow.org/?p=contact)
|
||||||
|
|
218
README.md
218
README.md
|
@ -1,23 +1,21 @@
|
||||||
# Furnace (chiptune tracker)
|
# Furnace Tracker
|
||||||
|
|
||||||
![screenshot](papers/screenshot3.png)
|
![screenshot](papers/screenshot2.png)
|
||||||
|
|
||||||
the biggest multi-system chiptune tracker ever made!
|
the biggest multi-system chiptune tracker ever made!
|
||||||
|
|
||||||
[downloads](#downloads) | [discussion/help](#quick-references) | [developer info](#developer-info) | [Unix/Linux packages](#packages)
|
[downloads](#downloads) | [discussion/help](#quick-references) | [developer info](#developer-info) | [unofficial packages](#unofficial-packages) | [FAQ](#frequently-asked-questions)
|
||||||
|
|
||||||
---
|
---
|
||||||
## downloads
|
## downloads
|
||||||
|
|
||||||
check out the [Releases](https://github.com/tildearrow/furnace/releases) page. available for Windows, macOS and Linux.
|
check out the [Releases](https://github.com/tildearrow/furnace/releases) page. available for Windows, macOS and Linux (AppImage).
|
||||||
|
|
||||||
for other operating systems, you may [build the source](#developer-info).
|
[see here](https://nightly.link/tildearrow/furnace/workflows/build/master) for unstable developer builds.
|
||||||
|
|
||||||
[see here](https://nightly.link/tildearrow/furnace/workflows/build/master) for the latest unstable build.
|
|
||||||
|
|
||||||
## features
|
## features
|
||||||
|
|
||||||
- a large selection of sound chips:
|
- over 50 sound chips - and counting:
|
||||||
- Yamaha FM chips:
|
- Yamaha FM chips:
|
||||||
- YM2151 (OPM)
|
- YM2151 (OPM)
|
||||||
- YM2203 (OPN)
|
- YM2203 (OPN)
|
||||||
|
@ -31,29 +29,20 @@ for other operating systems, you may [build the source](#developer-info).
|
||||||
- YM3812 (OPL2)
|
- YM3812 (OPL2)
|
||||||
- YMF262 (OPL3) with full 4-op support!
|
- YMF262 (OPL3) with full 4-op support!
|
||||||
- Y8950 (OPL with ADPCM)
|
- Y8950 (OPL with ADPCM)
|
||||||
- ESS ESFM (like OPL3 but with more features)
|
|
||||||
- square wave chips:
|
- square wave chips:
|
||||||
- AY-3-8910/YM2149(F) used in several computers and game consoles
|
- AY-3-8910/YM2149(F) used in several computers and game consoles
|
||||||
- Commodore VIC used in the VIC-20
|
- Commodore VIC used in the VIC-20
|
||||||
- Microchip AY8930
|
- Microchip AY8930
|
||||||
- TI SN76489 used in Sega Master System, BBC Micro, and many others
|
- TI SN76489 used in Sega Master System and BBC Micro
|
||||||
- PC Speaker
|
- PC Speaker
|
||||||
- Philips SAA1099 used in SAM Coupé
|
- Philips SAA1099 used in SAM Coupé
|
||||||
- OKI MSM5232 used in some arcade boards
|
|
||||||
- sample chips:
|
- sample chips:
|
||||||
- SNES
|
|
||||||
- Amiga
|
- Amiga
|
||||||
- SegaPCM - all 16 channels
|
- SegaPCM - all 16 channels
|
||||||
- Capcom QSound
|
- Capcom QSound
|
||||||
- Yamaha YMZ280B (PCMD8)
|
- Yamaha YMZ280B (PCMD8)
|
||||||
- Ricoh RF5C68 used in Sega CD and FM Towns
|
- Ricoh RF5C68 used in Sega CD and FM Towns
|
||||||
- OKI MSM6258 and MSM6295
|
- OKI MSM6258 and MSM6295
|
||||||
- Konami K007232
|
|
||||||
- Konami K053260
|
|
||||||
- Irem GA20
|
|
||||||
- Ensoniq ES5506
|
|
||||||
- Namco C140
|
|
||||||
- Namco C219
|
|
||||||
- wavetable chips:
|
- wavetable chips:
|
||||||
- HuC6280 used in PC Engine
|
- HuC6280 used in PC Engine
|
||||||
- Konami Bubble System WSG
|
- Konami Bubble System WSG
|
||||||
|
@ -61,7 +50,6 @@ for other operating systems, you may [build the source](#developer-info).
|
||||||
- Namco arcade chips (WSG/C15/C30)
|
- Namco arcade chips (WSG/C15/C30)
|
||||||
- WonderSwan
|
- WonderSwan
|
||||||
- Seta/Allumer X1-010
|
- Seta/Allumer X1-010
|
||||||
- Sharp SM8521 used in Tiger Game.com
|
|
||||||
- NES (Ricoh 2A03/2A07), with additional expansion sound support:
|
- NES (Ricoh 2A03/2A07), with additional expansion sound support:
|
||||||
- Konami VRC6
|
- Konami VRC6
|
||||||
- Konami VRC7
|
- Konami VRC7
|
||||||
|
@ -72,62 +60,39 @@ for other operating systems, you may [build the source](#developer-info).
|
||||||
- Family Noraebang (OPLL)
|
- Family Noraebang (OPLL)
|
||||||
- SID (6581/8580) used in Commodore 64
|
- SID (6581/8580) used in Commodore 64
|
||||||
- Mikey used in Atari Lynx
|
- Mikey used in Atari Lynx
|
||||||
- ZX Spectrum beeper
|
- ZX Spectrum beeper (SFX-like engine)
|
||||||
- SFX-like engine
|
|
||||||
- QuadTone engine
|
|
||||||
- Pokémon Mini
|
|
||||||
- Commodore PET
|
- Commodore PET
|
||||||
- TED used in Commodore Plus/4
|
|
||||||
- Casio PV-1000
|
|
||||||
- TIA used in Atari 2600
|
- TIA used in Atari 2600
|
||||||
- including software tuning engine (TIunA)
|
- Game Boy
|
||||||
- POKEY used in Atari 8-bit computers
|
|
||||||
- **Game Boy**
|
|
||||||
- including SOFTWARE ENVELOPES (zombie mode)
|
|
||||||
- Virtual Boy
|
|
||||||
- Game Boy Advance
|
|
||||||
- DMA (direct memory access) two channel mode
|
|
||||||
- MinMod software driver by Natt Akuma
|
|
||||||
- Nintendo DS
|
|
||||||
- modern/fantasy:
|
- modern/fantasy:
|
||||||
- Commander X16 VERA
|
- Commander X16 VERA
|
||||||
- tildearrow Sound Unit
|
- tildearrow Sound Unit
|
||||||
- PowerNoise
|
|
||||||
- Bifurcator
|
|
||||||
- SID2
|
|
||||||
- Generic PCM DAC
|
|
||||||
- mix and match sound chips!
|
- mix and match sound chips!
|
||||||
- over 200 ready to use presets from computers, game consoles and arcade boards...
|
- over 200 ready to use presets from computers, game consoles and arcade boards...
|
||||||
- ...or create your own presets - up to 32 chips or a total of 128 channels!
|
- ...or create your own - up to 32 of them or a total of 128 channels!
|
||||||
- DefleMask compatibility
|
- DefleMask compatibility
|
||||||
- loads .dmf modules from all versions (beta 1 to 1.1.9)
|
- loads .dmf modules from all versions (beta 1 to 1.1.3)
|
||||||
- saves .dmf modules - both modern and legacy
|
- saves .dmf modules - both modern and legacy
|
||||||
- Furnace doubles as a module downgrader
|
- Furnace doubles as a module downgrader
|
||||||
- loads/saves .dmp instruments and .dmw wavetables as well
|
- loads/saves .dmp instruments and .dmw wavetables as well
|
||||||
- clean-room design (guesswork and ABX tests only, no decompilation involved)
|
- clean-room design (guesswork and ABX tests only, no decompilation involved)
|
||||||
- some bug/quirk implementation for increased playback accuracy through compatibility flags
|
- bug/quirk implementation for increased playback accuracy through compatibility flags
|
||||||
- VGM export
|
- VGM export
|
||||||
- ZSM export for Commander X16
|
|
||||||
- TIunA export for Atari 2600
|
|
||||||
- modular layout that you may adapt to your needs
|
- modular layout that you may adapt to your needs
|
||||||
- audio file export - entire song, per chip or per channel
|
- audio file export - entire song, per chip or per channel
|
||||||
- quality emulation cores (Nuked, MAME, SameBoy, Mednafen PCE, NSFplay, puNES, reSID, Stella, SAASound, vgsound_emu and ymfm)
|
- quality emulation cores (Nuked, MAME, SameBoy, Mednafen PCE, NSFplay, puNES, reSID, Stella, SAASound, vgsound_emu and ymfm)
|
||||||
- wavetable synthesizer
|
- wavetable synthesizer
|
||||||
- available on wavetable chips
|
- available on wavetable chips
|
||||||
- create complex sounds with ease - provide up to two wavetables, select an effect and let go!
|
- create complex sounds with ease - provide up to two wavetables, select and effect and let go!
|
||||||
- MIDI input support
|
- MIDI input support
|
||||||
- additional features:
|
- additional features:
|
||||||
- FM macros!
|
- FM macros!
|
||||||
- negative octaves
|
- negative octaves
|
||||||
- advanced arp macros
|
|
||||||
- arbitrary pitch samples
|
- arbitrary pitch samples
|
||||||
- sample loop points
|
- sample loop points
|
||||||
- SSG envelopes and ADPCM-B in Neo Geo
|
- SSG envelopes and ADPCM-B in Neo Geo
|
||||||
- pitchable OPLL drums
|
|
||||||
- full duty/cutoff range in C64
|
- full duty/cutoff range in C64
|
||||||
- full 16-channel SegaPCM
|
|
||||||
- ability to change tempo mid-song
|
- ability to change tempo mid-song
|
||||||
- decimal tempo/tick rate
|
|
||||||
- multiple sub-songs in a module
|
- multiple sub-songs in a module
|
||||||
- per-channel oscilloscope with waveform centering
|
- per-channel oscilloscope with waveform centering
|
||||||
- built-in sample editor
|
- built-in sample editor
|
||||||
|
@ -138,23 +103,18 @@ for other operating systems, you may [build the source](#developer-info).
|
||||||
---
|
---
|
||||||
# quick references
|
# quick references
|
||||||
|
|
||||||
- **help**: check out the [documentation](doc/README.md), [quick start guide](doc/1-intro/quickstart.md), and [frequently asked questions (FAQ)](doc/1-intro/faq.md).
|
- **discussion**: see the [Discussions](https://github.com/tildearrow/furnace/discussions) section, or (preferably) the [official Discord server](https://discord.gg/EfrwT2wq7z).
|
||||||
- **discussion**: see the [Discussions](https://github.com/tildearrow/furnace/discussions) section, or the [Discord](https://discord.gg/QhA26dXD23).
|
- **help**: check out the [documentation](papers/doc/README.md). it's mostly incomplete, but has details on effects.
|
||||||
|
|
||||||
## packages
|
## unofficial packages
|
||||||
|
|
||||||
[![Packaging status](https://repology.org/badge/vertical-allrepos/furnace.svg)](https://repology.org/project/furnace/versions)
|
[![Packaging status](https://repology.org/badge/tiny-repos/furnace.svg)](https://repology.org/project/furnace/versions)
|
||||||
|
|
||||||
some people have provided packages for Unix/Unix-like distributions. here's a list.
|
some people have provided packages for Unix/Unix-like distributions. here's a list.
|
||||||
|
- **Arch Linux**: [furnace-git is in the AUR.](https://aur.archlinux.org/packages/furnace-git) thank you Essem!
|
||||||
- **Flatpak**: yes! Furnace is now available on [Flathub](https://flathub.org/apps/org.tildearrow.furnace) thanks to ColinKinloch.
|
- **FreeBSD**: [a package in ports](https://www.freshports.org/audio/furnace/) is available courtesy of ehaupt.
|
||||||
|
- **Nix**: [package](https://search.nixos.org/packages?channel=unstable&show=furnace&from=0&size=50&sort=relevance&type=packages&query=furnace) thanks to OPNA2608.
|
||||||
- **Arch Linux**: [furnace](https://archlinux.org/packages/extra/x86_64/furnace/) is in the official repositories.
|
- **openSUSE**: [a package](https://software.opensuse.org/package/furnace) is available, courtesy of fpesari.
|
||||||
- **Chimera Linux**: [furnace](https://pkgs.chimera-linux.org/package/current/contrib/x86_64/furnace) is in the contrib repository.
|
|
||||||
- **FreeBSD**: [a package in ports](https://www.freshports.org/audio/furnace/) is available courtesy of ehaupt.
|
|
||||||
- **Nix**: [package](https://search.nixos.org/packages?channel=unstable&show=furnace&from=0&size=50&sort=relevance&type=packages&query=furnace) thanks to OPNA2608.
|
|
||||||
- **openSUSE**: [a package](https://software.opensuse.org/package/furnace) is available, courtesy of fpesari.
|
|
||||||
- **Void Linux**: [furnace](https://github.com/void-linux/void-packages/tree/master/srcpkgs/furnace) is available in the official repository.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
# developer info
|
# developer info
|
||||||
|
@ -168,9 +128,7 @@ if you can't download these artifacts (because GitHub requires you to be logged
|
||||||
## dependencies
|
## dependencies
|
||||||
|
|
||||||
- CMake
|
- CMake
|
||||||
- Git (for cloning the repository)
|
|
||||||
- JACK (optional, macOS/Linux only)
|
- JACK (optional, macOS/Linux only)
|
||||||
- a C/C++ compiler (e.g. Visual Studio or MinGW on Windows, Xcode (the command-line tools are enough) on macOS or GCC on Linux)
|
|
||||||
|
|
||||||
if building under Windows or macOS, no additional dependencies are required.
|
if building under Windows or macOS, no additional dependencies are required.
|
||||||
otherwise, you may also need the following:
|
otherwise, you may also need the following:
|
||||||
|
@ -179,12 +137,9 @@ otherwise, you may also need the following:
|
||||||
- libx11
|
- libx11
|
||||||
- libasound
|
- libasound
|
||||||
- libGL
|
- libGL
|
||||||
- any other libraries which may be used by SDL
|
|
||||||
|
|
||||||
some Linux distributions (e.g. Ubuntu or openSUSE) will require you to install the `-dev` versions of these.
|
some Linux distributions (e.g. Ubuntu or openSUSE) will require you to install the `-dev` versions of these.
|
||||||
|
|
||||||
having libintl is recommended for locale support, but if it isn't present, Furnace will use its own implementation.
|
|
||||||
|
|
||||||
## getting the source
|
## getting the source
|
||||||
|
|
||||||
type the following on a terminal/console: (make sure Git is installed)
|
type the following on a terminal/console: (make sure Git is installed)
|
||||||
|
@ -210,32 +165,10 @@ from the developer tools command prompt:
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
```
|
|
||||||
|
|
||||||
then open the solution file in Visual Studio and build.
|
|
||||||
|
|
||||||
alternatively, do:
|
|
||||||
|
|
||||||
```
|
|
||||||
msbuild ALL_BUILD.vcxproj
|
msbuild ALL_BUILD.vcxproj
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows using MinGW
|
### macOS and Linux
|
||||||
|
|
||||||
setting up MinGW is a bit more complicated. two benefits are a faster, hotter Furnace, and Windows XP support.
|
|
||||||
|
|
||||||
however, one huge drawback is lack of backtrace support, so you'll have to use gdb when diagnosing a crash.
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -G "MinGW Makefiles" ..
|
|
||||||
mingw32-make
|
|
||||||
```
|
|
||||||
|
|
||||||
you may use "MSYS Makefiles" instead, depending on how you installed MinGW.
|
|
||||||
|
|
||||||
### macOS, Linux and other Unix/Unix-like
|
|
||||||
|
|
||||||
```
|
```
|
||||||
mkdir build
|
mkdir build
|
||||||
|
@ -243,16 +176,7 @@ cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
Alternatively, build scripts are provided in the `scripts/` folder in the root of the repository.
|
||||||
on macOS you may do the following instead:
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -G Xcode ..
|
|
||||||
```
|
|
||||||
|
|
||||||
...and then load the project on Xcode or type `xcodebuild`.
|
|
||||||
|
|
||||||
### CMake options
|
### CMake options
|
||||||
|
|
||||||
|
@ -264,52 +188,23 @@ Available options:
|
||||||
| Name | Default | Description |
|
| Name | Default | Description |
|
||||||
| :--: | :-----: | ----------- |
|
| :--: | :-----: | ----------- |
|
||||||
| `BUILD_GUI` | `ON` | Build the tracker (disable to build only a headless player) |
|
| `BUILD_GUI` | `ON` | Build the tracker (disable to build only a headless player) |
|
||||||
| `WITH_LOCALE` | `ON` | Enable language support |
|
|
||||||
| `USE_RTMIDI` | `ON` | Build with MIDI support using RtMidi |
|
| `USE_RTMIDI` | `ON` | Build with MIDI support using RtMidi |
|
||||||
| `USE_SDL2` | `ON` | Build with SDL2 (required to build with GUI) |
|
| `USE_SDL2` | `ON` | Build with SDL2 (required to build with GUI) |
|
||||||
| `USE_SNDFILE` | `ON` | Build with libsndfile (required in order to work with audio files) |
|
| `USE_SNDFILE` | `ON` | Build with libsndfile (required in order to work with audio files) |
|
||||||
| `USE_BACKWARD` | `ON` | Use backward-cpp to print a backtrace on crash/abort |
|
| `USE_BACKWARD` | `ON` | Use backward-cpp to print a backtrace on crash/abort |
|
||||||
| `USE_FREETYPE` | `OFF` | Build with FreeType support |
|
| `WITH_JACK` | `ON` if system-installed JACK detected, otherwise `OFF` | Whether to build with JACK support. Auto-detects if JACK is available |
|
||||||
| `USE_MOMO` | auto\*\*\* | Build a libintl implementation instead of using the system one |
|
|
||||||
| `WITH_JACK` | auto\* | Whether to build with JACK support. Auto-detects if JACK is available |
|
|
||||||
| `WITH_PORTAUDIO` | `ON` | Whether to build with PortAudio. |
|
|
||||||
| `SYSTEM_FFTW` | `OFF` | Use a system-installed version of FFTW instead of the vendored one |
|
| `SYSTEM_FFTW` | `OFF` | Use a system-installed version of FFTW instead of the vendored one |
|
||||||
| `SYSTEM_FMT` | `OFF` | Use a system-installed version of fmt instead of the vendored one |
|
| `SYSTEM_FMT` | `OFF` | Use a system-installed version of fmt instead of the vendored one |
|
||||||
| `SYSTEM_LIBSNDFILE` | `OFF` | Use a system-installed version of libsndfile instead of the vendored one |
|
| `SYSTEM_LIBSNDFILE` | `OFF` | Use a system-installed version of libsndfile instead of the vendored one |
|
||||||
| `SYSTEM_RTMIDI` | `OFF` | Use a system-installed version of RtMidi instead of the vendored one |
|
| `SYSTEM_RTMIDI` | `OFF` | Use a system-installed version of RtMidi instead of the vendored one |
|
||||||
| `SYSTEM_ZLIB` | `OFF` | Use a system-installed version of zlib instead of the vendored one |
|
| `SYSTEM_ZLIB` | `OFF` | Use a system-installed version of zlib instead of the vendored one |
|
||||||
| `SYSTEM_SDL2` | `OFF` | Use a system-installed version of SDL2 instead of the vendored one |
|
| `SYSTEM_SDL2` | `OFF` | Use a system-installed version of SDL2 instead of the vendored one |
|
||||||
| `SYSTEM_FREETYPE` | `OFF` | Use a system-installed version of FreeType instead of the vendored one |
|
| `WARNINGS_ARE_ERRORS` | `OFF` (but consider enabling this & reporting any errors that arise from it!) | Whether warnings in furnace's C++ code should be treated as errors |
|
||||||
| `SUPPORT_XP` | `OFF` | Build a Windows XP-compatible binary |
|
|
||||||
| `WARNINGS_ARE_ERRORS` | `OFF`\*\* | Whether warnings in furnace's C++ code should be treated as errors |
|
|
||||||
| `WITH_DEMOS` | `ON` | Install demo songs on `make install` |
|
| `WITH_DEMOS` | `ON` | Install demo songs on `make install` |
|
||||||
| `WITH_INSTRUMENTS` | `ON` | Install demo instruments on `make install` |
|
| `WITH_INSTRUMENTS` | `ON` | Install demo instruments on `make install` |
|
||||||
| `WITH_WAVETABLES` | `ON` | Install wavetables on `make install` |
|
|
||||||
| `SHOW_OPEN_ASSETS_MENU_ENTRY` | `OFF` | Show option to open built-in assets directory (on supported platforms) |
|
|
||||||
| `CONSOLE_SUBSYSTEM` | `OFF` | Build with subsystem set to Console on Windows |
|
|
||||||
| `FORCE_APPLE_BIN` | `OFF` | Enable installation of binaries (when doing `make install`) to PREFIX/bin on Apple platforms |
|
|
||||||
|
|
||||||
(\*) `ON` if system-installed JACK detected, otherwise `OFF`
|
|
||||||
|
|
||||||
(\*\*) but consider enabling this & reporting any errors that arise from it!
|
|
||||||
|
|
||||||
(\*\*\*) enabled by default if both libintl and setlocale aren't present (MSVC and Android), or on macOS
|
|
||||||
|
|
||||||
## CMake Error
|
|
||||||
|
|
||||||
if it says something about a missing subdirectory in `extern`, then either:
|
|
||||||
|
|
||||||
1. you didn't set up submodules, or
|
|
||||||
2. you downloaded the source as a .zip or .tar.gz. don't do this.
|
|
||||||
|
|
||||||
if 1, you may run `git submodule update --init --recursive`. this will initialize submodules.
|
|
||||||
|
|
||||||
if 2, clone this repo.
|
|
||||||
|
|
||||||
## console usage
|
## console usage
|
||||||
|
|
||||||
(note: if on Windows, type `furnace.exe` instead, or `Debug\furnace.exe` on MSVC)
|
|
||||||
|
|
||||||
```
|
```
|
||||||
./furnace
|
./furnace
|
||||||
```
|
```
|
||||||
|
@ -328,13 +223,69 @@ this will play a compatible file.
|
||||||
|
|
||||||
this will play a compatible file and enable the commands view.
|
this will play a compatible file and enable the commands view.
|
||||||
|
|
||||||
**note that console mode may not work correctly on Windows. you may have to quit using the Task Manager.**
|
**note that these commands only actually work in Linux environments. on other command lines, such as Windows' Command Prompt, or MacOS Terminal, it may not work correctly.**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
# frequently asked questions
|
||||||
|
|
||||||
|
> woah! 50 sound chips?! I can't believe it!
|
||||||
|
|
||||||
|
yup, it's real.
|
||||||
|
|
||||||
|
> where's the manual?
|
||||||
|
|
||||||
|
see [papers/](papers/doc/README.md). it's kind of incomplete, but at least the sound chips section is there.
|
||||||
|
|
||||||
|
> it doesn't open under macOS!
|
||||||
|
|
||||||
|
this is due to Apple's application signing policy. a workaround is to right click on the Furnace app icon and select Open.
|
||||||
|
|
||||||
|
**as of Monterey, this workaround no longer works (especially on ARM).** yeah, Apple has decided to be strict on the matter.
|
||||||
|
if you happen to be on that version, use this workaround instead (on a Terminal):
|
||||||
|
|
||||||
|
```
|
||||||
|
xattr -d com.apple.quarantine /path/to/Furnace.app
|
||||||
|
```
|
||||||
|
|
||||||
|
(replace /path/to/ with the path where Furnace.app is located)
|
||||||
|
|
||||||
|
you may need to log out and/or reboot after doing this.
|
||||||
|
|
||||||
|
> how do I use C64 absolute filter/duty?
|
||||||
|
|
||||||
|
on Instrument Editor in the C64 tab there are two options to toggle these.
|
||||||
|
also provided are two effects:
|
||||||
|
|
||||||
|
- `3xxx`: set fine duty.
|
||||||
|
- `4xxx`: set fine cutoff. `xxx` range is 000-7ff.
|
||||||
|
additionally, you can change the cutoff and/or duty as a macro inside an instrument by clicking the `absolute cutoff macro` and/or `absolute duty macro` checkbox at the bottom of the instrument. (for the filter, you also need to click the checkbox that says `volume macro is cutoff macro`.)
|
||||||
|
|
||||||
|
> how do I use PCM on a PCM-capable chip?
|
||||||
|
|
||||||
|
two possibilities:
|
||||||
|
- the recommended way is by creating the "Sample" type instrument and assigning a sample to it.
|
||||||
|
- otherwise you may employ the DefleMask-compatible method, using `17xx` effect.
|
||||||
|
|
||||||
|
> my .dmf song sounds very odd at a certain point
|
||||||
|
|
||||||
|
file a bug report. use the Issues page. it's probably another playback inaccuracy.
|
||||||
|
|
||||||
|
> my .dmf song sounds correct, but it doesn't in DefleMask
|
||||||
|
|
||||||
|
file a bug report **here**. it still is a playback inaccuracy.
|
||||||
|
|
||||||
|
> my song sounds terrible after saving as .dmf!
|
||||||
|
|
||||||
|
the DefleMask format has several limitations. save in Furnace song format instead (.fur).
|
||||||
|
|
||||||
|
> how do I solo channels?
|
||||||
|
|
||||||
|
right click on the channel name.
|
||||||
|
|
||||||
|
---
|
||||||
# footnotes
|
# footnotes
|
||||||
|
|
||||||
copyright (C) 2021-2024 tildearrow and contributors.
|
copyright (C) 2021-2022 tildearrow and contributors.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
@ -343,5 +294,4 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
|
||||||
Furnace is NOT affiliated with Delek or DefleMask in any form, regardless of its ability to load and save the .dmf, .dmp and .dmw file formats.
|
despite the fact this program works with the .dmf file format, it is NOT affiliated with Delek or DefleMask in any way, nor it is a replacement for the original program.
|
||||||
additionally, Furnace does not intend to replace DefleMask, nor any other program.
|
|
||||||
|
|
20
TODO.md
20
TODO.md
|
@ -1,13 +1,9 @@
|
||||||
# to-do for 0.6.8
|
# to-do for 0.6pre2
|
||||||
|
|
||||||
- OPL3 mute fix
|
- POKEY
|
||||||
|
- Pokémon Mini
|
||||||
# to-do long term
|
- (maybe) YM2612 CSM (no DualPCM)
|
||||||
|
- port presets to new format
|
||||||
- CSM macros
|
- bug fixes
|
||||||
- finish auto-clone
|
- (maybe) ExtCh FM macros?
|
||||||
- new pattern renderer - performance improvements
|
- (maybe) advanced linear arpeggio? (run arp+slide simultaneously)
|
||||||
- new info header
|
|
||||||
- unlimited channels and chips
|
|
||||||
- fix possible issues when moving selection
|
|
||||||
- fix Metal intro crash
|
|
||||||
|
|
|
@ -15,11 +15,11 @@ android {
|
||||||
}
|
}
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 219
|
versionCode 113
|
||||||
versionName "0.6.7"
|
versionName "dev113"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments "-DANDROID_APP_PLATFORM=android-21", "-DANDROID_STL=c++_static", "-DWARNINGS_ARE_ERRORS=ON", "-DWITH_LOCALE=ON", "-DUSE_MOMO=ON"
|
arguments "-DANDROID_APP_PLATFORM=android-21", "-DANDROID_STL=c++_static"
|
||||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
abiFilters 'arm64-v8a'
|
abiFilters 'arm64-v8a'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.tildearrow.furnace"
|
package="org.tildearrow.furnace"
|
||||||
android:versionCode="219"
|
android:versionCode="113"
|
||||||
android:versionName="0.6.7"
|
android:versionName="dev113"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|
||||||
<!-- OpenGL ES 2.0 -->
|
<!-- OpenGL ES 2.0 -->
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../../../../../po/locale
|
|
|
@ -186,7 +186,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
|
||||||
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
|
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
|
||||||
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
|
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
|
||||||
private BluetoothGatt connectGatt(boolean managed) {
|
private BluetoothGatt connectGatt(boolean managed) {
|
||||||
if (Build.VERSION.SDK_INT >= 23 /* Android 6.0 (M) */) {
|
if (Build.VERSION.SDK_INT >= 23) {
|
||||||
try {
|
try {
|
||||||
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
|
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -248,11 +248,7 @@ public class HIDDeviceManager {
|
||||||
0x1689, // Razer Onza
|
0x1689, // Razer Onza
|
||||||
0x1949, // Lab126, Inc.
|
0x1949, // Lab126, Inc.
|
||||||
0x1bad, // Harmonix
|
0x1bad, // Harmonix
|
||||||
0x20d6, // PowerA
|
|
||||||
0x24c6, // PowerA
|
0x24c6, // PowerA
|
||||||
0x2c22, // Qanba
|
|
||||||
0x2dc8, // 8BitDo
|
|
||||||
0x9886, // ASTRO Gaming
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
|
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
|
||||||
|
@ -273,16 +269,12 @@ public class HIDDeviceManager {
|
||||||
final int XB1_IFACE_SUBCLASS = 71;
|
final int XB1_IFACE_SUBCLASS = 71;
|
||||||
final int XB1_IFACE_PROTOCOL = 208;
|
final int XB1_IFACE_PROTOCOL = 208;
|
||||||
final int[] SUPPORTED_VENDORS = {
|
final int[] SUPPORTED_VENDORS = {
|
||||||
0x044f, // Thrustmaster
|
|
||||||
0x045e, // Microsoft
|
0x045e, // Microsoft
|
||||||
0x0738, // Mad Catz
|
0x0738, // Mad Catz
|
||||||
0x0e6f, // PDP
|
0x0e6f, // PDP
|
||||||
0x0f0d, // Hori
|
0x0f0d, // Hori
|
||||||
0x10f5, // Turtle Beach
|
|
||||||
0x1532, // Razer Wildcat
|
0x1532, // Razer Wildcat
|
||||||
0x20d6, // PowerA
|
|
||||||
0x24c6, // PowerA
|
0x24c6, // PowerA
|
||||||
0x2dc8, // 8BitDo
|
|
||||||
0x2e24, // Hyperkin
|
0x2e24, // Hyperkin
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -357,13 +349,13 @@ public class HIDDeviceManager {
|
||||||
private void initializeBluetooth() {
|
private void initializeBluetooth() {
|
||||||
Log.d(TAG, "Initializing Bluetooth");
|
Log.d(TAG, "Initializing Bluetooth");
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT <= 30 /* Android 11.0 (R) */ &&
|
if (Build.VERSION.SDK_INT <= 30 &&
|
||||||
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
|
||||||
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
|
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18 /* Android 4.3 (JELLY_BEAN_MR2) */)) {
|
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18)) {
|
||||||
Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
|
Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -577,7 +569,7 @@ public class HIDDeviceManager {
|
||||||
try {
|
try {
|
||||||
final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
|
final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
|
||||||
int flags;
|
int flags;
|
||||||
if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) {
|
if (Build.VERSION.SDK_INT >= 31) {
|
||||||
flags = FLAG_MUTABLE;
|
flags = FLAG_MUTABLE;
|
||||||
} else {
|
} else {
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
|
@ -52,7 +52,7 @@ class HIDDeviceUSB implements HIDDevice {
|
||||||
@Override
|
@Override
|
||||||
public String getSerialNumber() {
|
public String getSerialNumber() {
|
||||||
String result = null;
|
String result = null;
|
||||||
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
try {
|
try {
|
||||||
result = mDevice.getSerialNumber();
|
result = mDevice.getSerialNumber();
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ class HIDDeviceUSB implements HIDDevice {
|
||||||
@Override
|
@Override
|
||||||
public String getManufacturerName() {
|
public String getManufacturerName() {
|
||||||
String result = null;
|
String result = null;
|
||||||
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
result = mDevice.getManufacturerName();
|
result = mDevice.getManufacturerName();
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
|
@ -86,7 +86,7 @@ class HIDDeviceUSB implements HIDDevice {
|
||||||
@Override
|
@Override
|
||||||
public String getProductName() {
|
public String getProductName() {
|
||||||
String result = null;
|
String result = null;
|
||||||
if (Build.VERSION.SDK_INT >= 21 /* Android 5.0 (LOLLIPOP) */) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
result = mDevice.getProductName();
|
result = mDevice.getProductName();
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
|
|
|
@ -29,7 +29,6 @@ public class SDL {
|
||||||
|
|
||||||
// This function stores the current activity (SDL or not)
|
// This function stores the current activity (SDL or not)
|
||||||
public static void setContext(Context context) {
|
public static void setContext(Context context) {
|
||||||
SDLAudioManager.setContext(context);
|
|
||||||
mContext = context;
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,5 @@
|
||||||
package org.libsdl.app;
|
package org.libsdl.app;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.media.AudioDeviceCallback;
|
|
||||||
import android.media.AudioDeviceInfo;
|
|
||||||
import android.media.AudioFormat;
|
import android.media.AudioFormat;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.AudioRecord;
|
import android.media.AudioRecord;
|
||||||
|
@ -11,67 +8,34 @@ import android.media.MediaRecorder;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.Arrays;
|
public class SDLAudioManager
|
||||||
|
{
|
||||||
public class SDLAudioManager {
|
|
||||||
protected static final String TAG = "SDLAudio";
|
protected static final String TAG = "SDLAudio";
|
||||||
|
|
||||||
protected static AudioTrack mAudioTrack;
|
protected static AudioTrack mAudioTrack;
|
||||||
protected static AudioRecord mAudioRecord;
|
protected static AudioRecord mAudioRecord;
|
||||||
protected static Context mContext;
|
|
||||||
|
|
||||||
private static final int[] NO_DEVICES = {};
|
|
||||||
|
|
||||||
private static AudioDeviceCallback mAudioDeviceCallback;
|
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
mAudioTrack = null;
|
mAudioTrack = null;
|
||||||
mAudioRecord = null;
|
mAudioRecord = null;
|
||||||
mAudioDeviceCallback = null;
|
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */)
|
|
||||||
{
|
|
||||||
mAudioDeviceCallback = new AudioDeviceCallback() {
|
|
||||||
@Override
|
|
||||||
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
|
|
||||||
Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
|
|
||||||
Arrays.stream(removedDevices).forEach(deviceInfo -> removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setContext(Context context) {
|
|
||||||
mContext = context;
|
|
||||||
if (context != null) {
|
|
||||||
registerAudioDeviceCallback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void release(Context context) {
|
|
||||||
unregisterAudioDeviceCallback(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
|
|
||||||
protected static String getAudioFormatString(int audioFormat) {
|
protected static String getAudioFormatString(int audioFormat) {
|
||||||
switch (audioFormat) {
|
switch (audioFormat) {
|
||||||
case AudioFormat.ENCODING_PCM_8BIT:
|
case AudioFormat.ENCODING_PCM_8BIT:
|
||||||
return "8-bit";
|
return "8-bit";
|
||||||
case AudioFormat.ENCODING_PCM_16BIT:
|
case AudioFormat.ENCODING_PCM_16BIT:
|
||||||
return "16-bit";
|
return "16-bit";
|
||||||
case AudioFormat.ENCODING_PCM_FLOAT:
|
case AudioFormat.ENCODING_PCM_FLOAT:
|
||||||
return "float";
|
return "float";
|
||||||
default:
|
default:
|
||||||
return Integer.toString(audioFormat);
|
return Integer.toString(audioFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
||||||
int channelConfig;
|
int channelConfig;
|
||||||
int sampleSize;
|
int sampleSize;
|
||||||
int frameSize;
|
int frameSize;
|
||||||
|
@ -79,14 +43,14 @@ public class SDLAudioManager {
|
||||||
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");
|
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");
|
||||||
|
|
||||||
/* On older devices let's use known good settings */
|
/* On older devices let's use known good settings */
|
||||||
if (Build.VERSION.SDK_INT < 21 /* Android 5.0 (LOLLIPOP) */) {
|
if (Build.VERSION.SDK_INT < 21) {
|
||||||
if (desiredChannels > 2) {
|
if (desiredChannels > 2) {
|
||||||
desiredChannels = 2;
|
desiredChannels = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */
|
/* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */
|
||||||
if (Build.VERSION.SDK_INT < 22 /* Android 5.1 (LOLLIPOP_MR1) */) {
|
if (Build.VERSION.SDK_INT < 22) {
|
||||||
if (sampleRate < 8000) {
|
if (sampleRate < 8000) {
|
||||||
sampleRate = 8000;
|
sampleRate = 8000;
|
||||||
} else if (sampleRate > 48000) {
|
} else if (sampleRate > 48000) {
|
||||||
|
@ -95,7 +59,7 @@ public class SDLAudioManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
|
if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
|
||||||
int minSDKVersion = (isCapture ? 23 /* Android 6.0 (M) */ : 21 /* Android 5.0 (LOLLIPOP) */);
|
int minSDKVersion = (isCapture ? 23 : 21);
|
||||||
if (Build.VERSION.SDK_INT < minSDKVersion) {
|
if (Build.VERSION.SDK_INT < minSDKVersion) {
|
||||||
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
|
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +120,7 @@ public class SDLAudioManager {
|
||||||
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
|
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (Build.VERSION.SDK_INT >= 23 /* Android 6.0 (M) */) {
|
if (Build.VERSION.SDK_INT >= 23) {
|
||||||
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
|
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
|
||||||
} else {
|
} else {
|
||||||
Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");
|
Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");
|
||||||
|
@ -237,10 +201,6 @@ public class SDLAudioManager {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */ && deviceId != 0) {
|
|
||||||
mAudioRecord.setPreferredDevice(getOutputAudioDeviceInfo(deviceId));
|
|
||||||
}
|
|
||||||
|
|
||||||
mAudioRecord.startRecording();
|
mAudioRecord.startRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,10 +224,6 @@ public class SDLAudioManager {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */ && deviceId != 0) {
|
|
||||||
mAudioTrack.setPreferredDevice(getInputAudioDeviceInfo(deviceId));
|
|
||||||
}
|
|
||||||
|
|
||||||
mAudioTrack.play();
|
mAudioTrack.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,73 +238,11 @@ public class SDLAudioManager {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AudioDeviceInfo getInputAudioDeviceInfo(int deviceId) {
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
|
||||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS))
|
|
||||||
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
|
|
||||||
.findFirst()
|
|
||||||
.orElse(null);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static AudioDeviceInfo getOutputAudioDeviceInfo(int deviceId) {
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
|
||||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS))
|
|
||||||
.filter(deviceInfo -> deviceInfo.getId() == deviceId)
|
|
||||||
.findFirst()
|
|
||||||
.orElse(null);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void registerAudioDeviceCallback() {
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
|
||||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
audioManager.registerAudioDeviceCallback(mAudioDeviceCallback, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void unregisterAudioDeviceCallback(Context context) {
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
|
||||||
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
audioManager.unregisterAudioDeviceCallback(mAudioDeviceCallback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static int[] getAudioOutputDevices() {
|
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames);
|
||||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
|
|
||||||
} else {
|
|
||||||
return NO_DEVICES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called by SDL using JNI.
|
|
||||||
*/
|
|
||||||
public static int[] getAudioInputDevices() {
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
|
||||||
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
|
|
||||||
return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();
|
|
||||||
} else {
|
|
||||||
return NO_DEVICES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called by SDL using JNI.
|
|
||||||
*/
|
|
||||||
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
|
||||||
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -360,11 +254,6 @@ public class SDLAudioManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT < 21 /* Android 5.0 (LOLLIPOP) */) {
|
|
||||||
Log.e(TAG, "Attempted to make an incompatible audio call with uninitialized audio! (floating-point output is supported since Android 5.0 Lollipop)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < buffer.length;) {
|
for (int i = 0; i < buffer.length;) {
|
||||||
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
|
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
@ -437,22 +326,18 @@ public class SDLAudioManager {
|
||||||
/**
|
/**
|
||||||
* This method is called by SDL using JNI.
|
* This method is called by SDL using JNI.
|
||||||
*/
|
*/
|
||||||
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames, int deviceId) {
|
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
|
||||||
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames, deviceId);
|
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called by SDL using JNI. */
|
/** This method is called by SDL using JNI. */
|
||||||
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
|
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
|
||||||
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called by SDL using JNI. */
|
/** This method is called by SDL using JNI. */
|
||||||
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
|
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
|
||||||
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
if (Build.VERSION.SDK_INT < 23) {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length);
|
return mAudioRecord.read(buffer, 0, buffer.length);
|
||||||
} else {
|
} else {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||||
|
@ -461,7 +346,7 @@ public class SDLAudioManager {
|
||||||
|
|
||||||
/** This method is called by SDL using JNI. */
|
/** This method is called by SDL using JNI. */
|
||||||
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
|
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
|
||||||
if (Build.VERSION.SDK_INT < 23 /* Android 6.0 (M) */) {
|
if (Build.VERSION.SDK_INT < 23) {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length);
|
return mAudioRecord.read(buffer, 0, buffer.length);
|
||||||
} else {
|
} else {
|
||||||
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
|
||||||
|
@ -506,9 +391,4 @@ public class SDLAudioManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static native int nativeSetupJNI();
|
public static native int nativeSetupJNI();
|
||||||
|
|
||||||
public static native void removeAudioDevice(boolean isCapture, int deviceId);
|
|
||||||
|
|
||||||
public static native void addAudioDevice(boolean isCapture, int deviceId);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class SDLControllerManager
|
||||||
public static native int nativeAddJoystick(int device_id, String name, String desc,
|
public static native int nativeAddJoystick(int device_id, String name, String desc,
|
||||||
int vendor_id, int product_id,
|
int vendor_id, int product_id,
|
||||||
boolean is_accelerometer, int button_mask,
|
boolean is_accelerometer, int button_mask,
|
||||||
int naxes, int axis_mask, int nhats, int nballs);
|
int naxes, int nhats, int nballs);
|
||||||
public static native int nativeRemoveJoystick(int device_id);
|
public static native int nativeRemoveJoystick(int device_id);
|
||||||
public static native int nativeAddHaptic(int device_id, String name);
|
public static native int nativeAddHaptic(int device_id, String name);
|
||||||
public static native int nativeRemoveHaptic(int device_id);
|
public static native int nativeRemoveHaptic(int device_id);
|
||||||
|
@ -42,7 +42,7 @@ public class SDLControllerManager
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
if (mJoystickHandler == null) {
|
if (mJoystickHandler == null) {
|
||||||
if (Build.VERSION.SDK_INT >= 19 /* Android 4.4 (KITKAT) */) {
|
if (Build.VERSION.SDK_INT >= 19) {
|
||||||
mJoystickHandler = new SDLJoystickHandler_API19();
|
mJoystickHandler = new SDLJoystickHandler_API19();
|
||||||
} else {
|
} else {
|
||||||
mJoystickHandler = new SDLJoystickHandler_API16();
|
mJoystickHandler = new SDLJoystickHandler_API16();
|
||||||
|
@ -50,7 +50,7 @@ public class SDLControllerManager
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mHapticHandler == null) {
|
if (mHapticHandler == null) {
|
||||||
if (Build.VERSION.SDK_INT >= 26 /* Android 8.0 (O) */) {
|
if (Build.VERSION.SDK_INT >= 26) {
|
||||||
mHapticHandler = new SDLHapticHandler_API26();
|
mHapticHandler = new SDLHapticHandler_API26();
|
||||||
} else {
|
} else {
|
||||||
mHapticHandler = new SDLHapticHandler();
|
mHapticHandler = new SDLHapticHandler();
|
||||||
|
@ -168,32 +168,6 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
||||||
arg1Axis = MotionEvent.AXIS_GAS;
|
arg1Axis = MotionEvent.AXIS_GAS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the AXIS_Z is sorted between AXIS_RY and AXIS_RZ.
|
|
||||||
// This is because the usual pairing are:
|
|
||||||
// - AXIS_X + AXIS_Y (left stick).
|
|
||||||
// - AXIS_RX, AXIS_RY (sometimes the right stick, sometimes triggers).
|
|
||||||
// - AXIS_Z, AXIS_RZ (sometimes the right stick, sometimes triggers).
|
|
||||||
// This sorts the axes in the above order, which tends to be correct
|
|
||||||
// for Xbox-ish game pads that have the right stick on RX/RY and the
|
|
||||||
// triggers on Z/RZ.
|
|
||||||
//
|
|
||||||
// Gamepads that don't have AXIS_Z/AXIS_RZ but use
|
|
||||||
// AXIS_LTRIGGER/AXIS_RTRIGGER are unaffected by this.
|
|
||||||
//
|
|
||||||
// References:
|
|
||||||
// - https://developer.android.com/develop/ui/views/touch-and-input/game-controllers/controller-input
|
|
||||||
// - https://www.kernel.org/doc/html/latest/input/gamepad.html
|
|
||||||
if (arg0Axis == MotionEvent.AXIS_Z) {
|
|
||||||
arg0Axis = MotionEvent.AXIS_RZ - 1;
|
|
||||||
} else if (arg0Axis > MotionEvent.AXIS_Z && arg0Axis < MotionEvent.AXIS_RZ) {
|
|
||||||
--arg0Axis;
|
|
||||||
}
|
|
||||||
if (arg1Axis == MotionEvent.AXIS_Z) {
|
|
||||||
arg1Axis = MotionEvent.AXIS_RZ - 1;
|
|
||||||
} else if (arg1Axis > MotionEvent.AXIS_Z && arg1Axis < MotionEvent.AXIS_RZ) {
|
|
||||||
--arg1Axis;
|
|
||||||
}
|
|
||||||
|
|
||||||
return arg0Axis - arg1Axis;
|
return arg0Axis - arg1Axis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,7 +210,7 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
||||||
mJoysticks.add(joystick);
|
mJoysticks.add(joystick);
|
||||||
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
|
SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,
|
||||||
getVendorId(joystickDevice), getProductId(joystickDevice), false,
|
getVendorId(joystickDevice), getProductId(joystickDevice), false,
|
||||||
getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, 0);
|
getButtonMask(joystickDevice), joystick.axes.size(), joystick.hats.size()/2, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,21 +255,23 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleMotionEvent(MotionEvent event) {
|
public boolean handleMotionEvent(MotionEvent event) {
|
||||||
int actionPointerIndex = event.getActionIndex();
|
if ((event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
|
||||||
int action = event.getActionMasked();
|
int actionPointerIndex = event.getActionIndex();
|
||||||
if (action == MotionEvent.ACTION_MOVE) {
|
int action = event.getActionMasked();
|
||||||
SDLJoystick joystick = getJoystick(event.getDeviceId());
|
if (action == MotionEvent.ACTION_MOVE) {
|
||||||
if (joystick != null) {
|
SDLJoystick joystick = getJoystick(event.getDeviceId());
|
||||||
for (int i = 0; i < joystick.axes.size(); i++) {
|
if (joystick != null) {
|
||||||
InputDevice.MotionRange range = joystick.axes.get(i);
|
for (int i = 0; i < joystick.axes.size(); i++) {
|
||||||
/* Normalize the value to -1...1 */
|
InputDevice.MotionRange range = joystick.axes.get(i);
|
||||||
float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
|
/* Normalize the value to -1...1 */
|
||||||
SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
|
float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
|
||||||
}
|
SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
|
||||||
for (int i = 0; i < joystick.hats.size() / 2; i++) {
|
}
|
||||||
int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
|
for (int i = 0; i < joystick.hats.size() / 2; i++) {
|
||||||
int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
|
int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
|
||||||
SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
|
int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
|
||||||
|
SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -317,9 +293,6 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
||||||
public int getVendorId(InputDevice joystickDevice) {
|
public int getVendorId(InputDevice joystickDevice) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
public int getButtonMask(InputDevice joystickDevice) {
|
public int getButtonMask(InputDevice joystickDevice) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -337,43 +310,6 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
|
||||||
return joystickDevice.getVendorId();
|
return joystickDevice.getVendorId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getAxisMask(List<InputDevice.MotionRange> ranges) {
|
|
||||||
// For compatibility, keep computing the axis mask like before,
|
|
||||||
// only really distinguishing 2, 4 and 6 axes.
|
|
||||||
int axis_mask = 0;
|
|
||||||
if (ranges.size() >= 2) {
|
|
||||||
// ((1 << SDL_GAMEPAD_AXIS_LEFTX) | (1 << SDL_GAMEPAD_AXIS_LEFTY))
|
|
||||||
axis_mask |= 0x0003;
|
|
||||||
}
|
|
||||||
if (ranges.size() >= 4) {
|
|
||||||
// ((1 << SDL_GAMEPAD_AXIS_RIGHTX) | (1 << SDL_GAMEPAD_AXIS_RIGHTY))
|
|
||||||
axis_mask |= 0x000c;
|
|
||||||
}
|
|
||||||
if (ranges.size() >= 6) {
|
|
||||||
// ((1 << SDL_GAMEPAD_AXIS_LEFT_TRIGGER) | (1 << SDL_GAMEPAD_AXIS_RIGHT_TRIGGER))
|
|
||||||
axis_mask |= 0x0030;
|
|
||||||
}
|
|
||||||
// Also add an indicator bit for whether the sorting order has changed.
|
|
||||||
// This serves to disable outdated gamecontrollerdb.txt mappings.
|
|
||||||
boolean have_z = false;
|
|
||||||
boolean have_past_z_before_rz = false;
|
|
||||||
for (InputDevice.MotionRange range : ranges) {
|
|
||||||
int axis = range.getAxis();
|
|
||||||
if (axis == MotionEvent.AXIS_Z) {
|
|
||||||
have_z = true;
|
|
||||||
} else if (axis > MotionEvent.AXIS_Z && axis < MotionEvent.AXIS_RZ) {
|
|
||||||
have_past_z_before_rz = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (have_z && have_past_z_before_rz) {
|
|
||||||
// If both these exist, the compare() function changed sorting order.
|
|
||||||
// Set a bit to indicate this fact.
|
|
||||||
axis_mask |= 0x8000;
|
|
||||||
}
|
|
||||||
return axis_mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getButtonMask(InputDevice joystickDevice) {
|
public int getButtonMask(InputDevice joystickDevice) {
|
||||||
int button_mask = 0;
|
int button_mask = 0;
|
||||||
|
@ -626,6 +562,8 @@ class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
|
||||||
|
|
||||||
switch ( event.getSource() ) {
|
switch ( event.getSource() ) {
|
||||||
case InputDevice.SOURCE_JOYSTICK:
|
case InputDevice.SOURCE_JOYSTICK:
|
||||||
|
case InputDevice.SOURCE_GAMEPAD:
|
||||||
|
case InputDevice.SOURCE_DPAD:
|
||||||
return SDLControllerManager.handleJoystickMotionEvent(event);
|
return SDLControllerManager.handleJoystickMotionEvent(event);
|
||||||
|
|
||||||
case InputDevice.SOURCE_MOUSE:
|
case InputDevice.SOURCE_MOUSE:
|
||||||
|
@ -755,6 +693,8 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
||||||
|
|
||||||
switch ( event.getSource() ) {
|
switch ( event.getSource() ) {
|
||||||
case InputDevice.SOURCE_JOYSTICK:
|
case InputDevice.SOURCE_JOYSTICK:
|
||||||
|
case InputDevice.SOURCE_GAMEPAD:
|
||||||
|
case InputDevice.SOURCE_DPAD:
|
||||||
return SDLControllerManager.handleJoystickMotionEvent(event);
|
return SDLControllerManager.handleJoystickMotionEvent(event);
|
||||||
|
|
||||||
case InputDevice.SOURCE_MOUSE:
|
case InputDevice.SOURCE_MOUSE:
|
||||||
|
@ -809,7 +749,7 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsRelativeMouse() {
|
public boolean supportsRelativeMouse() {
|
||||||
return (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */);
|
return (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -819,7 +759,7 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setRelativeMouseEnabled(boolean enabled) {
|
public boolean setRelativeMouseEnabled(boolean enabled) {
|
||||||
if (!SDLActivity.isDeXMode() || Build.VERSION.SDK_INT >= 27 /* Android 8.1 (O_MR1) */) {
|
if (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27)) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
SDLActivity.getContentView().requestPointerCapture();
|
SDLActivity.getContentView().requestPointerCapture();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,405 +0,0 @@
|
||||||
package org.libsdl.app;
|
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.pm.ActivityInfo;
|
|
||||||
import android.hardware.Sensor;
|
|
||||||
import android.hardware.SensorEvent;
|
|
||||||
import android.hardware.SensorEventListener;
|
|
||||||
import android.hardware.SensorManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.Display;
|
|
||||||
import android.view.InputDevice;
|
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.Surface;
|
|
||||||
import android.view.SurfaceHolder;
|
|
||||||
import android.view.SurfaceView;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
SDLSurface. This is what we draw on, so we need to know when it's created
|
|
||||||
in order to do anything useful.
|
|
||||||
|
|
||||||
Because of this, that's where we set up the SDL thread
|
|
||||||
*/
|
|
||||||
public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|
||||||
View.OnKeyListener, View.OnTouchListener, SensorEventListener {
|
|
||||||
|
|
||||||
// Sensors
|
|
||||||
protected SensorManager mSensorManager;
|
|
||||||
protected Display mDisplay;
|
|
||||||
|
|
||||||
// Keep track of the surface size to normalize touch events
|
|
||||||
protected float mWidth, mHeight;
|
|
||||||
|
|
||||||
// Is SurfaceView ready for rendering
|
|
||||||
public boolean mIsSurfaceReady;
|
|
||||||
|
|
||||||
// Startup
|
|
||||||
public SDLSurface(Context context) {
|
|
||||||
super(context);
|
|
||||||
getHolder().addCallback(this);
|
|
||||||
|
|
||||||
setFocusable(true);
|
|
||||||
setFocusableInTouchMode(true);
|
|
||||||
requestFocus();
|
|
||||||
setOnKeyListener(this);
|
|
||||||
setOnTouchListener(this);
|
|
||||||
|
|
||||||
mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
|
||||||
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
|
|
||||||
|
|
||||||
setOnGenericMotionListener(SDLActivity.getMotionListener());
|
|
||||||
|
|
||||||
// Some arbitrary defaults to avoid a potential division by zero
|
|
||||||
mWidth = 1.0f;
|
|
||||||
mHeight = 1.0f;
|
|
||||||
|
|
||||||
mIsSurfaceReady = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handlePause() {
|
|
||||||
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleResume() {
|
|
||||||
setFocusable(true);
|
|
||||||
setFocusableInTouchMode(true);
|
|
||||||
requestFocus();
|
|
||||||
setOnKeyListener(this);
|
|
||||||
setOnTouchListener(this);
|
|
||||||
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Surface getNativeSurface() {
|
|
||||||
return getHolder().getSurface();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when we have a valid drawing surface
|
|
||||||
@Override
|
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
|
||||||
Log.v("SDL", "surfaceCreated()");
|
|
||||||
SDLActivity.onNativeSurfaceCreated();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when we lose the surface
|
|
||||||
@Override
|
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
|
||||||
Log.v("SDL", "surfaceDestroyed()");
|
|
||||||
|
|
||||||
// Transition to pause, if needed
|
|
||||||
SDLActivity.mNextNativeState = SDLActivity.NativeState.PAUSED;
|
|
||||||
SDLActivity.handleNativeState();
|
|
||||||
|
|
||||||
mIsSurfaceReady = false;
|
|
||||||
SDLActivity.onNativeSurfaceDestroyed();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the surface is resized
|
|
||||||
@Override
|
|
||||||
public void surfaceChanged(SurfaceHolder holder,
|
|
||||||
int format, int width, int height) {
|
|
||||||
Log.v("SDL", "surfaceChanged()");
|
|
||||||
|
|
||||||
if (SDLActivity.mSingleton == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mWidth = width;
|
|
||||||
mHeight = height;
|
|
||||||
int nDeviceWidth = width;
|
|
||||||
int nDeviceHeight = height;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (Build.VERSION.SDK_INT >= 17 /* Android 4.2 (JELLY_BEAN_MR1) */) {
|
|
||||||
DisplayMetrics realMetrics = new DisplayMetrics();
|
|
||||||
mDisplay.getRealMetrics( realMetrics );
|
|
||||||
nDeviceWidth = realMetrics.widthPixels;
|
|
||||||
nDeviceHeight = realMetrics.heightPixels;
|
|
||||||
}
|
|
||||||
} catch(Exception ignored) {
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized(SDLActivity.getContext()) {
|
|
||||||
// In case we're waiting on a size change after going fullscreen, send a notification.
|
|
||||||
SDLActivity.getContext().notifyAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.v("SDL", "Window size: " + width + "x" + height);
|
|
||||||
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
|
|
||||||
SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, mDisplay.getRefreshRate());
|
|
||||||
SDLActivity.onNativeResize();
|
|
||||||
|
|
||||||
// Prevent a screen distortion glitch,
|
|
||||||
// for instance when the device is in Landscape and a Portrait App is resumed.
|
|
||||||
boolean skip = false;
|
|
||||||
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
|
||||||
|
|
||||||
if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) {
|
|
||||||
if (mWidth > mHeight) {
|
|
||||||
skip = true;
|
|
||||||
}
|
|
||||||
} else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {
|
|
||||||
if (mWidth < mHeight) {
|
|
||||||
skip = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Special Patch for Square Resolution: Black Berry Passport
|
|
||||||
if (skip) {
|
|
||||||
double min = Math.min(mWidth, mHeight);
|
|
||||||
double max = Math.max(mWidth, mHeight);
|
|
||||||
|
|
||||||
if (max / min < 1.20) {
|
|
||||||
Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution.");
|
|
||||||
skip = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't skip in MultiWindow.
|
|
||||||
if (skip) {
|
|
||||||
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
|
|
||||||
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
|
|
||||||
Log.v("SDL", "Don't skip in Multi-Window");
|
|
||||||
skip = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (skip) {
|
|
||||||
Log.v("SDL", "Skip .. Surface is not ready.");
|
|
||||||
mIsSurfaceReady = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
|
|
||||||
SDLActivity.onNativeSurfaceChanged();
|
|
||||||
|
|
||||||
/* Surface is ready */
|
|
||||||
mIsSurfaceReady = true;
|
|
||||||
|
|
||||||
SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;
|
|
||||||
SDLActivity.handleNativeState();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Key events
|
|
||||||
@Override
|
|
||||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
|
||||||
return SDLActivity.handleKeyEvent(v, keyCode, event, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Touch events
|
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
|
||||||
/* Ref: http://developer.android.com/training/gestures/multi.html */
|
|
||||||
int touchDevId = event.getDeviceId();
|
|
||||||
final int pointerCount = event.getPointerCount();
|
|
||||||
int action = event.getActionMasked();
|
|
||||||
int pointerFingerId;
|
|
||||||
int i = -1;
|
|
||||||
float x,y,p;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Prevent id to be -1, since it's used in SDL internal for synthetic events
|
|
||||||
* Appears when using Android emulator, eg:
|
|
||||||
* adb shell input mouse tap 100 100
|
|
||||||
* adb shell input touchscreen tap 100 100
|
|
||||||
*/
|
|
||||||
if (touchDevId < 0) {
|
|
||||||
touchDevId -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 12290 = Samsung DeX mode desktop mouse
|
|
||||||
// 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
|
|
||||||
// 0x2 = SOURCE_CLASS_POINTER
|
|
||||||
if (event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN)) {
|
|
||||||
int mouseButton = 1;
|
|
||||||
try {
|
|
||||||
Object object = event.getClass().getMethod("getButtonState").invoke(event);
|
|
||||||
if (object != null) {
|
|
||||||
mouseButton = (Integer) object;
|
|
||||||
}
|
|
||||||
} catch(Exception ignored) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
|
|
||||||
// if we are. We'll leverage our existing mouse motion listener
|
|
||||||
SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();
|
|
||||||
x = motionListener.getEventX(event);
|
|
||||||
y = motionListener.getEventY(event);
|
|
||||||
|
|
||||||
SDLActivity.onNativeMouse(mouseButton, action, x, y, motionListener.inRelativeMode());
|
|
||||||
} else {
|
|
||||||
switch(action) {
|
|
||||||
case MotionEvent.ACTION_MOVE:
|
|
||||||
for (i = 0; i < pointerCount; i++) {
|
|
||||||
pointerFingerId = event.getPointerId(i);
|
|
||||||
x = event.getX(i) / mWidth;
|
|
||||||
y = event.getY(i) / mHeight;
|
|
||||||
p = event.getPressure(i);
|
|
||||||
if (p > 1.0f) {
|
|
||||||
// may be larger than 1.0f on some devices
|
|
||||||
// see the documentation of getPressure(i)
|
|
||||||
p = 1.0f;
|
|
||||||
}
|
|
||||||
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MotionEvent.ACTION_UP:
|
|
||||||
case MotionEvent.ACTION_DOWN:
|
|
||||||
// Primary pointer up/down, the index is always zero
|
|
||||||
i = 0;
|
|
||||||
/* fallthrough */
|
|
||||||
case MotionEvent.ACTION_POINTER_UP:
|
|
||||||
case MotionEvent.ACTION_POINTER_DOWN:
|
|
||||||
// Non primary pointer up/down
|
|
||||||
if (i == -1) {
|
|
||||||
i = event.getActionIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
pointerFingerId = event.getPointerId(i);
|
|
||||||
x = event.getX(i) / mWidth;
|
|
||||||
y = event.getY(i) / mHeight;
|
|
||||||
p = event.getPressure(i);
|
|
||||||
if (p > 1.0f) {
|
|
||||||
// may be larger than 1.0f on some devices
|
|
||||||
// see the documentation of getPressure(i)
|
|
||||||
p = 1.0f;
|
|
||||||
}
|
|
||||||
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MotionEvent.ACTION_CANCEL:
|
|
||||||
for (i = 0; i < pointerCount; i++) {
|
|
||||||
pointerFingerId = event.getPointerId(i);
|
|
||||||
x = event.getX(i) / mWidth;
|
|
||||||
y = event.getY(i) / mHeight;
|
|
||||||
p = event.getPressure(i);
|
|
||||||
if (p > 1.0f) {
|
|
||||||
// may be larger than 1.0f on some devices
|
|
||||||
// see the documentation of getPressure(i)
|
|
||||||
p = 1.0f;
|
|
||||||
}
|
|
||||||
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sensor events
|
|
||||||
public void enableSensor(int sensortype, boolean enabled) {
|
|
||||||
// TODO: This uses getDefaultSensor - what if we have >1 accels?
|
|
||||||
if (enabled) {
|
|
||||||
mSensorManager.registerListener(this,
|
|
||||||
mSensorManager.getDefaultSensor(sensortype),
|
|
||||||
SensorManager.SENSOR_DELAY_GAME, null);
|
|
||||||
} else {
|
|
||||||
mSensorManager.unregisterListener(this,
|
|
||||||
mSensorManager.getDefaultSensor(sensortype));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSensorChanged(SensorEvent event) {
|
|
||||||
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
|
|
||||||
|
|
||||||
// Since we may have an orientation set, we won't receive onConfigurationChanged events.
|
|
||||||
// We thus should check here.
|
|
||||||
int newOrientation;
|
|
||||||
|
|
||||||
float x, y;
|
|
||||||
switch (mDisplay.getRotation()) {
|
|
||||||
case Surface.ROTATION_90:
|
|
||||||
x = -event.values[1];
|
|
||||||
y = event.values[0];
|
|
||||||
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE;
|
|
||||||
break;
|
|
||||||
case Surface.ROTATION_270:
|
|
||||||
x = event.values[1];
|
|
||||||
y = -event.values[0];
|
|
||||||
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;
|
|
||||||
break;
|
|
||||||
case Surface.ROTATION_180:
|
|
||||||
x = -event.values[0];
|
|
||||||
y = -event.values[1];
|
|
||||||
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;
|
|
||||||
break;
|
|
||||||
case Surface.ROTATION_0:
|
|
||||||
default:
|
|
||||||
x = event.values[0];
|
|
||||||
y = event.values[1];
|
|
||||||
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newOrientation != SDLActivity.mCurrentOrientation) {
|
|
||||||
SDLActivity.mCurrentOrientation = newOrientation;
|
|
||||||
SDLActivity.onNativeOrientationChanged(newOrientation);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
|
|
||||||
y / SensorManager.GRAVITY_EARTH,
|
|
||||||
event.values[2] / SensorManager.GRAVITY_EARTH);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Captured pointer events for API 26.
|
|
||||||
public boolean onCapturedPointerEvent(MotionEvent event)
|
|
||||||
{
|
|
||||||
int action = event.getActionMasked();
|
|
||||||
|
|
||||||
float x, y;
|
|
||||||
switch (action) {
|
|
||||||
case MotionEvent.ACTION_SCROLL:
|
|
||||||
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
|
|
||||||
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
|
|
||||||
SDLActivity.onNativeMouse(0, action, x, y, false);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case MotionEvent.ACTION_HOVER_MOVE:
|
|
||||||
case MotionEvent.ACTION_MOVE:
|
|
||||||
x = event.getX(0);
|
|
||||||
y = event.getY(0);
|
|
||||||
SDLActivity.onNativeMouse(0, action, x, y, true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case MotionEvent.ACTION_BUTTON_PRESS:
|
|
||||||
case MotionEvent.ACTION_BUTTON_RELEASE:
|
|
||||||
|
|
||||||
// Change our action value to what SDL's code expects.
|
|
||||||
if (action == MotionEvent.ACTION_BUTTON_PRESS) {
|
|
||||||
action = MotionEvent.ACTION_DOWN;
|
|
||||||
} else { /* MotionEvent.ACTION_BUTTON_RELEASE */
|
|
||||||
action = MotionEvent.ACTION_UP;
|
|
||||||
}
|
|
||||||
|
|
||||||
x = event.getX(0);
|
|
||||||
y = event.getY(0);
|
|
||||||
int button = event.getButtonState();
|
|
||||||
|
|
||||||
SDLActivity.onNativeMouse(button, action, x, y, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +1,25 @@
|
||||||
package org.tildearrow.furnace;
|
package org.tildearrow.furnace;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import org.libsdl.app.SDLActivity;
|
import org.libsdl.app.SDLActivity;
|
||||||
|
|
||||||
public class MainActivity extends SDLActivity {
|
public class MainActivity extends SDLActivity {
|
||||||
static final int TA_FILE_REQUEST=1000;
|
static final int TA_FILE_REQUEST=1000;
|
||||||
static final int TA_FILE_SAVE_REQUEST=1001;
|
|
||||||
|
|
||||||
public void showFileDialog() {
|
public boolean showFileDialog() {
|
||||||
Intent picker=new Intent(Intent.ACTION_GET_CONTENT);
|
Intent picker=new Intent(Intent.ACTION_GET_CONTENT);
|
||||||
picker.setType("*/*");
|
picker.setType("*/*");
|
||||||
picker=Intent.createChooser(picker,"test");
|
picker=Intent.createChooser(picker,"test");
|
||||||
startActivityForResult(picker,TA_FILE_REQUEST);
|
startActivityForResult(picker,TA_FILE_REQUEST);
|
||||||
}
|
|
||||||
|
|
||||||
public void showSaveFileDialog() {
|
return true;
|
||||||
Intent picker=new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
|
||||||
picker.addCategory(Intent.CATEGORY_OPENABLE);
|
|
||||||
picker.setType("*/*");
|
|
||||||
|
|
||||||
startActivityForResult(picker,TA_FILE_SAVE_REQUEST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected void onActivityResult(int request, int result, Intent intent) {
|
@Override protected void onActivityResult(int request, int result, Intent intent) {
|
||||||
super.onActivityResult(request,result,intent);
|
super.onActivityResult(request,result,intent);
|
||||||
if (request==TA_FILE_REQUEST) {
|
if (request==TA_FILE_REQUEST) {
|
||||||
if (result==RESULT_OK) {
|
// TODO: fire an event here
|
||||||
Uri path=intent.getData();
|
|
||||||
|
|
||||||
Context context=getApplicationContext();
|
|
||||||
Toast toast=Toast.makeText(context,path.toString(),Toast.LENGTH_SHORT);
|
|
||||||
toast.show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
demos/Another_winter.fur
Normal file
BIN
demos/Another_winter.fur
Normal file
Binary file not shown.
BIN
demos/BONUS. Sonic 2 Boss.fur
Normal file
BIN
demos/BONUS. Sonic 2 Boss.fur
Normal file
Binary file not shown.
BIN
demos/C64 junk.fur
Normal file
BIN
demos/C64 junk.fur
Normal file
Binary file not shown.
BIN
demos/Cafe - 010 Editor 2.0crk.fur
Normal file
BIN
demos/Cafe - 010 Editor 2.0crk.fur
Normal file
Binary file not shown.
BIN
demos/Carnage.fur
Normal file
BIN
demos/Carnage.fur
Normal file
Binary file not shown.
BIN
demos/Checknobankh.fur
Normal file
BIN
demos/Checknobankh.fur
Normal file
Binary file not shown.
BIN
demos/Coconut_Mall.fur
Normal file
BIN
demos/Coconut_Mall.fur
Normal file
Binary file not shown.
BIN
demos/ComicPartytrack20.fur
Normal file
BIN
demos/ComicPartytrack20.fur
Normal file
Binary file not shown.
BIN
demos/CorridorsOfTimeRMX.fur
Normal file
BIN
demos/CorridorsOfTimeRMX.fur
Normal file
Binary file not shown.
BIN
demos/Eternal_Forest_Taito_Arcade.fur
Normal file
BIN
demos/Eternal_Forest_Taito_Arcade.fur
Normal file
Binary file not shown.
BIN
demos/FDS TEST.fur
Normal file
BIN
demos/FDS TEST.fur
Normal file
Binary file not shown.
BIN
demos/Funky_Bubbles_OPL3.fur
Normal file
BIN
demos/Funky_Bubbles_OPL3.fur
Normal file
Binary file not shown.
BIN
demos/GranularFurn.fur
Normal file
BIN
demos/GranularFurn.fur
Normal file
Binary file not shown.
BIN
demos/HoldOn.fur
Normal file
BIN
demos/HoldOn.fur
Normal file
Binary file not shown.
BIN
demos/Jet_Pack_Adventure_GBAesque.fur
Normal file
BIN
demos/Jet_Pack_Adventure_GBAesque.fur
Normal file
Binary file not shown.
BIN
demos/Lagrange_Point.fur
Normal file
BIN
demos/Lagrange_Point.fur
Normal file
Binary file not shown.
BIN
demos/L’ambreSong.fur
Normal file
BIN
demos/L’ambreSong.fur
Normal file
Binary file not shown.
BIN
demos/MMXStageClear.fur
Normal file
BIN
demos/MMXStageClear.fur
Normal file
Binary file not shown.
BIN
demos/Neo_Seaside_Volley_Court.fur
Normal file
BIN
demos/Neo_Seaside_Volley_Court.fur
Normal file
Binary file not shown.
|
@ -6,13 +6,10 @@ these demo songs are not under the GPL. all rights are reserved to the original
|
||||||
|
|
||||||
# submit demo songs!
|
# submit demo songs!
|
||||||
|
|
||||||
contact me or send a pull request if you want your song to be added to this collection. be noted we have three rules:
|
contact me or send a pull request if you want your song to be added to this collection. be noted we have two rules:
|
||||||
|
|
||||||
- Nintendo covers are frowned upon
|
- Nintendo covers are frowned upon
|
||||||
- big label music covers also are discouraged
|
- big label music covers also are discouraged
|
||||||
- low effort compositions/covers may not be accepted at all.
|
|
||||||
|
|
||||||
make sure to put your demo song under the respective category.
|
|
||||||
|
|
||||||
tildearrow also accepts demo songs in the .dmf format as well as the .fur format.
|
tildearrow also accepts demo songs in the .dmf format as well as the .fur format.
|
||||||
|
|
||||||
|
|
BIN
demos/Rise_against_the_ashes_to_the_new_dawn.fur
Normal file
BIN
demos/Rise_against_the_ashes_to_the_new_dawn.fur
Normal file
Binary file not shown.
BIN
demos/Silver Surfer - Stage Music 1.fur
Normal file
BIN
demos/Silver Surfer - Stage Music 1.fur
Normal file
Binary file not shown.
BIN
demos/Solar_Man_Genesis.fur
Normal file
BIN
demos/Solar_Man_Genesis.fur
Normal file
Binary file not shown.
BIN
demos/Stereotactics_Rewritten.fur
Normal file
BIN
demos/Stereotactics_Rewritten.fur
Normal file
Binary file not shown.
BIN
demos/Tubelectric_Fictional_Arcade.fur
Normal file
BIN
demos/Tubelectric_Fictional_Arcade.fur
Normal file
Binary file not shown.
BIN
demos/UT99_Run_Taito_Arcade.fur
Normal file
BIN
demos/UT99_Run_Taito_Arcade.fur
Normal file
Binary file not shown.
BIN
demos/Utter Determination YM2610B.fur
Normal file
BIN
demos/Utter Determination YM2610B.fur
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue