├── NEWS ├── VERSION ├── VERSION-RELEASE ├── scripts ├── debian │ ├── compat │ ├── source │ │ └── format │ ├── changelog.in │ ├── rules │ └── control ├── ubignorelist.txt ├── crossbuild │ ├── emscripten.sh │ ├── aros.sh │ ├── morphos.sh │ ├── redox.sh │ ├── riscos.sh │ ├── serenity.sh │ ├── wip │ │ ├── dos.sh │ │ ├── vxworks.sh │ │ ├── psp.sh │ │ ├── ps3.sh │ │ ├── psvita.sh │ │ ├── symbian.sh │ │ ├── switch.sh │ │ ├── ps2.sh │ │ ├── xbox.sh │ │ ├── dreamcast.sh │ │ ├── wasix.sh │ │ ├── xbox360.sh │ │ ├── nds.sh │ │ ├── 3ds.sh │ │ └── wiiu.sh │ ├── amigaos4.sh │ ├── qnx800.sh │ ├── qnx710.sh │ ├── warpos.sh │ ├── fuchsia.sh │ ├── freemint.sh │ ├── webos.sh │ ├── irix.sh │ ├── tizen.sh │ ├── cosmocc.sh │ ├── ios.sh │ ├── amigaos.sh │ ├── openharmony.sh │ ├── ps4.sh │ ├── sailfish.sh │ ├── android.sh │ └── blackberry10.sh ├── release.sh ├── make_deb.sh ├── default.nix ├── PKGBUILD ├── make_rpm.sh ├── audacious-uade.spec └── sanitize.sh ├── src ├── test │ ├── .gitignore │ ├── converter │ │ └── test_converter.sh │ ├── songend │ │ └── test_songend.sh │ ├── precalc │ │ ├── test_precalc1.sh │ │ ├── test_precalc6.sh │ │ ├── test_precalc13.sh │ │ ├── test_precalc8.sh │ │ ├── test_precalc12.sh │ │ ├── test_precalc3.sh │ │ ├── test_precalc2.sh │ │ ├── test_precalc10.sh │ │ ├── test_precalc4.sh │ │ ├── test_precalc9.sh │ │ ├── test_precalc5.sh │ │ ├── test_precalc11.sh │ │ └── test_precalc7.sh │ ├── songdb │ │ ├── test_songdb2.sh │ │ ├── test_songdb3.sh │ │ └── test_songdb1.sh │ ├── player │ │ ├── test_player_st23play_1.sh │ │ ├── test_player_ft2play_2.sh │ │ ├── test_player_uade_4.sh │ │ ├── test_player_st3play_2.sh │ │ ├── test_player_uade_5.sh │ │ ├── test_player_ft2play_1.sh │ │ ├── test_player_ft2play_3.sh │ │ ├── test_player_st3play_1.sh │ │ ├── test_player_libdigibooster3_1.sh │ │ ├── test_player_uade_2.sh │ │ ├── test_player_uade_3.sh │ │ ├── test_player_libdigibooster3_2.sh │ │ ├── test_player_libxmp_1.sh │ │ ├── test_player_it2play_8.sh │ │ ├── test_player_it2play_7.sh │ │ ├── test_player_libopenmpt_1.sh │ │ ├── test_player_protrekkr2_1.sh │ │ ├── test_player_protrekkr1_1.sh │ │ ├── test_player_it2play_2.sh │ │ ├── test_player_noisetrekker2_1.sh │ │ ├── test_player_it2play_4.sh │ │ ├── test_player_it2play_5.sh │ │ ├── test_player_hivelytracker_1.sh │ │ ├── test_player_it2play_6.sh │ │ ├── test_player_it2play_3.sh │ │ ├── test_player_it2play_9.sh │ │ ├── test_player_it2play_1.sh │ │ ├── test_player_uade_1.sh │ │ ├── test_player_libxmp_2.sh │ │ └── test_player_libopenmpt_2.sh │ ├── common │ │ ├── check.sh │ │ └── header.sh │ └── md5_main.cc ├── 3rdparty │ ├── replay │ │ ├── noisetrekker2 │ │ │ ├── readme.txt │ │ │ ├── file_id.diz │ │ │ ├── NtkSourceCode │ │ │ │ ├── IMPORTANT_READ.TXT │ │ │ │ └── cubicspline.cpp │ │ │ ├── noisetrekker2_probe.cc │ │ │ └── noisetrekker2_play.cc │ │ ├── st3play │ │ │ ├── st3play_play.cc │ │ │ ├── st3play_probe.cc │ │ │ ├── LICENSE │ │ │ └── st3play.h │ │ ├── st23play │ │ │ ├── st23play_play.cc │ │ │ ├── st23play_probe.cc │ │ │ ├── st23play.h │ │ │ └── LICENSE │ │ ├── it2play │ │ │ ├── it2drivers │ │ │ │ ├── hq.h │ │ │ │ ├── sb16.h │ │ │ │ ├── sb16mmx.h │ │ │ │ ├── wavwriter.h │ │ │ │ ├── sb16_m.h │ │ │ │ ├── wavwriter_m.h │ │ │ │ ├── sb16mmx_m.h │ │ │ │ ├── zerovol.h │ │ │ │ └── hq_m.h │ │ │ ├── loaders │ │ │ │ ├── it.h │ │ │ │ └── s3m.h │ │ │ ├── it_structs.c │ │ │ ├── it_tables.h │ │ │ ├── it_d_rm.h │ │ │ ├── README.md │ │ │ ├── cpu.h │ │ │ ├── LICENSE │ │ │ ├── it2play.h │ │ │ ├── it_m_eff.h │ │ │ ├── it2play_probe.cc │ │ │ └── it2play_play.cc │ │ ├── ft2play │ │ │ ├── pmp_main.h │ │ │ ├── ft2play_probe.cc │ │ │ ├── ft2play_play.cc │ │ │ ├── tables.h │ │ │ ├── ft2play.h │ │ │ ├── README.md │ │ │ ├── pmp_mix.h │ │ │ └── LICENSE │ │ ├── protrekkr1 │ │ │ ├── protrekkr1_probe.cc │ │ │ ├── protrekkr1_play.cc │ │ │ └── release │ │ │ │ └── distrib │ │ │ │ └── replay │ │ │ │ └── lib │ │ │ │ └── include │ │ │ │ ├── spline.h │ │ │ │ ├── cubic_spline.h │ │ │ │ └── ptkreplay.h │ │ ├── protrekkr2 │ │ │ ├── protrekkr2_probe.cc │ │ │ ├── LICENSE │ │ │ ├── release │ │ │ │ └── distrib │ │ │ │ │ ├── license.txt │ │ │ │ │ └── replay │ │ │ │ │ └── lib │ │ │ │ │ └── include │ │ │ │ │ ├── spline.h │ │ │ │ │ ├── cubic_spline.h │ │ │ │ │ └── ptkreplay.h │ │ │ └── protrekkr2_play.cc │ │ ├── libdigibooster3 │ │ │ ├── CHANGELOG │ │ │ └── COPYING │ │ └── hivelytracker │ │ │ └── LICENSE │ ├── miniz │ │ └── LICENSE │ ├── README │ └── xxhash │ │ ├── LICENSE │ │ └── xxhash.c ├── plugin │ ├── cli │ │ ├── .gitignore │ │ ├── common │ │ │ ├── compat.cc │ │ │ └── logger.cc │ │ ├── converter │ │ │ └── converter_main.cc │ │ ├── precalc │ │ │ └── precalc.sh │ │ ├── songend │ │ │ └── songend_main.cc │ │ └── Makefile.am.inc │ ├── audacious │ │ ├── Makefile.am.inc │ │ ├── logger.cc │ │ └── uade_prefs.h │ ├── deadbeef │ │ ├── Makefile.am.inc │ │ └── logger.cc │ └── common │ │ └── copyright.h ├── songend │ ├── Makefile.am.inc │ ├── precalc.h │ └── detector.h ├── common │ ├── std │ │ ├── string_view.h │ │ ├── optional.h │ │ └── functional.h │ ├── Makefile.am.inc │ ├── logger.h │ ├── songend.h │ ├── md5.h │ └── compat.h ├── converter │ ├── Makefile.am.inc │ ├── converter.h │ └── converter.cc ├── songdb │ ├── Makefile.am.inc │ └── songdb.h └── player │ └── Makefile.am.inc ├── conf ├── uade.conf └── ext │ ├── PaulTonge │ ├── Dogfight │ │ └── WantedTeam.bin │ └── AncientArtOfWar │ │ └── WantedTeam.bin │ └── JesperOlsen │ ├── LollyPop │ └── WantedTeam.bin │ └── GeorgGlaxo │ └── WantedTeam.bin ├── AUTHORS ├── testdata ├── syoa.s3m ├── aulral.mod ├── mizzle.it ├── chipsong.med ├── exquisiet.ahx ├── ezisopth.it ├── gyroscope.mon ├── happiness.s3m ├── mod.orchannel ├── tomaatti.dbm ├── unionjack.ntk ├── karatekid2.cus ├── miracle man.s3m ├── monkmusings.hvl ├── spaz on jazz.it ├── burgertime mix.xm ├── elevator zax.ptk ├── hash-tu-raz 2.digi ├── introduction3.sa ├── posse's theme.stm ├── rubber spine.ahx ├── silly venture.mgt ├── superhyllorejv.xm ├── trip to hell.dbm ├── a new beginning.ahx ├── devenirunpoulet.ptk ├── long white clouds.it ├── mdat.turrican loader ├── nes song thingy.s3m ├── smpl.turrican loader ├── spellbound dizzy.bp ├── MOD.forbidden pineapples ├── DBM.Tower Of The Six Winds ├── oldskoolcrackintrosong.ahx ├── starport bbs introtune.s3m └── i wanna show you all my warez.ahx ├── screenshots ├── screenshot1.png ├── screenshot2.png └── screenshot3.png ├── .gitmodules ├── .gitignore ├── Makefile.am └── m4 ├── ax_check_link_flag.m4 └── ax_check_compile_flag.m4 /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.14-dev 2 | -------------------------------------------------------------------------------- /VERSION-RELEASE: -------------------------------------------------------------------------------- 1 | 0.14.0 2 | -------------------------------------------------------------------------------- /scripts/debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /src/test/.gitignore: -------------------------------------------------------------------------------- 1 | md5 2 | -------------------------------------------------------------------------------- /conf/uade.conf: -------------------------------------------------------------------------------- 1 | enable_timeouts = 1 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Matti Tiainen 2 | -------------------------------------------------------------------------------- /scripts/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /scripts/ubignorelist.txt: -------------------------------------------------------------------------------- 1 | # generated code, ignore for now 2 | src:cpuemu.c 3 | -------------------------------------------------------------------------------- /testdata/syoa.s3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/syoa.s3m -------------------------------------------------------------------------------- /testdata/aulral.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/aulral.mod -------------------------------------------------------------------------------- /testdata/mizzle.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/mizzle.it -------------------------------------------------------------------------------- /testdata/chipsong.med: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/chipsong.med -------------------------------------------------------------------------------- /testdata/exquisiet.ahx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/exquisiet.ahx -------------------------------------------------------------------------------- /testdata/ezisopth.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/ezisopth.it -------------------------------------------------------------------------------- /testdata/gyroscope.mon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/gyroscope.mon -------------------------------------------------------------------------------- /testdata/happiness.s3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/happiness.s3m -------------------------------------------------------------------------------- /testdata/mod.orchannel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/mod.orchannel -------------------------------------------------------------------------------- /testdata/tomaatti.dbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/tomaatti.dbm -------------------------------------------------------------------------------- /testdata/unionjack.ntk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/unionjack.ntk -------------------------------------------------------------------------------- /testdata/karatekid2.cus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/karatekid2.cus -------------------------------------------------------------------------------- /testdata/miracle man.s3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/miracle man.s3m -------------------------------------------------------------------------------- /testdata/monkmusings.hvl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/monkmusings.hvl -------------------------------------------------------------------------------- /testdata/spaz on jazz.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/spaz on jazz.it -------------------------------------------------------------------------------- /screenshots/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/screenshots/screenshot1.png -------------------------------------------------------------------------------- /screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/screenshots/screenshot2.png -------------------------------------------------------------------------------- /screenshots/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/screenshots/screenshot3.png -------------------------------------------------------------------------------- /testdata/burgertime mix.xm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/burgertime mix.xm -------------------------------------------------------------------------------- /testdata/elevator zax.ptk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/elevator zax.ptk -------------------------------------------------------------------------------- /testdata/hash-tu-raz 2.digi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/hash-tu-raz 2.digi -------------------------------------------------------------------------------- /testdata/introduction3.sa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/introduction3.sa -------------------------------------------------------------------------------- /testdata/posse's theme.stm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/posse's theme.stm -------------------------------------------------------------------------------- /testdata/rubber spine.ahx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/rubber spine.ahx -------------------------------------------------------------------------------- /testdata/silly venture.mgt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/silly venture.mgt -------------------------------------------------------------------------------- /testdata/superhyllorejv.xm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/superhyllorejv.xm -------------------------------------------------------------------------------- /testdata/trip to hell.dbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/trip to hell.dbm -------------------------------------------------------------------------------- /testdata/a new beginning.ahx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/a new beginning.ahx -------------------------------------------------------------------------------- /testdata/devenirunpoulet.ptk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/devenirunpoulet.ptk -------------------------------------------------------------------------------- /testdata/long white clouds.it: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/long white clouds.it -------------------------------------------------------------------------------- /testdata/mdat.turrican loader: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/mdat.turrican loader -------------------------------------------------------------------------------- /testdata/nes song thingy.s3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/nes song thingy.s3m -------------------------------------------------------------------------------- /testdata/smpl.turrican loader: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/smpl.turrican loader -------------------------------------------------------------------------------- /testdata/spellbound dizzy.bp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/spellbound dizzy.bp -------------------------------------------------------------------------------- /testdata/MOD.forbidden pineapples: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/MOD.forbidden pineapples -------------------------------------------------------------------------------- /testdata/DBM.Tower Of The Six Winds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/DBM.Tower Of The Six Winds -------------------------------------------------------------------------------- /testdata/oldskoolcrackintrosong.ahx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/oldskoolcrackintrosong.ahx -------------------------------------------------------------------------------- /testdata/starport bbs introtune.s3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/starport bbs introtune.s3m -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "uade"] 2 | path = uade 3 | url = https://gitlab.com/mvtiaine/uade.git 4 | branch = dragnet 5 | shallow = true 6 | -------------------------------------------------------------------------------- /conf/ext/PaulTonge/Dogfight/WantedTeam.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/conf/ext/PaulTonge/Dogfight/WantedTeam.bin -------------------------------------------------------------------------------- /testdata/i wanna show you all my warez.ahx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/testdata/i wanna show you all my warez.ahx -------------------------------------------------------------------------------- /conf/ext/JesperOlsen/LollyPop/WantedTeam.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/conf/ext/JesperOlsen/LollyPop/WantedTeam.bin -------------------------------------------------------------------------------- /src/3rdparty/replay/noisetrekker2/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/src/3rdparty/replay/noisetrekker2/readme.txt -------------------------------------------------------------------------------- /conf/ext/JesperOlsen/GeorgGlaxo/WantedTeam.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/conf/ext/JesperOlsen/GeorgGlaxo/WantedTeam.bin -------------------------------------------------------------------------------- /src/3rdparty/replay/noisetrekker2/file_id.diz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/src/3rdparty/replay/noisetrekker2/file_id.diz -------------------------------------------------------------------------------- /conf/ext/PaulTonge/AncientArtOfWar/WantedTeam.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mvtiaine/audacious-uade/HEAD/conf/ext/PaulTonge/AncientArtOfWar/WantedTeam.bin -------------------------------------------------------------------------------- /src/3rdparty/replay/st3play/st3play_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "st3play.h" 3 | 4 | namespace replay::st3play::play { 5 | #include "st3play.c" 6 | } 7 | -------------------------------------------------------------------------------- /src/3rdparty/replay/st23play/st23play_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "st23play.h" 3 | 4 | namespace replay::st23play::play { 5 | #include "st23play.c" 6 | } 7 | -------------------------------------------------------------------------------- /src/3rdparty/replay/st3play/st3play_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "st3play.h" 3 | 4 | namespace replay::st3play::probe { 5 | #include "st3play.c" 6 | } 7 | -------------------------------------------------------------------------------- /src/3rdparty/replay/st23play/st23play_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "st23play.h" 3 | 4 | namespace replay::st23play::probe { 5 | #include "st23play.c" 6 | } 7 | -------------------------------------------------------------------------------- /scripts/debian/changelog.in: -------------------------------------------------------------------------------- 1 | audacious-uade (VERSION-1) unstable; urgency=low 2 | 3 | * Placeholder changelog for Debian support 4 | 5 | -- Matti Tiainen Tue, 26 Sep 2023 21:37:00 +0300 6 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/hq.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #endif 8 | 9 | bool HQ_InitDriver(int32_t mixingFrequency); 10 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/loaders/it.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include "../it_d_rm.h" 8 | #endif 9 | 10 | bool LoadIT(MEMFILE *m); 11 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/loaders/s3m.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include "../it_d_rm.h" 8 | #endif 9 | 10 | bool LoadS3M(MEMFILE *m); 11 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/sb16.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #endif 8 | 9 | bool SB16_InitDriver(int32_t mixingFrequency); 10 | -------------------------------------------------------------------------------- /scripts/crossbuild/emscripten.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Emscripten support does not actually work yet 6 | 7 | #autoreconf -i 8 | 9 | emconfigure ./configure 10 | emmake make clean 11 | WRAPPER="$(which node || echo node)" \ 12 | emmake make -j check 13 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/sb16mmx.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #endif 8 | 9 | bool SB16MMX_InitDriver(int32_t mixingFrequency); 10 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/pmp_main.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | #include 5 | #include 6 | #endif 7 | 8 | void mainPlayer(void); 9 | uint32_t getFrequenceValue(uint16_t period); 10 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/wavwriter.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #endif 8 | 9 | bool WAVWriter_InitDriver(int32_t mixingFrequency); 10 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/ft2play_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "ft2play.h" 3 | 4 | namespace replay::ft2play::probe { 5 | using namespace replay::ft2play; 6 | #include "pmplay.c" 7 | #include "pmp_main.c" 8 | #include "pmp_mix.c" 9 | #include "snd_masm.c" 10 | } 11 | -------------------------------------------------------------------------------- /scripts/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | %: 4 | dh $@ 5 | 6 | override_dh_auto_configure: 7 | dh_auto_configure -- \ 8 | --enable-players=all \ 9 | --enable-plugin-audacious=yes \ 10 | --with-deadbeef-plugindir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)/deadbeef \ 11 | --with-static-stdlibs=no 12 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it_structs.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #include 4 | #include 5 | #include "it_structs.h" 6 | #endif 7 | 8 | hostChn_t hChn[MAX_HOST_CHANNELS]; 9 | slaveChn_t sChn[MAX_SLAVE_CHANNELS]; 10 | driver_t Driver; 11 | song_t Song; 12 | -------------------------------------------------------------------------------- /src/plugin/cli/.gitignore: -------------------------------------------------------------------------------- 1 | converter/converter 2 | player/player 3 | songend/songend 4 | songdb/songdb 5 | precalc/precalc -------------------------------------------------------------------------------- /scripts/crossbuild/aros.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #autoreconf -i 6 | 7 | export PATH="/opt/cross/aros-i386:$PATH" 8 | export PKG_CONFIG_PATH=/dev/null 9 | export PKG_CONFIG_LIBDIR=/dev/null 10 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 11 | 12 | ./configure --host=i386-aros 13 | 14 | make clean 15 | 16 | make -j check 17 | -------------------------------------------------------------------------------- /scripts/crossbuild/morphos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #autoreconf -i 6 | 7 | export "PATH=/opt/cross/morphos/bin:$PATH" 8 | export PKG_CONFIG_PATH=/dev/null 9 | export PKG_CONFIG_LIBDIR=/dev/null 10 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 11 | 12 | ./configure --host=ppc-morphos 13 | 14 | make clean 15 | 16 | make -j check 17 | -------------------------------------------------------------------------------- /src/songend/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | noinst_LTLIBRARIES += \ 4 | songend/libsongend.la 5 | 6 | songend_libsongend_la_SOURCES = \ 7 | songend/detector.h \ 8 | songend/detector.cc \ 9 | songend/precalc.h \ 10 | songend/precalc.cc 11 | 12 | songend_libsongend_la_LIBADD = \ 13 | player/libplayer.la 14 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/sb16_m.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #ifndef AUDACIOUS_UADE 5 | #include 6 | #include "../it_structs.h" 7 | #endif 8 | 9 | typedef void (*mixFunc)(slaveChn_t *sc, int32_t *mixBufPtr, int32_t numSamples); 10 | 11 | extern const mixFunc SB16_MixFunctionTables[8]; 12 | -------------------------------------------------------------------------------- /src/test/converter/test_converter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . $(dirname "$0")/../common/header.sh 6 | 7 | # 8 | 9 | TESTMOD=${top_srcdir}/testdata/chipsong.med 10 | 11 | TEST_NAME=converter 12 | EXPECTED_OUTPUT=b6ea0467707ba8201c26e549db028a47 13 | TEST="${CONVERTER} \"${TESTMOD}\" | ${MD5}" 14 | 15 | . $(dirname "$0")/../common/check.sh 16 | exit 0 17 | -------------------------------------------------------------------------------- /scripts/crossbuild/redox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Redox OS binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | export PATH="/opt/cross/redox/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | ./configure --host=x86_64-unknown-redox 15 | 16 | make clean 17 | 18 | make -j check 19 | -------------------------------------------------------------------------------- /scripts/crossbuild/riscos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # RISC OS binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | export PATH="/opt/cross/riscos/cross/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | ./configure --host=arm-riscos-gnueabi 15 | 16 | make clean 17 | 18 | make -j check 19 | -------------------------------------------------------------------------------- /scripts/crossbuild/serenity.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # SerenityOS binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | export PATH="/opt/cross/serenityos/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | ./configure --host=x86_64-pc-serenity 15 | 16 | make clean 17 | 18 | make -j check 19 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/dos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # DOS/DJGPP does not actually build yet 6 | 7 | #autoreconf -i 8 | 9 | export PATH=/"opt/cross/djgpp/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | ./configure --host=i586-pc-msdosdjgpp 15 | 16 | make clean 17 | 18 | make -j check 19 | -------------------------------------------------------------------------------- /scripts/crossbuild/amigaos4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # AmigaOS4 binaries do not actually work yet 6 | 7 | #autoreconf -i 8 | 9 | export PATH="/opt/cross/amigaos4/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | ./configure --host=ppc-amigaos 15 | 16 | make clean 17 | 18 | make -j check 19 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/ft2play_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "ft2play.h" 3 | 4 | namespace replay::ft2play { 5 | using namespace replay::ft2play; 6 | #include "tables.c" 7 | } 8 | namespace replay::ft2play::play { 9 | using namespace replay::ft2play; 10 | #include "pmplay.c" 11 | #include "pmp_main.c" 12 | #include "pmp_mix.c" 13 | #include "snd_masm.c" 14 | } 15 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/vxworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # VxWorks does not actually build yet 6 | 7 | #autoreconf -i 8 | 9 | export PKG_CONFIG_PATH=/dev/null 10 | export PKG_CONFIG_LIBDIR=/dev/null 11 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 12 | 13 | . /opt/cross/wrsdk-vxworks7-qemu/sdkenv.sh 14 | 15 | ./configure --host=x86_64-pc-vxworks 16 | 17 | make clean 18 | 19 | make -j check 20 | -------------------------------------------------------------------------------- /src/3rdparty/replay/noisetrekker2/NtkSourceCode/IMPORTANT_READ.TXT: -------------------------------------------------------------------------------- 1 | IS REQUIRED LIBCON LIBRARY TO COMPILE! 2 | 3 | Get it : 4 | 5 | http://photoneffect.com 6 | 7 | Contact PHOTON for additional help. 8 | 9 | 10 | Use this code at your own risk. 11 | 12 | Respect the OPENSOURCE & FREE CODE rules, dont be a lamer. 13 | 14 | Use Microsoft VC++ 6.0 to code7compile. 15 | 16 | 17 | ARGURU 18 | -------------------------------------------------------------------------------- /src/test/songend/test_songend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/spellbound dizzy.bp" 12 | 13 | export SONGEND_MODE=1 14 | TEST_NAME="Songend loop detection" 15 | TEST="${PLAYER} \"${TESTMOD}\" | ${SONGEND}" 16 | EXPECTED_OUTPUT=220299 17 | . $(dirname "$0")/../common/check.sh 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/gyroscope.mon" 12 | TEST_NAME="Precalc songend - loop" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="06b890430af28b89de13435e00f820b2 1 48010 loop uade MON 0 7788 0ff7e16b" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/rubber spine.ahx" 12 | TEST_NAME="Precalc songend - error" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="9a3fbe962d46a2335a2eb99e938c3ccb 0 0 error uade AHX v2 0 6035 4d0bba9d" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /scripts/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | VERSION_OLD=$(cat VERSION) 6 | cp VERSION-RELEASE VERSION 7 | autoreconf -i && \ 8 | ./configure --enable-players=all --enable-plugin-audacious=yes --enable-plugin-deadbeef=yes --with-deadbeef-plugindir=/dev/null && \ 9 | make clean && \ 10 | CFLAGS="-Wall -Wpedantic -Wextra -Werror" \ 11 | CXXFLAGS="${CFLAGS}" \ 12 | make -j distcheck 13 | echo ${VERSION_OLD} > VERSION 14 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/wavwriter_m.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #ifndef AUDACIOUS_UADE 5 | #include 6 | #include "../it_structs.h" 7 | #endif 8 | 9 | #define RAMPSPEED 8 10 | #define RAMPCOMPENSATE 255 11 | 12 | typedef void (*mixFunc)(slaveChn_t *sc, int32_t *mixBufPtr, int32_t numSamples); 13 | 14 | extern const mixFunc WAVWriter_MixFunctionTables[4]; 15 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc13.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/exquisiet.ahx" 12 | TEST_NAME="Precalc songend - repeat2" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="d2a716b5365491c0d7f082f9a438a56b 0 89705 repeat uade AHX v2 0 10518 57dbef2b" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/karatekid2.cus" 12 | TEST_NAME="Precalc songend - silence" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="048e361de72990f8ba9e24a4d4a9bef8 0 264368 silence uade CustomPlay 0 4732 5e99ce94" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/songdb/test_songdb2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . $(dirname "$0")/../common/header.sh 6 | 7 | # 8 | 9 | TESTMOD="${top_srcdir}/testdata/MOD.forbidden pineapples" 10 | 11 | TEST_NAME=songdb2 12 | export SONGDB_DIR=${SONGDB_DIR} 13 | EXPECTED_OUTPUT="metadata.tsv:73ef03e9d660 RM Dekadence Kesähäxä 2017" 14 | TEST="${SONGDB_BIN} \"${TESTMOD}\" | grep metadata" 15 | 16 | . $(dirname "$0")/../common/check.sh 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc12.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/oldskoolcrackintrosong.ahx" 12 | TEST_NAME="Precalc songend - volume" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="42439d629c7d645e9668c0eb3878849d 0 72100 volume uade AHX v2 0 3149 5c1a4e96" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/mdat.turrican loader" 12 | TEST_NAME="Precalc songend - player (uade)" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="9878bd072ac12f04a8cdf353731110cc 0 30844 player uade TFMX 0 4728 4bfa0071" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/i wanna show you all my warez.ahx" 12 | TEST_NAME="Precalc songend - repeat" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="82f244a2ce0dd8fdbf5bcac3e9476337 0 9000 repeat uade AHX v2 0 26993 2a2d02f0" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/sb16mmx_m.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #ifndef AUDACIOUS_UADE 5 | #include 6 | #include "../it_structs.h" 7 | #endif 8 | 9 | #define RAMPSPEED 7 10 | #define RAMPCOMPENSATE 63 11 | #define FILTER_BITS 14 12 | 13 | typedef void (*mixFunc)(slaveChn_t *sc, int32_t *mixBufPtr, int32_t numSamples); 14 | 15 | extern const mixFunc SB16MMX_MixFunctionTables[8]; 16 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc10.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/introduction3.sa" 12 | TEST_NAME="Precalc songend - player+volume" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="eaafce62280cc4df58c8222089598ec2 0 28321 player\+volume uade Sonic Arranger 0 2660 40d97975" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/songdb/test_songdb3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . $(dirname "$0")/../common/header.sh 6 | 7 | # 8 | 9 | TESTMOD="${top_srcdir}/testdata/a new beginning.ahx" 10 | 11 | TEST_NAME="songdb3 (duplicate subsongs)" 12 | export SONGDB_DIR=${SONGDB_DIR} 13 | EXPECTED_OUTPUT="songlengths.tsv:743dca7720e9 0 174340,p 174340,p,!" 14 | TEST="${SONGDB_BIN} \"${TESTMOD}\" | grep songlengths" 15 | 16 | . $(dirname "$0")/../common/check.sh 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=hivelytracker 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/monkmusings.hvl" 12 | TEST_NAME="Precalc songend - player (hvl)" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="ce594632803f682e9c3c644087b4e58b 0 45991 player hivelytracker HivelyTracker 7 2378 08145fe3" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/player/test_player_st23play_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=st23play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/posse's theme.stm" 14 | TESTMD5_LITTLE=88fcf7f610c0e14ad152cc0158cbf8e0 15 | 16 | TEST_NAME="st23play" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 -------------------------------------------------------------------------------- /src/test/precalc/test_precalc9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/hash-tu-raz 2.digi" 12 | TEST_NAME="Precalc songend - player+silence" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="d9a1e268d228018921af3287576c179f 0 172676 player\+silence uade DIGI Booster V1.6 0 35902 09307b0d" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/player/test_player_ft2play_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=ft2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/aulral.mod" 14 | TESTMD5_LITTLE=ef9bfa7754dbff6859caee9fa9154e72 15 | 16 | TEST_NAME="ft2play (FST)" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_uade_4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/mdat.turrican loader" 14 | TESTMD5_LITTLE=2ddda025613580a93b4e07cc3b850362 15 | 16 | TEST_NAME="UADE extload" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libdigibooster3 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/tomaatti.dbm" 12 | TEST_NAME="Precalc songend - player (dbm)" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="9a8ff8bc0d82b479255c87a013babe05 0 169093 player libdigibooster3 DigiBooster Pro 2.21 6 12994 af7bdf3c" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/test/player/test_player_st3play_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=st3play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/happiness.s3m" 14 | TESTMD5_LITTLE=df151c0e648c66e3485dcb538be3b509 15 | 16 | TEST_NAME="st3play (16-bit)" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_uade_5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/MOD.forbidden pineapples" 14 | TESTMD5_LITTLE=a99adc7dad18e3a6093382db62225a8c 15 | 16 | TEST_NAME="MOD prefix" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_ft2play_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=ft2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/burgertime mix.xm" 14 | TESTMD5_LITTLE=9d49fa1c465c0e5d5eff9a80e30f9b4c 15 | 16 | TEST_NAME="ft2play (XM) + subsongs" 17 | TEST="${PLAYER} \"${TESTMOD}\" 5 | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_ft2play_3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=ft2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/superhyllorejv.xm" 14 | TESTMD5_LITTLE=7d4da8c1712da2a14ee73b6204f1ad3f 15 | 16 | TEST_NAME="ft2play (16-bit samples)" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_st3play_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=st3play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/miracle man.s3m" 14 | TESTMD5_LITTLE=17addf5a33be26ca333561da49b46ecd 15 | 16 | TEST_NAME="st3play (S3M) + subsongs" 17 | TEST="${PLAYER} \"${TESTMOD}\" 2 | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/common/std/string_view.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2024-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #if __has_include() 7 | #include 8 | #elif __has_include() 9 | #include 10 | namespace std { 11 | using string_view = experimental::string_view; 12 | } 13 | #else 14 | #error " or is required!" 15 | #endif 16 | -------------------------------------------------------------------------------- /src/test/player/test_player_libdigibooster3_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libdigibooster3 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/tomaatti.dbm" 14 | TESTMD5_LITTLE=7ee7c819bad8d828aa535809ddad5c7c 15 | 16 | TEST_NAME="libdigibooster3" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_uade_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=big 12 | 13 | TESTMOD="${top_srcdir}/testdata/mod.orchannel" 14 | TESTMD5_BIG=b8ed2fe7706a0f7e25bac357cb138ed2 15 | SUBSONG=4 16 | 17 | TEST_NAME="UADE big endian + subsong" 18 | TEST="${PLAYER} \"${TESTMOD}\" ${SUBSONG} | ${MD5}" 19 | EXPECTED_OUTPUT=$TESTMD5_BIG 20 | . $(dirname "$0")/../common/check.sh 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc11.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libdigibooster3 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/DBM.Tower Of The Six Winds" 12 | TEST_NAME="Precalc songend - loop+silence" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="28bb7e78268d7925943070c2b3ace712 0 26140 loop\+silence libdigibooster3 DigiBooster Pro 2.21 14 181911 101c7336" 15 | . $(dirname "$0")/../common/check.sh 16 | 17 | exit 0 18 | -------------------------------------------------------------------------------- /src/common/std/optional.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2024-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #if __has_include() 7 | #include 8 | #elif __has_include() 9 | #include 10 | namespace std { 11 | template 12 | using optional = typename experimental::optional; 13 | } 14 | #else 15 | #error " or is required!" 16 | #endif 17 | -------------------------------------------------------------------------------- /src/test/player/test_player_uade_3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/mod.orchannel" 14 | TESTMD5_LITTLE=faa08024bbc334b68ad94f238490276c 15 | SUBSONG=4 16 | 17 | TEST_NAME="UADE little endian + subsong" 18 | TEST="${PLAYER} \"${TESTMOD}\" ${SUBSONG} | ${MD5}" 19 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 20 | . $(dirname "$0")/../common/check.sh 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /src/test/player/test_player_libdigibooster3_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libdigibooster3 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | 13 | TESTMOD="${top_srcdir}/testdata/trip to hell.dbm" 14 | TESTMD5_LITTLE=2c7ae19db06d83977091c29b759725fa 15 | 16 | TEST_NAME="libdigibooster3 (16-bit samples)" 17 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 18 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/common/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | noinst_HEADERS = \ 4 | common/compat.h \ 5 | common/constexpr.h \ 6 | common/endian.h \ 7 | common/foreach.h \ 8 | common/logger.h \ 9 | common/songend.h \ 10 | common/strings.h \ 11 | common/std/functional.h \ 12 | common/std/optional.h \ 13 | common/std/string_view.h 14 | 15 | noinst_LTLIBRARIES += \ 16 | common/libmd5.la 17 | 18 | common_libmd5_la_SOURCES = \ 19 | common/md5.h \ 20 | common/md5.cc 21 | -------------------------------------------------------------------------------- /src/test/player/test_player_libxmp_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libxmp 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # using precalc as libxmp is used as system/external library 12 | 13 | TESTMOD="${top_srcdir}/testdata/silly venture.mgt" 14 | TEST_NAME="libxmp" 15 | TEST="${PRECALC} \"${TESTMOD}\"" 16 | EXPECTED_OUTPUT="e33a4643d758738626a11aa8fa49ea6d 0 244466 player libxmp Megatracker MGT v1.1 12 157178 6826fa53" 17 | 18 | . $(dirname "$0")/../common/check.sh 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /src/converter/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | noinst_LTLIBRARIES += \ 4 | converter/libconverter.la 5 | 6 | converter_libconverter_la_SOURCES = \ 7 | converter/converter.h \ 8 | converter/converter.cc \ 9 | converter/io.h \ 10 | converter/med/common_med.h \ 11 | converter/med/common_med.cc \ 12 | converter/med/converter_med4.cc \ 13 | 3rdparty/SimpleBinStream.h \ 14 | 3rdparty/proplayer.h 15 | 16 | converter/med/% : CXXFLAGS += -Wno-zero-length-array -Wno-pedantic 17 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | export IT2PLAY_DRIVER=sb16 13 | 14 | TESTMOD="${top_srcdir}/testdata/nes song thingy.s3m" 15 | TESTMD5_LITTLE=fc16310aff5bad584a1ee24d3c84e291 16 | 17 | TEST_NAME="it2play (driver SB16)" 18 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 19 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 20 | 21 | . $(dirname "$0")/../common/check.sh 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/psp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # PSP does not actually build yet 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 10 | --entrypoint /bin/sh pspdev/pspdev \ 11 | $0 build 12 | else 13 | apk add build-base make autoconf automake libtool pkgconf 14 | SYSROOT=/usr/local/pspdev \ 15 | CPPFLAGS="-isystem ${SYSROOT}/psp/sdk/include" \ 16 | ./configure --host=psp --with-sysroot=${SYSROOT} 17 | make clean 18 | make -j check 19 | fi 20 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export PLAYER_ENDIAN=little 12 | export IT2PLAY_DRIVER=sb16mmx 13 | 14 | TESTMOD="${top_srcdir}/testdata/nes song thingy.s3m" 15 | TESTMD5_LITTLE=3d455d885105c9d2dc25ba3ee00dcbc9 16 | 17 | TEST_NAME="it2play (driver SB16MMX)" 18 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 19 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 20 | 21 | . $(dirname "$0")/../common/check.sh 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /scripts/crossbuild/qnx800.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # QNX 8.0.0 binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | QNX_ABI=x86_64-pc-nto-qnx8.0.0 10 | QNX_BASE=/opt/cross/qnx800 11 | export QNX_HOST=$QNX_BASE/host/linux/x86_64 12 | export QNX_TARGET=$QNX_BASE/target/qnx 13 | 14 | export PATH=$QNX_HOST/usr/bin:$PATH 15 | export PKG_CONFIG_PATH=/dev/null 16 | export PKG_CONFIG_LIBDIR=/dev/null 17 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 18 | 19 | ./configure --host=${QNX_ABI} 20 | 21 | make clean 22 | 23 | make -j check 24 | -------------------------------------------------------------------------------- /src/test/songdb/test_songdb1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . $(dirname "$0")/../common/header.sh 6 | 7 | # 8 | 9 | TESTMOD=${top_srcdir}/testdata/mod.orchannel 10 | 11 | TEST_NAME=songdb1 12 | export SONGDB_DIR=${SONGDB_DIR} 13 | EXPECTED_OUTPUT="songlengths.tsv:7b05bfe48966 1 0,n 4500,p 4500,p 61560,p 14 | modinfos.tsv:7b05bfe48966 Protracker 0 15 | metadata.tsv:7b05bfe48966 Matt Furniss Probe & U.S. Gold Out Run Europa 1991" 16 | TEST="${SONGDB_BIN} \"${TESTMOD}\"" 17 | 18 | . $(dirname "$0")/../common/check.sh 19 | exit 0 20 | -------------------------------------------------------------------------------- /scripts/crossbuild/qnx710.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # QNX 7.1.0 binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | QNX_ABI=x86_64-pc-nto-qnx7.1.0 10 | QNX_BASE=/opt/cross/qnx710 11 | export QNX_HOST=$QNX_BASE/host/linux/x86_64 12 | export QNX_TARGET=$QNX_BASE/target/qnx7 13 | 14 | export PATH="$QNX_HOST/usr/bin:$PATH" 15 | export PKG_CONFIG_PATH=/dev/null 16 | export PKG_CONFIG_LIBDIR=/dev/null 17 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 18 | 19 | ./configure --host=${QNX_ABI} 20 | 21 | make clean 22 | 23 | make -j check 24 | -------------------------------------------------------------------------------- /scripts/crossbuild/warpos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # WarpOS binaries not tested 6 | # also binaries first need to be converted with Elf2Exe2 (or run with ppclibemu(?)) 7 | 8 | #autoreconf -i 9 | 10 | export PATH="/opt/cross/warpos/bin:$PATH" 11 | export PKG_CONFIG_PATH=/dev/null 12 | export PKG_CONFIG_LIBDIR=/dev/null 13 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 14 | 15 | CC="ppc-morphos-gcc --specs=warpup" CXX="ppc-morphos-g++ --specs=warpup" \ 16 | ./configure --host=ppc-morphos 17 | 18 | make clean 19 | 20 | make -j check 21 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/tables.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | #ifndef AUDACIOUS_UADE 4 | #include 5 | #endif 6 | 7 | extern const uint32_t panningTab[257]; 8 | extern const uint16_t amigaPeriods[1936]; 9 | extern const uint16_t linearPeriods[1936]; 10 | extern const int32_t logTab[768]; 11 | extern const char *MODSig[16]; 12 | extern const uint16_t amigaPeriod[96]; 13 | extern const uint8_t vibTab[32]; 14 | extern const int8_t vibSineTab[256]; 15 | extern const uint8_t arpTab[256]; 16 | -------------------------------------------------------------------------------- /src/test/player/test_player_libopenmpt_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libopenmpt 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # using precalc as libopenmpt is used as system/external library 12 | 13 | TESTMOD="${top_srcdir}/testdata/starport bbs introtune.s3m" 14 | TEST_NAME="libopenmpt" 15 | TEST="${PRECALC} \"${TESTMOD}\"" 16 | EXPECTED_OUTPUT="825419d139d7c8bba169d779d1bdd519 0 38342 player libopenmpt Scream Tracker 3.00 \(SB\) 9 4130 d2185f7c" 17 | 18 | . $(dirname "$0")/../common/check.sh 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it_tables.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #ifndef AUDACIOUS_UADE 5 | #include 6 | #endif 7 | 8 | extern const uint32_t PitchTable[120]; 9 | extern const int8_t FineSineData[3 * 256]; // 8bb: sine/ramp/square 10 | 11 | #ifndef USEFPUCODE 12 | extern const uint32_t FineLinearSlideUpTable[16]; 13 | extern const uint32_t LinearSlideUpTable[257]; 14 | extern const uint16_t FineLinearSlideDownTable[16]; 15 | extern const uint16_t LinearSlideDownTable[257]; 16 | #endif 17 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/ps3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # PS3 does not actually build yet 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 10 | --entrypoint /bin/sh hldtux/ps3dev \ 11 | $0 build 12 | else 13 | SYSROOT=/usr/local/ps3dev/ppu/ppu \ 14 | CPPFLAGS="-isystem /usr/local/ps3dev/ppu/include" \ 15 | CFLAGS="--sysroot=${SYSROOT}" \ 16 | CXXFLAGS="${CFLAGS}" \ 17 | ./configure --host=powerpc64-ps3-elf --with-sysroot=${SYSROOT} 18 | make clean 19 | make -j check 20 | fi 21 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/psvita.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # PSVita does not actually build yet 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 10 | --entrypoint /bin/sh gnuton/vitasdk-docker \ 11 | $0 build 12 | else 13 | apt install -y build-essential autoconf automake libtool pkg-config 14 | autoreconf -i 15 | SYSROOT=/usr/local/vitasdk \ 16 | CPPFLAGS="-DPATH_MAX=1024" \ 17 | ./configure --host=arm-vita-eabi --with-sysroot=${SYSROOT} 18 | make clean 19 | make -j check 20 | fi 21 | -------------------------------------------------------------------------------- /src/plugin/cli/common/compat.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2024-2025 Matti Tiainen 3 | 4 | 5 | #ifdef WARPUP 6 | extern "C" { 7 | #include 8 | // XXX latest mos2wos (1.4) seems broken, but only one with gcc9 9 | // undefined reference to `__gthr_morphos_mutex_lock' etc. 10 | int __gthr_morphos_mutex_lock (__gthread_mutex_t *__mutex) {} 11 | int __gthr_morphos_mutex_unlock (__gthread_mutex_t *__mutex) {} 12 | int __gthr_morphos_active_p (void) { return 0; } 13 | } // extern "C" 14 | #endif // WARPUP 15 | -------------------------------------------------------------------------------- /src/test/player/test_player_protrekkr2_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=protrekkr2 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as protrekkr output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/elevator zax.ptk" 15 | TEST_NAME="ProTrekkr 2" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="1373828675fa04145d5e9eb0244b0e24 1 30700 player protrekkr2 ProTrekkr 2.x 12 15436 befd07c8" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_protrekkr1_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=protrekkr1 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as protrekkr output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/devenirunpoulet.ptk" 15 | TEST_NAME="ProTrekkr 1" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="f7a1130e128676f7977933bf9c1e33bd 1 191980 player protrekkr1 ProTrekkr 1.x 12 49283 7af961e7" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /scripts/debian/control: -------------------------------------------------------------------------------- 1 | Source: audacious-uade 2 | Section: sound 3 | Priority: optional 4 | Maintainer: Matti Tiainen 5 | Homepage: https://github.com/mvtiaine/audacious-uade 6 | Build-Depends: 7 | audacious-dev, 8 | libopenmpt-dev, 9 | libxmp-dev, 10 | autotools-dev, 11 | autoconf, 12 | automake, 13 | libtool, 14 | pkg-config, 15 | Standards-Version: 4.6.2 16 | 17 | Package: audacious-uade 18 | Architecture: any 19 | Multi-Arch: same 20 | Depends: 21 | audacious, 22 | libopenmpt0, 23 | libxmp4, 24 | Description: UADE plugin for Audacious and DeaDBeeF 25 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as it2play HQ driver output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/syoa.s3m" 15 | TEST_NAME="it2play (S3M)" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="071c79fb4583effc70d473c9b976f1a0 1 203169 player\+silence it2play Impulse Tracker 2.14 14 51174 65b8e5ca" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_noisetrekker2_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=noisetrekker2 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as noisterkker2 output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/unionjack.ntk" 15 | TEST_NAME="NoiseTrekker 2" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="38abe9fd6b9ceb6d5049c38462bebe31 1 7060 player noisetrekker2 NoiseTrekker 2.x 5 191700 392a9dc6" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as it2play HQ driver output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/nes song thingy.s3m" 15 | TEST_NAME="it2play (S3M 16-bit)" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="64db875e6483430c92b22908b3004285 1 176628 player it2play Impulse Tracker 2.14\+ 5 15740 f5ab1e47" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/precalc/test_precalc7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/mod.orchannel" 12 | TEST_NAME="Precalc songend - subsongs + nosound" 13 | TEST="${PRECALC} \"${TESTMOD}\"" 14 | EXPECTED_OUTPUT="025e47e9f0d32124588b712263aea971 1 0 nosound uade Protracker 0 35174 7b05bfe4 15 | 025e47e9f0d32124588b712263aea971 2 4501 player 16 | 025e47e9f0d32124588b712263aea971 3 4501 player 17 | 025e47e9f0d32124588b712263aea971 4 61568 player" 18 | . $(dirname "$0")/../common/check.sh 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as it2play HQ driver output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/long white clouds.it" 15 | TEST_NAME="it2play (IT 16-bit unsigned)" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="158eb5a6916b9bf97fa54139dc1e7fcd 1 189589 player it2play Impulse Tracker 1.06 12 178697 62f19d91" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /scripts/crossbuild/fuchsia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Fuchsia binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | export PATH="/opt/cross/fuchsia-clang/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | SYSROOT=/opt/cross/fuchsia-core/arch/arm64/sysroot \ 15 | CC=clang CXX=clang++ LD=ld.lld \ 16 | CFLAGS="-target aarch64-unknown-fuchsia --sysroot ${SYSROOT}" CXXFLAGS="${CFLAGS}" \ 17 | ./configure --host=aarch64-unknown-fuchsia --with-sysroot=${SYSROOT} 18 | 19 | make clean 20 | 21 | make -j check 22 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/zerovol.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include "../it_structs.h" 7 | #endif 8 | 9 | void UpdateNoLoop(slaveChn_t *sc, uint32_t numSamples); 10 | void UpdateForwardsLoop(slaveChn_t *sc, uint32_t numSamples); 11 | void UpdatePingPongLoop(slaveChn_t *sc, uint32_t numSamples); 12 | void UpdateNoLoopHQ(slaveChn_t *sc, uint32_t numSamples); 13 | void UpdateForwardsLoopHQ(slaveChn_t *sc, uint32_t numSamples); 14 | void UpdatePingPongLoopHQ(slaveChn_t *sc, uint32_t numSamples); 15 | -------------------------------------------------------------------------------- /src/songend/precalc.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | #include "common/constexpr.h" 9 | #include "player/player.h" 10 | 11 | namespace songend::precalc { 12 | 13 | constexpr_f2 bool allow_songend_error(const std::string &format) noexcept { 14 | return format == "VSS"; 15 | } 16 | 17 | common::SongEnd precalc_song_end(const player::ModuleInfo &info, const char *buf, size_t size, int subsong, const std::string &md5hex) noexcept; 18 | 19 | } // namespace songend::precalc 20 | -------------------------------------------------------------------------------- /src/test/player/test_player_hivelytracker_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=hivelytracker 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as HivelyTracker replay may produce slightly different output depending on host 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/monkmusings.hvl" 15 | TEST_NAME="HivelyTracker" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="ce594632803f682e9c3c644087b4e58b 0 45991 player hivelytracker HivelyTracker 7 2378 08145fe3" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as it2play HQ driver output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/mizzle.it" 15 | TEST_NAME="it2play (IT 16-bit + delta)" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="cc722dd8dfbe85796bebe8d4fd6782a0 1 1755[2-3][0-9] player\+volume it2play Impulse Tracker 2.15 17 61211 1bdfaa95" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /scripts/crossbuild/freemint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # FreeMint binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | CROSSDIR=/opt/cross/mint 10 | SYSROOT="${CROSSDIR}/m68k-atari-mint/sys-root" 11 | 12 | export PATH="${CROSSDIR}/bin:$PATH" 13 | export PKG_CONFIG_PATH= 14 | export PKG_CONFIG_LIBDIR="${CROSSDIR}/crosstools/lib/pkgconfig" 15 | export PKG_CONFIG_SYSROOT_DIR=${SYSROOT} 16 | 17 | SYSROOT="${SYSROOT}" CFLAGS="--sysroot=$SYSROOT" CXXFLAGS="--sysroot=$SYSROOT" LDFLAGS="--sysroot=$SYSROOT" \ 18 | ./configure --host=m68k-atari-mint --with-sysroot=$SYSROOT 19 | 20 | make clean 21 | 22 | make -j check 23 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/symbian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Symbian does not actually build yet 6 | 7 | #autoreconf -i 8 | 9 | export PATH="/opt/cross/gcc4symbian/bin:$PATH" 10 | export PKG_CONFIG_PATH=/dev/null 11 | export PKG_CONFIG_LIBDIR=/dev/null 12 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 13 | 14 | SDK=Nokia_N97_SDK_v1.0 15 | #SDK=Nokia_Symbian_Belle_SDK_v1.0 16 | #SDK=S60_3rd_FP2_SDK_v1.1 17 | #SDK=S60_5th_Edition_SDK_v1.0 18 | #SDK=UIQ3.3SDK_BETA 19 | 20 | export EPOCROOT="/opt/cross/gcc4symbian/sdk/$SDK" 21 | 22 | ./configure --host=arm-none-symbianelf 23 | 24 | make clean 25 | 26 | make -j check 27 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as it2play HQ driver output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/ezisopth.it" 15 | TEST_NAME="it2play (IT) UseFPUCode=true (Impulse Tracker 2.15)" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="1e504e4b63e411922004dd063498d61f 1 176280 player\+volume it2play Impulse Tracker 2.15 6 4061 73c93ca5" 18 | 19 | . $(dirname "$0")/../common/check.sh 20 | 21 | exit 0 22 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/switch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Switch does not actually build yet 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 10 | --entrypoint /bin/sh devkitpro/devkita64 \ 11 | $0 build 12 | else 13 | apt update && apt install -y build-essential autoconf automake libtool pkg-config 14 | . /opt/devkitpro/switchvars.sh 15 | # must be set in configure.ac 16 | export LIBS="" 17 | LDFLAGS="-specs=/opt/devkitpro/libnx/switch.specs ${LDFLAGS} -lnx" \ 18 | ./configure --host=aarch64-none-elf 19 | make clean 20 | make -j check 21 | fi 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | export IT2PLAY_DRIVER=wavwriter 12 | 13 | # XXX using precalc as it2play WAVWriter driver output can depend on CPU, compiler and libc 14 | # TODO figure out root cause 15 | 16 | TESTMOD="${top_srcdir}/testdata/nes song thingy.s3m" 17 | TEST_NAME="it2play (driver WAVWriter)" 18 | TEST="${PRECALC} \"${TESTMOD}\"" 19 | EXPECTED_OUTPUT="64db875e6483430c92b22908b3004285 1 176367 player it2play Impulse Tracker 2.14\+ 5 15740 f5ab1e47" 20 | 21 | . $(dirname "$0")/../common/check.sh 22 | 23 | exit 0 24 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/ps2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # PS2 does not actually build yet 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 10 | --entrypoint /bin/sh ps2dev/ps2dev \ 11 | $0 build 12 | else 13 | apk add build-base make autoconf automake libtool pkgconf 14 | autoreconf -i 15 | SYSROOT=/usr/local/ps2dev/ps2sdk/ee \ 16 | CPPFLAGS="-isystem /usr/local/ps2dev/ps2sdk/common/include -D_EE" \ 17 | CFLAGS="--sysroot=${SYSROOT}" CXXFLAGS="${CFLAGS}" \ 18 | ./configure --host=mips64r5900el-ps2-elf --with-sysroot=${SYSROOT} 19 | make clean 20 | make -j check 21 | fi 22 | -------------------------------------------------------------------------------- /src/test/player/test_player_it2play_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=it2play 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # XXX using precalc as it2play HQ driver output can depend on CPU, compiler and libc 12 | # TODO figure out root cause 13 | 14 | TESTMOD="${top_srcdir}/testdata/spaz on jazz.it" 15 | TEST_NAME="it2play (IT) + subsongs" 16 | TEST="${PRECALC} \"${TESTMOD}\"" 17 | EXPECTED_OUTPUT="534dc2e8437ddabcdbf45f92d6dc77b1 1 170135 player\+silence it2play Impulse Tracker 2.06 14 140446 3363ee2e 18 | 534dc2e8437ddabcdbf45f92d6dc77b1 2 45232 player" 19 | 20 | . $(dirname "$0")/../common/check.sh 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /src/test/common/check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | echo Checking test result for $TEST_NAME 6 | echo Running ${TEST} 7 | # doesn't work on Debian 8 | #TEST_OUTPUT=$(eval time ${TEST}) 9 | TEST_OUTPUT=$(eval ${TEST}) 10 | 11 | if printf "$TEST_OUTPUT" | grep -Eq ".*$EXPECTED_OUTPUT.*"; then 12 | SUCCESS="yes" 13 | else 14 | echo "----------EXPECTED OUTPUT----------" 15 | echo $EXPECTED_OUTPUT 16 | echo "------------TEST OUTPUT------------" 17 | echo $TEST_OUTPUT 18 | echo "-----------------------------------" 19 | fi 20 | 21 | if [ "$SUCCESS" != "yes" ]; then 22 | echo "FAILURE" 23 | exit 1 24 | fi 25 | 26 | echo "SUCCESS" 27 | -------------------------------------------------------------------------------- /src/test/player/test_player_uade_1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=uade 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | TESTMOD="${top_srcdir}/testdata/chipsong.med" 12 | TESTMD5_BIG=58e92a4b6be4ca25ccc7bebbc1de61b8 13 | TESTMD5_LITTLE=109e14e01fffcad9cf8084bd7b29526f 14 | 15 | TEST_NAME="UADE native endian + converted" 16 | TEST="${PLAYER} \"${TESTMOD}\" | ${MD5}" 17 | if [ $ENDIAN -eq $BIG ]; then 18 | echo 'Detected big endian host' 19 | EXPECTED_OUTPUT=$TESTMD5_BIG 20 | else 21 | echo 'Detected little endian host' 22 | EXPECTED_OUTPUT=$TESTMD5_LITTLE 23 | fi 24 | . $(dirname "$0")/../common/check.sh 25 | 26 | exit 0 27 | 28 | -------------------------------------------------------------------------------- /scripts/crossbuild/webos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # WebOS binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | TARGET=arm-webos-linux-gnueabi 10 | BIN="/opt/cross/webos/bin" 11 | export PATH="$BIN:$PATH" 12 | export PKG_CONFIG_PATH=/dev/null 13 | export PKG_CONFIG_LIBDIR=/dev/null 14 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 15 | 16 | SYSROOT=/opt/cross/webos/$TARGET/sysroot \ 17 | CFLAGS="--sysroot=$SYSROOT" CXXFLAGS="--sysroot=$SYSROOT" LDFLAGS="--sysroot=$SYSROOT" \ 18 | CC=$BIN/$TARGET-gcc CXX=$BIN/$TARGET-g++ AR=$BIN/$TARGET-ar RANLIB=$BIN/$TARGET-ranlib \ 19 | ./configure --host=$TARGET --with-sysroot=$SYSROOT 20 | 21 | make clean 22 | 23 | make -j check 24 | -------------------------------------------------------------------------------- /scripts/crossbuild/irix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # IRIX binaries do not work properly yet 6 | # TODO test with CSTD="", --with-sysroot? 7 | 8 | #autoreconf -i 9 | 10 | if [ $# -eq 0 ] 11 | then 12 | docker run --rm -t -v /opt/cross/irix:/opt/irix -v .:/audacious-uade -w /audacious-uade \ 13 | --entrypoint /bin/bash unxmaal/compilertron \ 14 | $0 build 15 | else 16 | export PATH="/opt/irix/sgug/bin:$PATH" 17 | 18 | CPPFLAGS="-I/opt/irix/root/usr/sgug/include/c++/9 -I/opt/irix/root/usr/sgug/include/c++/9/mips-sgi-irix6.5" \ 19 | LDFLAGS="-L/opt/irix/root/usr/sgug/lib/gcc/mips-sgi-irix6.5/9" \ 20 | ./configure --host=mips-sgi-irix6.5 21 | 22 | make clean 23 | 24 | make -j check 25 | fi 26 | -------------------------------------------------------------------------------- /scripts/make_deb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | VERSION=$(cat VERSION) 6 | 7 | sudo apt install build-essential audacious-dev libopenmpt-dev libxmp-dev autotools-dev autoconf automake libtool pkg-config debhelper 8 | autoreconf -i && ./configure --enable-players=all --enable-plugin-audacious=yes --with-static-stdlibs=no && make clean && make dist 9 | mkdir -p build-deb 10 | cd build-deb 11 | rm -rf * 12 | ln -sf ../audacious-uade-${VERSION}.tar.bz2 audacious-uade_${VERSION}.orig.tar.bz2 13 | tar xvjf ../audacious-uade-${VERSION}.tar.bz2 14 | cp -rp ../scripts/debian audacious-uade-${VERSION}/ 15 | cd audacious-uade-${VERSION} 16 | sed s/VERSION/${VERSION}/g debian/changelog.in > debian/changelog 17 | dpkg-buildpackage 18 | -------------------------------------------------------------------------------- /scripts/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , autoreconfHook 4 | , libtool 5 | , pkg-config 6 | , which 7 | , audacious 8 | }: 9 | 10 | stdenv.mkDerivation rec { 11 | pname = "audacious-uade"; 12 | version = lib.removeSuffix "\n" (builtins.readFile ./VERSION); 13 | src = ./.; 14 | 15 | nativeBuildInputs = [ 16 | autoreconfHook 17 | libtool 18 | pkg-config 19 | which 20 | ]; 21 | 22 | buildInputs = [ 23 | audacious 24 | ]; 25 | 26 | configureFlags = [ "--with-audacious-plugindir=${placeholder "out"}/lib/audacious" ]; 27 | 28 | meta = with lib; { 29 | description = "UADE plugin for Audacious music player"; 30 | homepage = "https://github.com/mvtiaine/audacious-uade"; 31 | license = licenses.gpl2Plus; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/xbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Xbox does not actually build yet 6 | 7 | export NXDK_DIR=/usr/src/nxdk 8 | export PATH="${NXDK_DIR}/bin:$PATH" 9 | 10 | if [ $# -eq 0 ] 11 | then 12 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 13 | --entrypoint /bin/sh xboxdev/nxdk \ 14 | $0 build 15 | else 16 | apk add build-base make autoconf automake libtool pkgconf 17 | autoreconf -i 18 | CC=nxdk-cc CXX=nxdk-cxx LD=nxdk-link LIB=nxdk-lib AS=nxdk-as \ 19 | LDFLAGS="-L${NXDK_DIR}/lib -L${NXDK_DIR}/lib/xboxkrnl -llibc++ -llibwinapi -llibxboxkrnl -llibxboxrt -llibpdclib -llibnxdk_hal -llibnxdk -lnxdk_usb" \ 20 | ./configure --host=i386-pc-windows --with-sysroot=${NXDK_DIR} 21 | make clean 22 | make -j check 23 | fi 24 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/dreamcast.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Dreamcast does not actually build yet 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 10 | --entrypoint /bin/bash kazade/dreamcast-sdk \ 11 | $0 build 12 | else 13 | dnf install -y gcc make autoconf automake libtool pkg-config which diffutils 14 | . /opt/toolchains/dc/kos/environ.sh 15 | # XXX redefine -D__DREAMCAST__ also in CPPFLAGS for configure.ac detection 16 | CC=${KOS_CC} CXX=${KOS_CCPLUS} LD=${KOS_LD} AR=${KOS_AR} RANLIB=${KOS_RANLIB} \ 17 | CPPFLAGS="-D__DREAMCAST__" CFLAGS="${KOS_CFLAGS}" CXXFLAGS="${KOS_CPPFLAGS}" \ 18 | LDFLAGS="${KOS_LDFLAGS} ${KOS_LIBS}" \ 19 | ./configure --host=sh-elf 20 | make clean 21 | make -j check 22 | fi 23 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr1/protrekkr1_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | #include 3 | #include 4 | #include 5 | 6 | #include "protrekkr1.h" 7 | 8 | using namespace std; 9 | 10 | namespace replay::protrekkr1::probe { 11 | char artist[20]; 12 | char style[20]; 13 | char SampleName[128][16][64]; 14 | char Midiprg[128]; 15 | char nameins[128][20]; 16 | int CHAN_MIDI_PRG[MAX_TRACKS]; 17 | char CHAN_HISTORY_STATE[256][16]; 18 | // sound driver 19 | int AUDIO_Latency = 0; 20 | int AUDIO_Play_Flag = 0; 21 | int done = 0; 22 | #include "src/editors/patterns_blocks.cpp" 23 | #include "src/files/files.cpp" 24 | #include "release/distrib/replay/lib/replay.cpp" 25 | #include "release/distrib/replay/lib/synth.cpp" 26 | #include "release/distrib/replay/lib/tb_303.cpp" 27 | } 28 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/wasix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Wasix support does not actually work yet 6 | # TODO broken: "global is immutable: cannot modify it with `global.set`" 7 | 8 | #autoreconf -i 9 | 10 | export "PATH=/opt/cross/wasi-sdk-22.0/bin:$PATH" 11 | export PKG_CONFIG_PATH=/dev/null 12 | export PKG_CONFIG_LIBDIR=/dev/null 13 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 14 | 15 | SYSROOT=/opt/cross/wasix-sysroot \ 16 | CFLAGS="--sysroot=${SYSROOT}" CXXFLAGS="--sysroot=${SYSROOT}" LDFLAGS="--sysroot=${SYSROOT}" \ 17 | CC=clang CXX=clang++ LD=wasm-ld \ 18 | ./configure --host=wasm32-wasi 19 | 20 | make clean 21 | 22 | WRAPPER="$(which wasmer || echo wasmer) run --dir $(realpath testdata)" make -j check 23 | #WRAPPER="$(which wasmtime || echo wasmtime) run --dir $(realpath testdata)" make -j check 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | autom4te.cache/ 3 | .autotools 4 | aclocal.m4 5 | compile 6 | config.guess 7 | config.log 8 | config.status 9 | config.sub 10 | configure 11 | confdefs.h 12 | conftest.* 13 | depcomp 14 | install-sh 15 | libtool 16 | ltmain.sh 17 | Makefile 18 | Makefile.in 19 | missing 20 | .cproject 21 | .project 22 | *~ 23 | *# 24 | .vscode 25 | INSTALL 26 | *.o 27 | *.tmp 28 | *.lo 29 | *.la 30 | .deps/ 31 | .libs/ 32 | *.a 33 | *.dSYM 34 | *.exe 35 | *.dll 36 | stamp-h1 37 | config.h 38 | config.h.in 39 | config.h.in~ 40 | .dirstamp 41 | m4/libtool.m4 42 | m4/lt*.m4 43 | bak 44 | audacious-uade-* 45 | *.tar.bz2 46 | debian/changelog 47 | build 48 | build-* 49 | test-driver 50 | *.log 51 | *.trs 52 | .metals 53 | .scala-build 54 | .bsp 55 | *.wasm 56 | *.worker.js 57 | *.aarch64.elf 58 | *.com.dbg 59 | *.pkg.tar.* 60 | .clangd 61 | -------------------------------------------------------------------------------- /scripts/crossbuild/tizen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #autoreconf -i 6 | 7 | PLATFORM=8.0 8 | 9 | #TARGET=aarch64-linux-gnu 10 | #HOST=aarch64-tizen-linux-gnu 11 | #DEVICE=tizen-8.0-device64.core 12 | TARGET=x86_64-linux-gnu 13 | HOST=x86_64-tizen-linux-gnu 14 | DEVICE=tizen-8.0-emulator64.core 15 | 16 | BIN="/opt/cross/tizen-studio/tools/$TARGET-gcc-9.2/bin" 17 | export PATH="$BIN:$PATH" 18 | export PKG_CONFIG_PATH=/dev/null 19 | export PKG_CONFIG_LIBDIR=/dev/null 20 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 21 | 22 | SYSROOT=/opt/cross/tizen-studio/platforms/tizen-$PLATFORM/tizen/rootstraps/$DEVICE \ 23 | CFLAGS="--sysroot=$SYSROOT" CXXFLAGS="--sysroot=$SYSROOT" LDFLAGS="--sysroot=$SYSROOT" \ 24 | CC=$TARGET-gcc CXX=$TARGET-g++ \ 25 | ./configure --host=$HOST --with-sysroot=$SYSROOT 26 | 27 | make clean 28 | 29 | make -j check 30 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/xbox360.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Xbox 360 does not actually build yet 6 | 7 | export DEVKITXENON="/usr/local/xenon" 8 | export PATH="$PATH:$DEVKITXENON/bin:$DEVKITXENON/usr/bin" 9 | 10 | if [ $# -eq 0 ] 11 | then 12 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 13 | --entrypoint /bin/sh free60/libxenon \ 14 | $0 build 15 | else 16 | CC=xenon-gcc CXX=xenon-g++ LD=xenon-ld AR=xenon-ar RANLIB=xenon-ranlib AS=xenon-as NM=xenon-nm \ 17 | CPPFLAGS="-DXENON -isystem ${DEVKITXENON}/usr/include" \ 18 | CFLAGS="-m32 -maltivec -fno-pic -mpowerpc64 -mhard-float" CXXFLAGS="${CFLAGS}" \ 19 | LDFLAGS="-L${DEVKITXENON}/xenon/lib/32 -L${DEVKITXENON}/usr/lib -Wl,--script,${DEVKITXENON}/app.lds -lxenon" \ 20 | ./configure --host=ppc-elf 21 | make clean 22 | make -j check 23 | fi 24 | -------------------------------------------------------------------------------- /src/converter/converter.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | //#define DEBUG_TRACE 1 10 | 11 | #ifndef TRACE 12 | #ifdef DEBUG_TRACE 13 | # define TRACE(fmt,...) fprintf(stderr, fmt, ## __VA_ARGS__) 14 | #else 15 | # define TRACE(fmt,...) while (0) 16 | #endif 17 | #endif 18 | 19 | namespace converter { 20 | 21 | struct ConverterResult { 22 | bool success = false; 23 | std::string ext; 24 | std::string format; 25 | std::vector data; 26 | std::string reason_failed; 27 | }; 28 | 29 | constexpr int MAGIC_SIZE = 4; 30 | bool needs_conversion(const char *buf, size_t size) noexcept; 31 | ConverterResult convert(const char *buf, size_t size) noexcept; 32 | 33 | } // namespace converter 34 | -------------------------------------------------------------------------------- /src/test/player/test_player_libxmp_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libxmp 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # using precalc as libxmp is used as system/external library 12 | 13 | export PLAYER=${player} 14 | 15 | TESTMOD="${top_srcdir}/testdata/burgertime mix.xm" 16 | TEST_NAME="libxmp + subsongs" 17 | TEST="${PRECALC} \"${TESTMOD}\"" 18 | EXPECTED_OUTPUT="8ef21f4e65561e96a6a649ded86460dd 0 88193 player libxmp FastTracker v2.00 XM 1.04 8 131847 115bcbd7 19 | 8ef21f4e65561e96a6a649ded86460dd 1 5767 player 20 | 8ef21f4e65561e96a6a649ded86460dd 2 5124 player 21 | 8ef21f4e65561e96a6a649ded86460dd 3 5103 player 22 | 8ef21f4e65561e96a6a649ded86460dd 4 34521 player 23 | 8ef21f4e65561e96a6a649ded86460dd 5 76237 player 24 | 8ef21f4e65561e96a6a649ded86460dd 6 49532 player" 25 | 26 | . $(dirname "$0")/../common/check.sh 27 | 28 | exit 0 29 | -------------------------------------------------------------------------------- /src/common/std/functional.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2024-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #if __has_include() 7 | #include 8 | #elif __has_include() 9 | #include 10 | #endif 11 | 12 | // std::not_fn is available in GCC/libstdc++-7+, Clang/libc++-7+, but __cpp_lib_not_fn not defined 13 | #if defined(__cpp_lib_not_fn) \ 14 | || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7) \ 15 | || (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 7000) 16 | #include 17 | #else 18 | #include 19 | #ifndef __cpp_lib_experimental_not_fn 20 | #error "std::not_fn or std::experimental::not_fn is required!" 21 | #endif 22 | namespace std { 23 | template 24 | const auto not_fn = experimental::not_fn; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /src/test/player/test_player_libopenmpt_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | player=libopenmpt 6 | 7 | . $(dirname "$0")/../common/header.sh 8 | 9 | # 10 | 11 | # using precalc as libopenmpt is used as system/external library 12 | 13 | export PLAYER=${player} 14 | 15 | TESTMOD="${top_srcdir}/testdata/burgertime mix.xm" 16 | TEST_NAME="libopenmpt + subsongs" 17 | TEST="${PRECALC} \"${TESTMOD}\"" 18 | EXPECTED_OUTPUT="8ef21f4e65561e96a6a649ded86460dd 0 88188 player libopenmpt FastTracker 2 or compatible 8 131847 115bcbd7 19 | 8ef21f4e65561e96a6a649ded86460dd 1 5751 player 20 | 8ef21f4e65561e96a6a649ded86460dd 2 5112 player 21 | 8ef21f4e65561e96a6a649ded86460dd 3 5092 player 22 | 8ef21f4e65561e96a6a649ded86460dd 4 34508 player 23 | 8ef21f4e65561e96a6a649ded86460dd 5 76226 player 24 | 8ef21f4e65561e96a6a649ded86460dd 6 49526 player" 25 | 26 | . $(dirname "$0")/../common/check.sh 27 | 28 | exit 0 29 | -------------------------------------------------------------------------------- /scripts/crossbuild/cosmocc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # NOTE: building/linking fat binaries directly does not seem to work (libtool issue?) 6 | # TODO separate build dirs + apelink to produce fat binaries ? 7 | 8 | ARCH="${ARCH:=aarch64}" 9 | WRAPPER="${WRAPPER:=ape}" 10 | #ARCH=x86_64 11 | #WRAPPER=ape-x86_64.macho 12 | #WRAPPER=ape-aarch64.elf 13 | #WRAPPER=ape-x86_64.elf 14 | 15 | #autoreconf -i 16 | 17 | export PATH="/opt/cross/cosmocc/bin:$PATH" 18 | export PKG_CONFIG_PATH=/dev/null 19 | export PKG_CONFIG_LIBDIR=/dev/null 20 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 21 | 22 | #CC=cosmocc CXX=cosmoc++ AR=cosmoar 23 | CC=${ARCH}-unknown-cosmo-cc CXX=${ARCH}-unknown-cosmo-c++ AR=${ARCH}-unknown-cosmo-ar \ 24 | LD=${ARCH}-linux-cosmo-ld RANLIB=${ARCH}-linux-cosmo-ranlib \ 25 | ./configure --host=${ARCH}-unknown-none 26 | 27 | make clean 28 | 29 | WRAPPER="${WRAPPER}" make -j check 30 | -------------------------------------------------------------------------------- /scripts/crossbuild/ios.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | # iOS binaries not tested 6 | 7 | export PKG_CONFIG_PATH=/dev/null 8 | export PKG_CONFIG_LIBDIR=/dev/null 9 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 10 | 11 | # TODO parametrina SDK ? 12 | Build() { 13 | export CFLAGS="${ARCH_FLAGS} -isysroot $(xcrun --sdk ${SDK} --show-sdk-path)" 14 | export CXXFLAGS="${CFLAGS}" 15 | ./configure --host="${CHOST}" 16 | make clean 17 | # TODO wrapper for tests 18 | make -j check 19 | } 20 | CHOST="${CHOST:=arm-apple-darwin}" 21 | #CHOST="x86_64-apple-darwin" 22 | ARCH_FLAGS="${ARCH_FLAGS}" 23 | #ARCH_FLAGS="-arch x86_64" 24 | SDK="${SDK:=iphonesimulator}" 25 | #SDK="iphonesimulator" 26 | #SDK="iphoneos" 27 | #SDK="xros" 28 | #SDK="xrsimulator" 29 | 30 | # needs custom UADE support, no fork/exec 31 | #SDK="watchos" 32 | #SDK="watchsimulator" 33 | #SDK="appletvos" 34 | #SDK="appletvsimulator" 35 | 36 | Build 37 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/protrekkr2_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | #include 3 | #include 4 | #include 5 | 6 | #include "protrekkr2.h" 7 | 8 | using namespace std; 9 | 10 | namespace replay::protrekkr2::probe { 11 | char artist[20]; 12 | char style[20]; 13 | char SampleName[128][16][64]; 14 | int Midiprg[128]; 15 | char nameins[128][20]; 16 | int Chan_Midi_Prg[MAX_TRACKS]; 17 | char Chan_History_State[256][MAX_TRACKS]; 18 | // sound driver 19 | int AUDIO_Latency = 0; 20 | int AUDIO_Play_Flag = 0; 21 | int done = 0; 22 | #include "src/editors/patterns_blocks.cpp" 23 | #include "src/files/303s.cpp" 24 | #include "src/files/files.cpp" 25 | #include "src/files/reverbs.cpp" 26 | #include "src/files/synths.cpp" 27 | #include "release/distrib/replay/lib/replay.cpp" 28 | #include "release/distrib/replay/lib/synth.cpp" 29 | #include "release/distrib/replay/lib/tb_303.cpp" 30 | } 31 | -------------------------------------------------------------------------------- /src/songdb/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | noinst_LTLIBRARIES += \ 4 | songdb/libsongdb.la 5 | 6 | songdb_libsongdb_la_SOURCES = \ 7 | songdb/internal.h \ 8 | songdb/songdb.h \ 9 | songdb/songdb.cc \ 10 | songdb/blacklist.cc 11 | 12 | hash_idx_size=`cat $(top_srcdir)/conf/songdb/xxh32idx.tsv | wc -l | xargs` 13 | songlengths_size=`cat $(top_srcdir)/conf/songdb/songlengths.tsv | wc -l | xargs` 14 | modinfos_size=`cat $(top_srcdir)/conf/songdb/modinfos.tsv | wc -l | xargs` 15 | metadata_size=`cat $(top_srcdir)/conf/songdb/metadata.tsv | wc -l | xargs` 16 | 17 | songdb_libsongdb_la_CPPFLAGS = $(AM_CPPFLAGS) \ 18 | -DHASH_IDX_SIZE=$(hash_idx_size) \ 19 | -DSONGLENGTHS_SIZE=$(songlengths_size) \ 20 | -DMODINFOS_SIZE=$(modinfos_size) \ 21 | -DMETADATA_SIZE=$(metadata_size) 22 | -------------------------------------------------------------------------------- /src/converter/converter.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #include 5 | 6 | #include "converter/converter.h" 7 | 8 | using namespace std; 9 | 10 | namespace converter::med { 11 | 12 | bool isMED4(const char *buf, const size_t size) noexcept; 13 | ConverterResult convertMED4(const char *buf, size_t size) noexcept; 14 | 15 | } // namespace converter::med 16 | 17 | namespace converter { 18 | 19 | thread_local jmp_buf error_handler; 20 | 21 | bool needs_conversion(const char *buf, const size_t size) noexcept { 22 | return med::isMED4(buf, size); 23 | } 24 | 25 | ConverterResult convert(const char *buf, const size_t size) noexcept { 26 | ConverterResult res {}; 27 | 28 | if (!med::isMED4(buf, size)) { 29 | res.reason_failed = "unsupported file"; 30 | return res; 31 | } 32 | 33 | res = med::convertMED4(buf, size); 34 | 35 | return res; 36 | } 37 | 38 | } // namespace converter 39 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | DIST_SUBDIRS = src 4 | 5 | if PLAYER_uade 6 | subdirs_extra += uade/src/frontends/common 7 | endif 8 | 9 | SUBDIRS = $(subdirs_extra) $(DIST_SUBDIRS) 10 | 11 | EXTRA_DIST = \ 12 | COPYING.LGPL \ 13 | NOTICE \ 14 | conf \ 15 | scripts/audacious-uade.spec \ 16 | scripts/debian \ 17 | scripts/make_deb.sh \ 18 | scripts/make_rpm.sh \ 19 | testdata \ 20 | screenshots 21 | 22 | AM_DISTCHECK_DVI_TARGET = 23 | DISTCHECK_CONFIGURE_FLAGS = \ 24 | --with-audacious-plugindir="$$dc_install_base/lib/audacious" \ 25 | --with-deadbeef-plugindir="$$dc_install_base/lib/deadbeef" 26 | 27 | install installdirs: SUBDIRS = src 28 | uninstall uninstalldirs: SUBDIRS = src 29 | 30 | dist-hook: 31 | $(MKDIR_P) "$(distdir)/uade" 32 | cd uade && git ls-files | tar Tc - | tar x -C "../$(distdir)/uade" 33 | 34 | distclean-local: 35 | if test "$(srcdir)" != "."; then \ 36 | rm -rf uade; \ 37 | fi 38 | rm -rf $(top_builddir)/build-tmp 39 | 40 | clean-local: 41 | rm -rf $(top_builddir)/build-tmp 42 | -------------------------------------------------------------------------------- /scripts/crossbuild/amigaos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #autoreconf -i 6 | 7 | if [ $# -gt 0 ] 8 | then 9 | top_dir=$(realpath $(dirname "$0")/../..) 10 | CPPFLAGS="\ 11 | -DUADE_CORE_FILE=\\\"${top_dir}/uade/src/uadecore\\\" \ 12 | -DUADE_BASE_DIR=\\\"${top_dir}/build-tmp/uade\\\" \ 13 | -DSONGDB_DIR=\\\"top_dir:conf/songdb\\\"" 14 | fi 15 | 16 | export PATH="/opt/cross/amigaos/bin:$PATH" 17 | export PKG_CONFIG_PATH=/dev/null 18 | export PKG_CONFIG_LIBDIR=/dev/null 19 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 20 | 21 | CPPFLAGS="${CPPFLAGS}" \ 22 | ./configure --host=m68k-amigaos 23 | 24 | make clean 25 | 26 | make -j 27 | 28 | if [ $# -gt 0 ] 29 | then 30 | # TODO vamos doesn't support env variables (PLAYER_ENDIAN) 31 | # TODO UADE doesn't work with vamos (PIPE: not supported) 32 | # XXX vamos fails with multiple concurrent instances 33 | WRAPPER="$(which vamos || echo vamos) -C 020 -s 16 -m 262144 -H disable -V top_dir:${top_dir}" \ 34 | make check 35 | else 36 | make -j check 37 | fi 38 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2drivers/hq_m.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #ifndef AUDACIOUS_UADE 5 | #include 6 | #include "../cpu.h" 7 | #include "../it_structs.h" 8 | #endif 9 | 10 | #define RAMPSPEED 8 /* slightly faster than SB16 MMX driver */ 11 | 12 | #if CPU_32BIT 13 | 14 | #define CUBIC_PHASES 4096 15 | #define CUBIC_PHASES_BITS 12 16 | 17 | #else 18 | 19 | #define CUBIC_PHASES 8192 20 | #define CUBIC_PHASES_BITS 13 21 | 22 | #endif 23 | 24 | // don't change these! 25 | 26 | #define CUBIC_WIDTH 4 27 | #define CUBIC_WIDTH_BITS 2 28 | #define CUBIC_LUT_LEN (CUBIC_WIDTH * CUBIC_PHASES) 29 | 30 | #if CPU_32BIT 31 | #define CUBIC_FSHIFT (16-(CUBIC_PHASES_BITS+CUBIC_WIDTH_BITS)) 32 | #else 33 | #define CUBIC_FSHIFT (32-(CUBIC_PHASES_BITS+CUBIC_WIDTH_BITS)) 34 | #endif 35 | 36 | #define CUBIC_FMASK ((CUBIC_WIDTH*CUBIC_PHASES)-CUBIC_WIDTH) 37 | 38 | typedef void (*MixFunc_t)(slaveChn_t *sc, float *fMixBufPtr, int32_t numSamples); 39 | 40 | extern const MixFunc_t HQ_MixFunctionTables[16]; 41 | -------------------------------------------------------------------------------- /scripts/crossbuild/openharmony.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # OpenHarmony binaries not tested 6 | 7 | #autoreconf -i 8 | 9 | HOST=aarch64-linux-ohos 10 | #HOST=x86_64-unknown-linux-ohos 11 | TARGET=aarch64-unknown-linux-ohos 12 | #TARGET=x86_64-unknown-linux-ohos 13 | BIN="/opt/cross/openharmony/native/llvm/bin" 14 | # XXX OS 'ohos' not recognized 15 | if ! grep -q ohos config.sub ; then 16 | gsed -i 's/ ultrix\* \| irix\* / ohos\* \| ultrix\* \| irix\* /g' config.sub 17 | gsed -i 's/none--\*)/\*-ohos\*- \| none--\*)/g' config.sub 18 | fi 19 | export PATH="$BIN:$PATH" 20 | export PKG_CONFIG_PATH=/dev/null 21 | export PKG_CONFIG_LIBDIR=/dev/null 22 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 23 | 24 | SYSROOT=/opt/cross/openharmony/native/sysroot \ 25 | CFLAGS="--sysroot=$SYSROOT" CXXFLAGS="--sysroot=$SYSROOT" LDFLAGS="--sysroot=$SYSROOT -fuse-ld=lld" \ 26 | CC=$TARGET-clang CXX=$TARGET-clang++ LD=ld.lld AR=llvm-ar RANLIB=llvm-ranlib \ 27 | ./configure --host=$HOST --with-sysroot=$SYSROOT 28 | 29 | make clean 30 | 31 | make -j check 32 | -------------------------------------------------------------------------------- /src/3rdparty/replay/libdigibooster3/CHANGELOG: -------------------------------------------------------------------------------- 1 | version 1.2 (13.02.2014) 2 | ------------------------ 3 | 4 | - All systems: added missing newlines at end of "dbminfo.c" and dbm2wav.c". 5 | - All systems: Executables are built without '-s' flag, then stripped 6 | separately. Using '-s' produces crashing executables on AmigaOS 4. 7 | - All systems: added missing dependencies for "dbminfo.o" and "dbm2wav.o" in 8 | the makefile. 9 | - AmigaOS4: Fixed broken declaration of 'IDOS' interface. 10 | - AmigaOS4: AllocVecTags() used for memory allocation. 11 | 12 | 13 | version 1.1 (09.02.2014) 14 | ------------------------ 15 | 16 | - Added Win32 project for Visual C++. 17 | - Added compiled *.lib for Win32 and compiled 'dbminfo' and 'dbm2wav' 18 | executables. 19 | - Platform tested: Win32/x86 [VC++]. 20 | - Platform tested: Linux/aarch64. 21 | - Platform tested: Linux/x86_64. 22 | - Platform tested: MacOS X/x86_64 [Clang]. 23 | 24 | 25 | version 1.0 (09.02.2014) 26 | ------------------------ 27 | 28 | - Initial release. 29 | - Platform tested: MorphOS/PowerPC. 30 | - Platform tested: Linux/x86. 31 | -------------------------------------------------------------------------------- /scripts/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname=audacious-uade 2 | pkgver=$(cat ../VERSION | sed 's/-/_/g') 3 | pkgrel=1 4 | pkgdesc="UADE plugin for Audacious and DeaDBeeF" 5 | arch=('any') 6 | url="https://github.com/mvtiaine/audacious-uade" 7 | license=('GPL') 8 | depends=('audacious' 'libopenmpt') 9 | # libxmp and deadbeef in AUR 10 | optdepends=( 11 | 'libxmp: support for additional formats' 12 | 'deadbeef: DeaDBeeF plugin' 13 | ) 14 | makedepends=('autoconf' 'automake' 'libtool' 'which' 'make' 'pkg-config') 15 | 16 | # NOTE: DeaDBeeF plugin is also built/installed if deadbeef is installed 17 | build() { 18 | cd "$startdir"/.. 19 | autoreconf -i 20 | ./configure >/dev/null 2>&1 21 | make distclean >/dev/null 2>&1 22 | mkdir -p build-arch 23 | cd build-arch 24 | rm -rf * 25 | ../configure \ 26 | --enable-plugin-audacious=yes \ 27 | --with-static-stdlibs=no \ 28 | --prefix=/usr 29 | make -j 30 | } 31 | 32 | check() { 33 | cd "$startdir/../build-arch" 34 | make -j check 35 | } 36 | 37 | package() { 38 | cd "$startdir/../build-arch" 39 | make DESTDIR="$pkgdir/" install 40 | } 41 | -------------------------------------------------------------------------------- /scripts/crossbuild/ps4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # PS4 binaries not tested 6 | 7 | # autoreconf -i 8 | 9 | export OO_PS4_TOOLCHAIN=/opt/cross/OpenOrbis/PS4Toolchain 10 | TOOLCHAIN=${OO_PS4_TOOLCHAIN} 11 | 12 | export PKG_CONFIG_PATH=/dev/null 13 | export PKG_CONFIG_LIBDIR=/dev/null 14 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 15 | 16 | # XXX OS 'ps4' not recognized 17 | if ! grep -q ps4 config.sub ; then 18 | gsed -i 's/ ultrix\* \| irix\* / ps4\* \| ultrix\* \| irix\* /g' config.sub 19 | gsed -i 's/none--\*)/\*-ps4\*- \| none--\*)/g' config.sub 20 | fi 21 | 22 | CC=clang CXX=clang++ LD=ld.lld \ 23 | CPPFLAGS="-isysroot ${TOOLCHAIN} -isystem ${TOOLCHAIN}/include" \ 24 | CFLAGS="-nostdlib --target=x86_64-pc-freebsd12-elf -fPIC" \ 25 | CXXFLAGS="${CFLAGS} -isystem ${TOOLCHAIN}/include/c++/v1" \ 26 | LDFLAGS="-fuse-ld=lld -Wl,-m,elf_x86_64 -pie -Wl,--script,${TOOLCHAIN}/link.x -L${TOOLCHAIN}/lib -lc -lkernel -lc++ -Xcompiler ${TOOLCHAIN}/lib/crt1.o" \ 27 | ./configure --host=x86_64-scei-ps4 --with-sysroot=${TOOLCHAIN} \ 28 | --enable-plugin-deadbeef=no # XXX header paths messed up? 29 | 30 | make clean 31 | make -j check 32 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it_d_rm.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | #include "it_structs.h" 9 | #endif 10 | 11 | enum 12 | { 13 | FORMAT_UNKNOWN = 0, 14 | FORMAT_IT = 1, 15 | FORMAT_S3M = 2 16 | }; 17 | 18 | // routines for handling data in RAM as a "FILE" type (IT2 doesn't have these) 19 | typedef struct mem_t 20 | { 21 | bool _eof; 22 | uint8_t *_ptr, *_base; 23 | uint32_t _cnt, _bufsiz; 24 | } MEMFILE; 25 | 26 | MEMFILE *mopen(const uint8_t *src, uint32_t length); 27 | void mclose(MEMFILE **buf); 28 | size_t mread(void *buffer, size_t size, size_t count, MEMFILE *buf); 29 | size_t mtell(MEMFILE *buf); 30 | int32_t meof(MEMFILE *buf); 31 | void mseek(MEMFILE *buf, size_t offset, int32_t whence); 32 | bool ReadBytes(MEMFILE *m, void *dst, uint32_t num); 33 | // ------------------------------------------------------- 34 | 35 | bool Music_LoadFromData(uint8_t *Data, uint32_t DataLen); 36 | bool Music_LoadFromFile(const char *Filename); 37 | void Music_FreeSong(void); 38 | 39 | -------------------------------------------------------------------------------- /src/test/common/header.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ "$player" != "" ] && [ "$players" != "all" ] && ! printf ",${players}," | grep -Eq ",${player},"; then 6 | exit 77 7 | fi 8 | 9 | DIRNAME=$(dirname "$0") 10 | : ${top_srcdir:="$DIRNAME/../../.."} 11 | : ${top_builddir:="$DIRNAME/../../.."} 12 | 13 | echo top_builddir=$top_builddir 14 | echo top_srcdir=$top_srcdir 15 | 16 | BIG=0 17 | LITTLE=1 18 | ENDIAN=$(echo -n I | od -to2 | head -n1 | tr -d "[:blank:]" | tail -c2) 19 | 20 | MD5=${top_builddir}/src/test/md5 21 | CONVERTER=${top_builddir}/src/plugin/cli/converter/converter 22 | PRECALC="${top_builddir}/src/plugin/cli/precalc/precalc" 23 | SONGEND="${top_builddir}/src/plugin/cli/songend/songend" 24 | PLAYER="${top_builddir}/src/plugin/cli/player/player 8062" 25 | SONGDB_BIN=${top_builddir}/src/plugin/cli/songdb/songdb 26 | SONGDB_DIR=${top_srcdir}/conf/songdb 27 | 28 | if [ "${WRAPPER}" != "" ]; then 29 | MD5="${WRAPPER} ${MD5}" 30 | CONVERTER="${WRAPPER} ${CONVERTER}" 31 | PRECALC="${WRAPPER} ${PRECALC}" 32 | SONGEND="${WRAPPER} ${SONGEND}" 33 | PLAYER="${WRAPPER} ${PLAYER}" 34 | SONGDB_BIN="${WRAPPER} ${SONGDB_BIN}" 35 | fi 36 | -------------------------------------------------------------------------------- /src/plugin/cli/common/logger.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | namespace logger { 10 | 11 | void debug(const char */*file*/, int /*line*/, const char */*func*/, const char *fmt, ...) noexcept { 12 | va_list args; 13 | va_start(args, fmt); 14 | vfprintf(stderr, fmt, args); 15 | va_end(args); 16 | } 17 | 18 | void info(const char */*file*/, int /*line*/, const char */*func*/, const char *fmt, ...) noexcept { 19 | va_list args; 20 | va_start(args, fmt); 21 | vfprintf(stderr, fmt, args); 22 | va_end(args); 23 | } 24 | 25 | void warn(const char */*file*/, int /*line*/, const char */*func*/, const char *fmt, ...) noexcept { 26 | va_list args; 27 | va_start(args, fmt); 28 | vfprintf(stderr, fmt, args); 29 | va_end(args); 30 | } 31 | 32 | void error(const char */*file*/, int /*line*/, const char */*func*/, const char *fmt, ...) noexcept { 33 | va_list args; 34 | va_start(args, fmt); 35 | vfprintf(stderr, fmt, args); 36 | va_end(args); 37 | } 38 | 39 | } // namespace logger 40 | -------------------------------------------------------------------------------- /src/3rdparty/replay/st23play/st23play.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | // for endianess check 9 | #include "config.h" 10 | // XXX fix AIX build 11 | #undef hz 12 | 13 | #define AUDACIOUS_UADE 1 14 | 15 | #define ST23PLAY(ns) \ 16 | namespace ns { \ 17 | extern bool restarted, moduleLoaded; \ 18 | extern uint8_t vpnt; \ 19 | extern int32_t oversamplingFactor; \ 20 | extern double *dMixBuffer; \ 21 | bool loadSTM(const uint8_t *dat, uint32_t modLen); \ 22 | bool st23play_PlaySong(const uint8_t *moduleData, uint32_t dataLength, uint32_t audioFreq); \ 23 | void st23play_Close(void); \ 24 | void st23play_FillAudioBuffer(int16_t *buffer, int32_t samples); \ 25 | void reset(); \ 26 | inline void clearMixBuffer() { \ 27 | constexpr int MIX_BUF_SAMPLES = 4096; \ 28 | if (dMixBuffer) memset(dMixBuffer, 0, MIX_BUF_SAMPLES * sizeof (double) * oversamplingFactor); \ 29 | } \ 30 | } 31 | 32 | ST23PLAY(replay::st23play::play) 33 | #ifdef PLAYER_PROBE 34 | ST23PLAY(replay::st23play::probe) 35 | #else 36 | namespace replay::st23play { namespace probe = replay::st23play::play; } 37 | #endif 38 | -------------------------------------------------------------------------------- /src/songend/detector.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "common/endian.h" 12 | 13 | namespace songend::detector { 14 | 15 | class SongEndDetector { 16 | 17 | public: 18 | SongEndDetector(int rate, bool stereo, std::endian endian) noexcept : 19 | rate(rate), stereo(stereo), endian(endian) {} 20 | 21 | void update(const char *bytes, int nbytes) noexcept; 22 | 23 | int detect_loop() noexcept; 24 | 25 | int detect_silence(int seconds) noexcept; 26 | int detect_volume(int seconds) noexcept; 27 | int detect_repeat() noexcept; 28 | 29 | int trim_silence(int offs_millis) noexcept; 30 | int trim_volume(int offs_millis) noexcept; 31 | 32 | const int rate; 33 | const bool stereo; 34 | const std::endian endian; 35 | private: 36 | std::vector buf; 37 | int16_t tmp[8]; 38 | int itmp = 0; 39 | int ctmp = 0; 40 | int maxi = INT8_MIN; 41 | int mini = INT8_MAX; 42 | bool audio = false; 43 | }; 44 | 45 | }; // namespace songend 46 | -------------------------------------------------------------------------------- /scripts/crossbuild/sailfish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # TODO testaa kääntää puhelimella suoraan (ja että samat build_meego/host_* variablet) 6 | 7 | #autoreconf -i 8 | 9 | #TARGET=aarch64-meego-linux-gnu # missing aarch64 target in docker image? 10 | #SYSROOT=/srv/mer/targets/SailfishOS-4.5.0.18-aarch64 11 | #TARGET=armv7hl-meego-linux-gnueabi 12 | #SYSROOT=/srv/mer/targets/SailfishOS-4.5.0.18-armv7hl 13 | TARGET=i486-meego-linux-gnu 14 | SYSROOT=/srv/mer/targets/SailfishOS-4.5.0.18-i486 15 | BIN=/srv/mer/toolings/SailfishOS-4.5.0.18/opt/cross/bin:/srv/mer/toolings/SailfishOS-4.5.0.18/usr/bin 16 | 17 | if [ $# -eq 0 ] 18 | then 19 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 20 | --entrypoint /bin/bash r1tschy/sailfishos-platform-sdk \ 21 | $0 build 22 | else 23 | # XXX ugly hack 24 | sudo ln -s $BIN/$TARGET-as /usr/local/bin/as 25 | sudo ln -s $BIN/$TARGET-ld /usr/local/bin/ld 26 | export PATH="$BIN:$PATH" 27 | 28 | CPP="$TARGET-cpp --sysroot=$SYSROOT" CXXCPP="$CPP" \ 29 | CFLAGS="--sysroot=$SYSROOT" CXXFLAGS="--sysroot=$SYSROOT" LDFLAGS="--sysroot=$SYSROOT" \ 30 | ./configure --host=$TARGET --with-sysroot=$SYSROOT 31 | 32 | make clean 33 | 34 | make -j check 35 | fi 36 | -------------------------------------------------------------------------------- /src/3rdparty/miniz/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013-2014 RAD Game Tools and Valve Software 2 | Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC 3 | 4 | All Rights Reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /scripts/crossbuild/android.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Android binaries not tested 6 | 7 | export NDK=/opt/cross/android/NDK 8 | 9 | # Only choose one of these, depending on your build machine... 10 | export TOOLCHAIN="${TOOLCHAIN:=$NDK/toolchains/llvm/prebuilt/darwin-x86_64}" 11 | #export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/darwin-x86_64 12 | #export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64 13 | # Only choose one of these, depending on your device... 14 | export TARGET="${TARGET:=aarch64-linux-android}" 15 | #export TARGET=aarch64-linux-android 16 | #export TARGET=armv7a-linux-androideabi 17 | #export TARGET=i686-linux-android 18 | #export TARGET=x86_64-linux-android 19 | # Set this to your minSdkVersion. 20 | export API="${API:=21}" 21 | #export API=21 22 | # Configure and build. 23 | export AR=$TOOLCHAIN/bin/llvm-ar 24 | export CC=$TOOLCHAIN/bin/$TARGET$API-clang 25 | export AS=$CC 26 | export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++ 27 | export LD=$TOOLCHAIN/bin/ld 28 | export RANLIB=$TOOLCHAIN/bin/llvm-ranlib 29 | export STRIP=$TOOLCHAIN/bin/llvm-strip 30 | 31 | export PKG_CONFIG_PATH=/dev/null 32 | export PKG_CONFIG_LIBDIR=/dev/null 33 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 34 | 35 | ./configure --host $TARGET 36 | make clean 37 | # TODO wrapper for tests 38 | make -j check 39 | -------------------------------------------------------------------------------- /src/3rdparty/README: -------------------------------------------------------------------------------- 1 | The following software is vendored here: 2 | 3 | - miniz 3.0.2 (MIT) - https://github.com/richgel999/miniz 4 | - proplayer.h (OctaMED-Soundstudio-Player) - https://aminet.net/package/dev/src/OcSS_src 5 | - SimpleBinStream.h 1.0.4 (MIT) - https://github.com/shaovoon/simplebinstream 6 | - xxHash v0.8.3 (BSD-2-Clause) - https://github.com/Cyan4973/xxHash 7 | 8 | - ft2play (BSD-3-Clause) - https://github.com/8bitbubsy/ft2play 9 | - HivelyTracker 1.9 (BSD-3-Clause) - https://github.com/pete-gordon/hivelytracker 10 | - it2play (BSD-3-Clause) - https://github.com/8bitbubsy/it2play 11 | - libdigibooster3 1.2 (BSD-2-Clause) - https://github.com/grzegorz-kraszewski/libdigibooster3 12 | - NoiseTrekker2 final - https://web.archive.org/web/20001009054141fw_/http://www.geocities.com/SiliconValley/Monitor/5269/download.htm 13 | - ProTrekkr v1.99e (BSD-2-Clause) - https://code.google.com/archive/p/protrekkr/ 14 | - ProTrekkr v2.8.1 (BSD-2-Clause) - https://github.com/hitchhikr/protrekkr 15 | - st23play v0.35 (BSD-3-Clause) - https://pastebin.com/ifXSCZ71 16 | - st3play v1.0.1 (BSD-3-Clause) - https://pastebin.com/AwRXZAw7 17 | 18 | Note that I have made modifications to some of the sources, see git history of the subdirectories or files for details. 19 | Also not all files from the original distributions are included. 20 | -------------------------------------------------------------------------------- /scripts/make_rpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TOOL=$(which dnf 2>/dev/null) 4 | if [ -z "$TOOL" ]; then 5 | TOOL=$(which zypper 2>/dev/null) 6 | if [ -z "$TOOL" ]; then 7 | TOOL=$(which yum 2>/dev/null) 8 | if [ -z "$TOOL" ]; then 9 | echo Could not find dnf, zypper or yum 10 | exit 1 11 | fi 12 | fi 13 | fi 14 | 15 | set -e 16 | 17 | VERSION=$(cat VERSION) 18 | 19 | sudo $TOOL install rpmdevtools rpm-build audacious-devel libopenmpt-devel gcc-c++ make autoconf automake libtool pkg-config 20 | # libxmp not available on CentOS 21 | if [ -z "$(grep rhel /etc/os-release)" ]; then 22 | sudo $TOOL install libxmp-devel 23 | fi 24 | # NOTE: deadbeef not available on CentOS 25 | DEADBEEF="" 26 | if [ "$1" = "--with-deadbeef" ]; then 27 | sudo $TOOL install deadbeef deadbeef-devel 28 | DEADBEEF="--enable-plugin-deadbeef=yes --with-deadbeef-plugindir=/dev/null" 29 | DEADBEEF_RPM="--with deadbeef" 30 | fi 31 | autoreconf -i 32 | ./configure \ 33 | --with-static-stdlibs=no \ 34 | --enable-plugin-audacious=yes \ 35 | $DEADBEEF 36 | make clean 37 | make dist 38 | mkdir -p build-rpm 39 | cd build-rpm 40 | rm -rf * 41 | mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} 42 | ln -sf ../../../audacious-uade-${VERSION}.tar.bz2 rpmbuild/SOURCES/ 43 | HOME="${PWD}" rpmbuild -ba $DEADBEEF_RPM ../scripts/audacious-uade.spec 44 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/ft2play.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // for endianess check 15 | #include "config.h" 16 | 17 | #define AUDACIOUS_UADE 1 18 | 19 | namespace replay::ft2play { 20 | #include "tables.h" 21 | } 22 | namespace replay::ft2play::play { 23 | #include "pmplay.h" 24 | #include "pmp_mix.h" 25 | #include "snd_masm.h" 26 | // add noop impls to fix compile (not used for anything) 27 | inline void lockMixer(void) {} 28 | inline void unlockMixer(void) {} 29 | inline bool openMixer(int32_t mixingFrequency, int32_t mixingBufferSize) { assert(false); return false; } 30 | inline void closeMixer(void) {} 31 | } 32 | 33 | #ifdef PLAYER_PROBE 34 | namespace replay::ft2play::probe { 35 | #include "pmplay.h" 36 | #include "pmp_mix.h" 37 | #include "snd_masm.h" 38 | // add noop impls to fix compile (not used for anything) 39 | inline void lockMixer(void) {} 40 | inline void unlockMixer(void) {} 41 | inline bool openMixer(int32_t mixingFrequency, int32_t mixingBufferSize) { assert(false); return false; } 42 | inline void closeMixer(void) {} 43 | } 44 | #else 45 | namespace replay::ft2play { namespace probe = replay::ft2play::play; } 46 | #endif 47 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/README.md: -------------------------------------------------------------------------------- 1 | # it2play 2 | Aims to be an accurate C port of Impulse Tracker 2.15's IT replayer (with selectable IT2 sound drivers). \ 3 | This is a direct port of the original asm source codes. \ 4 | \ 5 | The project contains example code in the it2play folder on how to interface with the API. 6 | 7 | # Notes 8 | - The default driver (HQ) is my own, which has a floating-point mixer, better tempo (BPM) precision, 4-tap cubic spline interpolation and stereo sample support. 9 | - it2play uses integer arithmetics for pitch slides, just like IT2 versions before 2.15 (2.15 uses FPU code). \ 10 | This was done to match the IT2 versions most people were making music with. 2.15 was paid software, few people used it. 11 | - To compile it2play (the test program) on macOS/Linux, you need SDL2. TODO: Implement ALSA/JACK drivers. 12 | - When compiling, you need to pass the driver to use as a compiler pre-processor definition (f.ex. AUDIODRIVER_SDL, check "it_music.h") 13 | - There may be porting mistakes in the replayer, but the accuracy has been tested against quite a few songs, and seems to be accurate so far 14 | - The code may not be 100% thread-safe (or safe in general), and as such I don't really recommend using this replayer in serious projects. 15 | My primary goal was to create an accurate C port that people can use for reference, or for personal use. 16 | 17 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/cpu.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #ifndef AUDACIOUS_UADE 5 | #include 6 | #endif 7 | 8 | #ifdef _WIN32 9 | 10 | #ifdef _WIN64 11 | #define CPU_32BIT 0 12 | #define CPU_64BIT 1 13 | #else 14 | #define CPU_32BIT 1 15 | #define CPU_64BIT 0 16 | #endif 17 | 18 | #else 19 | #ifndef AUDACIOUS_UADE 20 | #include 21 | #endif 22 | 23 | #if __WORDSIZE == 64 24 | #define CPU_32BIT 0 25 | #define CPU_64BIT 1 26 | #else 27 | #define CPU_32BIT 1 28 | #define CPU_64BIT 0 29 | #endif 30 | 31 | #endif 32 | 33 | #if CPU_64BIT 34 | #define CPU_BITS 64 35 | #define uintCPUWord_t uint64_t 36 | #define intCPUWord_t int64_t 37 | #else 38 | #define CPU_BITS 32 39 | #define uintCPUWord_t uint32_t 40 | #define intCPUWord_t int32_t 41 | #endif 42 | 43 | // mvtiaine: added big endian support 44 | #define SWAP16(value) \ 45 | ((uint16_t)( \ 46 | ((uint16_t)(value) << 8) | \ 47 | ((uint16_t)(value) >> 8) \ 48 | )) 49 | #define SWAP32(value) \ 50 | ((uint32_t)( \ 51 | ((uint32_t)(value) << 24) | \ 52 | (((uint32_t)(value) & 0x0000FF00U) << 8) | \ 53 | (((uint32_t)(value) & 0x00FF0000U) >> 8) | \ 54 | ((uint32_t)(value) >> 24) \ 55 | )) 56 | #ifdef WORDS_BIGENDIAN 57 | #define READ16LE(value) SWAP16(value) 58 | #define READ32LE(value) SWAP32(value) 59 | #else 60 | #define READ16LE(value) value 61 | #define READ32LE(value) value 62 | #endif 63 | -------------------------------------------------------------------------------- /src/3rdparty/replay/libdigibooster3/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Grzegorz Kraszewski 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | This software is provided by the copyright holders and contributors "as is" and 14 | any express or implied warranties, including, but not limited to the implied 15 | warranties of merchantability and fitness for a particular purpose are 16 | disclaimed. In no event shall the copyright owner or contributors be liable for 17 | any direct, indirect, incidental, special, exemplary, or consequential damages 18 | (including, but not limited to, procurement of substitute goods or services; 19 | loss of use, data, or profits; or business interruption) however caused and 20 | on any theory of liability, whether in contract strict liability or tort 21 | (including negligence or otherwise) arising in any way out of the use of this 22 | software, even if advised of the possibility of such damage. 23 | -------------------------------------------------------------------------------- /src/plugin/audacious/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | plugin_audacious_LTLIBRARIES = plugin/audacious/uade.la 4 | plugin_audacious_uade_la_SOURCES = \ 5 | plugin/common/copyright.h \ 6 | plugin/audacious/prefs.h \ 7 | plugin/audacious/uade_prefs.h \ 8 | plugin/audacious/logger.cc \ 9 | plugin/audacious/plugin.cc 10 | 11 | plugin/audacious/% : CXXFLAGS += -Wno-format-nonliteral -Wno-missing-field-initializers -Wno-deprecated-declarations 12 | 13 | plugin_audacious_uade_la_LIBADD = \ 14 | songend/libsongend.la \ 15 | songdb/libsongdb.la \ 16 | 3rdparty/libxxhash.la \ 17 | $(UADE_LIBS) \ 18 | $(LIBOPENMPT_LIBS) \ 19 | $(LIBXMP_LIBS) \ 20 | $(AUDACIOUS_LIBS) 21 | 22 | plugin_audacious_uade_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module -shared -no-undefined $(SHREXT) 23 | if BUILD_WINDOWS 24 | plugin_audacious_uade_la_LDFLAGS += -Xcompiler $(UADE_LIBS) 25 | if BUILD_CYGWIN 26 | plugin_audacious_uade_la_LDFLAGS += -Xcompiler -lcygwin 27 | endif 28 | if BUILD_MINGW 29 | if LD_GNU 30 | plugin_audacious_uade_la_LDFLAGS += -Xcompiler -lmsvcrt -Xcompiler -lmingwex -Xcompiler -lmsvcrt -Xcompiler -lkernel32 -Xcompiler -lws2_32 31 | endif 32 | endif 33 | endif 34 | if BUILD_NETBSD 35 | plugin_audacious_uade_la_LDFLAGS += -Xcompiler $(UADE_LIBS) 36 | endif 37 | plugin_audacious_uade_la_CXXFLAGS = $(AM_CXXFLAGS) $(AUDACIOUS_CFLAGS) $(LIBOPENMPT_CFLAGS) $(LIBXMP_CFLAGS) 38 | -------------------------------------------------------------------------------- /src/test/md5_main.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #include "common/md5.h" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | using namespace std; 12 | 13 | // Note, to support pipe + stdin with AmigaOS you need: Pipe-1.5 from Aminet, set _pchar | and using IN: as the file parameter, e.g. 14 | // set _pchar | 15 | // cat foo | md5 IN: 16 | 17 | int main(int argc, char *argv[]) { 18 | const string fname = argc < 2 ? "-" : argv[1]; 19 | bool is_stdin = (fname == "-"); 20 | 21 | int fd = -1; 22 | if (is_stdin) { 23 | fd = STDIN_FILENO; 24 | #ifdef __MINGW32__ 25 | setmode (fileno (stdin), 0x8000); 26 | #endif 27 | } else { 28 | FILE *f = fopen(fname.c_str(), "rb"); 29 | if (!f) { 30 | fprintf(stderr, "File not found: %s\n", fname.c_str()); 31 | return EXIT_FAILURE; 32 | } 33 | fd = fileno(f); 34 | } 35 | assert(fd >= 0); 36 | 37 | uint8_t buf[4096]; 38 | ssize_t count; 39 | MD5 md5; 40 | while ((count = read(fd, buf, sizeof buf)) > 0) { 41 | md5.update(buf, count); 42 | } 43 | if (!is_stdin) { 44 | close(fd); 45 | } 46 | md5.finalize(); 47 | string md5hex = md5.hexdigest(); 48 | fprintf(stdout, "%s\n", md5hex.c_str()); 49 | 50 | return EXIT_SUCCESS; 51 | } 52 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/nds.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # NDS does not actually build yet 6 | 7 | # XXX devkitpro/devkitarm outdated ? (missing ndsvars.sh which is included in devkitA64) 8 | 9 | # devkitarmvars.sh 10 | export DEVKITPRO=/opt/devkitpro 11 | export DEVKITARM=${DEVKITPRO}/devkitARM 12 | export PORTLIBS_ROOT=${DEVKITPRO}/portlibs 13 | export PATH=${DEVKITPRO}/tools/bin:$DEVKITARM/bin:$PATH 14 | export TOOL_PREFIX=arm-none-eabi- 15 | export CC=${TOOL_PREFIX}gcc 16 | export CXX=${TOOL_PREFIX}g++ 17 | export AR=${TOOL_PREFIX}gcc-ar 18 | export RANLIB=${TOOL_PREFIX}gcc-ranlib 19 | 20 | # ndsvars.sh 21 | PORTLIBS_PREFIX=${PORTLIBS_ROOT}/nds 22 | PATH=$PORTLIBS_PREFIX/bin:$PATH 23 | 24 | export CFLAGS="-march=armv5te -mtune=arm946e-s -O2 -ffunction-sections -fdata-sections" 25 | export CXXFLAGS="${CFLAGS}" 26 | export CPPFLAGS="-D__NDS__ -DARM9 -I${PORTLIBS_PREFIX}/include -I${DEVKITPRO}/libnds/include" 27 | export LDFLAGS="-L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libnds/lib" 28 | # must be set in configure.ac 29 | #export LIBS="-lnds9" 30 | 31 | if [ $# -eq 0 ] 32 | then 33 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 34 | --entrypoint /bin/sh devkitpro/devkitarm \ 35 | $0 build 36 | else 37 | apt update && apt install -y build-essential autoconf automake libtool pkg-config 38 | LDFLAGS="${LDFLAGS} -lnds9" \ 39 | ./configure --host=arm-none-eabi 40 | make clean 41 | make -j check 42 | fi 43 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (C) 2008-2024 Franck Charlet. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /src/common/logger.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2014-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | //#define DEBUG_TRACE 1 7 | 8 | namespace logger { 9 | 10 | void debug(const char *file, int line, const char *func, const char *fmt, ...) noexcept 11 | __attribute__((__format__(__printf__, 4, 5))); 12 | 13 | void info(const char *file, int line, const char *func, const char *fmt, ...) noexcept 14 | __attribute__((__format__(__printf__, 4, 5))); 15 | 16 | void warn(const char *file, int line, const char *func, const char *fmt, ...) noexcept 17 | __attribute__((__format__(__printf__, 4, 5))); 18 | 19 | void error(const char *file, int line, const char *func, const char *fmt, ...) noexcept 20 | __attribute__((__format__(__printf__, 4, 5))); 21 | 22 | } // namespace::logger 23 | 24 | #define DEBUG(...) do { \ 25 | logger::debug(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 26 | } while (0) 27 | 28 | #define INFO(...) do { \ 29 | logger::info(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 30 | } while (0) 31 | 32 | #define WARN(...) do { \ 33 | logger::warn(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 34 | } while (0) 35 | 36 | #define ERR(...) do { \ 37 | logger::error(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 38 | } while (0) 39 | 40 | #if DEBUG_TRACE 41 | # define TRACE DEBUG 42 | #else 43 | # define TRACE(...) while (0) 44 | #endif 45 | -------------------------------------------------------------------------------- /src/plugin/deadbeef/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | # XXX use aaa_ prefix to make it highest prio plugin 4 | plugin_deadbeef_LTLIBRARIES = plugin/deadbeef/aaa_uade.la 5 | plugin_deadbeef_aaa_uade_la_SOURCES = \ 6 | plugin/common/copyright.h \ 7 | plugin/deadbeef/logger.cc \ 8 | plugin/deadbeef/plugin.cc 9 | 10 | plugin/deadbeef/% : CXXFLAGS += -Wno-format-nonliteral -Wno-missing-field-initializers 11 | 12 | plugin_deadbeef_aaa_uade_la_LIBADD = \ 13 | songend/libsongend.la \ 14 | songdb/libsongdb.la \ 15 | 3rdparty/libxxhash.la \ 16 | $(UADE_LIBS) \ 17 | $(LIBOPENMPT_LIBS) \ 18 | $(LIBXMP_LIBS) 19 | 20 | plugin_deadbeef_aaa_uade_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module -shared -no-undefined $(SHREXT) 21 | plugin_deadbeef_aaa_uade_la_LDFLAGS += -Xcompiler -Wno-odr -Xcompiler -Wno-lto-type-mismatch 22 | if BUILD_WINDOWS 23 | plugin_deadbeef_aaa_uade_la_LDFLAGS += -Xcompiler $(UADE_LIBS) 24 | if BUILD_CYGWIN 25 | plugin_deadbeef_aaa_uade_la_LDFLAGS += -Xcompiler -lcygwin 26 | endif 27 | if BUILD_MINGW 28 | if LD_GNU 29 | plugin_deadbeef_aaa_uade_la_LDFLAGS += -Xcompiler -lmsvcrt -Xcompiler -lmingwex -Xcompiler -lmsvcrt -Xcompiler -lkernel32 -Xcompiler -lws2_32 30 | endif 31 | endif 32 | endif 33 | if BUILD_NETBSD 34 | plugin_deadbeef_aaa_uade_la_LDFLAGS += -Xcompiler $(UADE_LIBS) 35 | endif 36 | plugin_deadbeef_aaa_uade_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBOPENMPT_CFLAGS) $(LIBXMP_CFLAGS) 37 | -------------------------------------------------------------------------------- /src/3rdparty/replay/noisetrekker2/noisetrekker2_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LicenseRef-NoiseTrekker2 2 | 3 | #include "noisetrekker2.h" 4 | 5 | // XXX fix AIX compile 6 | #undef SACTIVE 7 | 8 | namespace replay::noisetrekker2::probe { 9 | 10 | long SamplesPerTick = 0; 11 | #include "NtkSourceCode/Alphatrack.cpp" 12 | #include "NtkSourceCode/tb303.cpp" 13 | #include "NtkSourceCode/cubicspline.cpp" 14 | #include "NtkSourceCode/main.cpp" 15 | 16 | void reset() noexcept { 17 | ped_line = 0; 18 | cPosition = 0; 19 | memset(buf0, 0, sizeof(buf0)); 20 | memset(buf1, 0, sizeof(buf1)); 21 | memset(buf024, 0, sizeof(buf024)); 22 | memset(buf124, 0, sizeof(buf124)); 23 | memset(FLANGE_LEFTBUFFER, 0, sizeof(FLANGE_LEFTBUFFER)); 24 | memset(FLANGE_RIGHTBUFFER, 0, sizeof(FLANGE_RIGHTBUFFER)); 25 | memset(delay_left_buffer, 0, sizeof(delay_left_buffer)); 26 | memset(delay_right_buffer, 0, sizeof(delay_right_buffer)); 27 | memset(allBuffer_L, 0, sizeof(allBuffer_L)); 28 | memset(allBuffer_L2, 0, sizeof(allBuffer_L2)); 29 | memset(allBuffer_L3, 0, sizeof(allBuffer_L3)); 30 | memset(allBuffer_L4, 0, sizeof(allBuffer_L4)); 31 | memset(allBuffer_L5, 0, sizeof(allBuffer_L5)); 32 | memset(allBuffer_L6, 0, sizeof(allBuffer_L6)); 33 | for (int i = 0; i < MAX_TRACKS; ++i) { 34 | Synthesizer[i].ENV1_STAGE = 0; 35 | Synthesizer[i].ENV2_STAGE = 0; 36 | Synthesizer[i].SynthReset(); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/3ds.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # 3DS does not actually build yet 6 | 7 | # XXX devkitpro/devkitarm outdated ? (missing 3dsvars.sh which is included in devkitA64) 8 | 9 | # devkitarmvars.sh 10 | export DEVKITPRO=/opt/devkitpro 11 | export DEVKITARM=${DEVKITPRO}/devkitARM 12 | export PORTLIBS_ROOT=${DEVKITPRO}/portlibs 13 | export PATH=${DEVKITPRO}/tools/bin:$DEVKITARM/bin:$PATH 14 | export TOOL_PREFIX=arm-none-eabi- 15 | export CC=${TOOL_PREFIX}gcc 16 | export CXX=${TOOL_PREFIX}g++ 17 | export AR=${TOOL_PREFIX}gcc-ar 18 | export RANLIB=${TOOL_PREFIX}gcc-ranlib 19 | 20 | # 3dsvars.sh 21 | PORTLIBS_PREFIX=${PORTLIBS_ROOT}/3ds 22 | PATH=$PORTLIBS_PREFIX/bin:$PATH 23 | 24 | export CFLAGS="-march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O2 -mword-relocations -ffunction-sections -fdata-sections" 25 | export CXXFLAGS="${CFLAGS}" 26 | export CPPFLAGS="-D_3DS -D__3DS__ -I${PORTLIBS_PREFIX}/include -I${DEVKITPRO}/libctru/include" 27 | export LDFLAGS="-L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libctru/lib" 28 | # must be set in configure.ac 29 | #export LIBS="-lctru" 30 | 31 | if [ $# -eq 0 ] 32 | then 33 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 34 | --entrypoint /bin/sh devkitpro/devkitarm \ 35 | $0 build 36 | else 37 | apt update && apt install -y build-essential autoconf automake libtool pkg-config 38 | LDFLAGS="${LDFLAGS} -lctru" \ 39 | ./configure --host=arm-none-eabi 40 | make clean 41 | make -j check 42 | fi 43 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr1/protrekkr1_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | #include 3 | #include 4 | #include 5 | 6 | #include "protrekkr1.h" 7 | 8 | using namespace std; 9 | 10 | namespace replay::protrekkr1 { 11 | 12 | int Read_Data(void *value, int size, int amount, FILE *handle) noexcept { 13 | ssize_t bytes = min((size_t)(size * amount), handle->size - handle->pos); 14 | if (bytes <= 0) return 0; 15 | assert(bytes > 0); 16 | assert(handle->pos <= handle->size); 17 | assert(handle->pos + bytes <= handle->size); 18 | memcpy(value, handle->data + handle->pos, bytes); 19 | handle->pos += bytes; 20 | return bytes; 21 | } 22 | 23 | #include "release/distrib/replay/lib/endianness.cpp" 24 | #include "release/distrib/replay/lib/samples_unpack.cpp" 25 | #include "release/distrib/replay/lib/spline.cpp" 26 | 27 | namespace play { 28 | char artist[20]; 29 | char style[20]; 30 | char SampleName[128][16][64]; 31 | char Midiprg[128]; 32 | char nameins[128][20]; 33 | int CHAN_MIDI_PRG[MAX_TRACKS]; 34 | char CHAN_HISTORY_STATE[256][16]; 35 | // sound driver 36 | int AUDIO_Latency = 0; 37 | int AUDIO_Play_Flag = 0; 38 | int done = 0; 39 | #include "src/editors/patterns_blocks.cpp" 40 | #include "src/files/files.cpp" 41 | #include "release/distrib/replay/lib/replay.cpp" 42 | #include "release/distrib/replay/lib/synth.cpp" 43 | #include "release/distrib/replay/lib/tb_303.cpp" 44 | } 45 | 46 | } // namespace replay::protrekkr1 47 | -------------------------------------------------------------------------------- /src/3rdparty/xxhash/LICENSE: -------------------------------------------------------------------------------- 1 | xxHash Library 2 | Copyright (c) 2012-2021 Yann Collet 3 | All rights reserved. 4 | 5 | BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, this 14 | list of conditions and the following disclaimer in the documentation and/or 15 | other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/README.md: -------------------------------------------------------------------------------- 1 | # ft2play 2 | Aims to be a bit-accurate C port of Fasttracker 2.09's XM replayer (SB16/WAV render mode). \ 3 | This is a direct port of the original asm/Pascal source codes. \ 4 | \ 5 | The project contains example code in the ft2play folder on how to interface with the API. 6 | 7 | # Notes 8 | - To compile ft2play (the test program) on macOS/Linux, you need SDL2 9 | - When compiling, you need to pass the driver to use as a compiler pre-processor definition (f.ex. AUDIODRIVER_WINMM, check "pmplay.h") 10 | - This is not the same replayer/mixer code used in the FT2 clone (the FT2 clone also uses a port, but it has some audio precision improvements) 11 | - The accuracy has only been compared against a handful of songs 12 | - The code may not be 100% thread-safe (or safe in general), and as such I don't really recommend using this replayer in other projects. My primary goal was to create an accurate C port that people can use for reference. 13 | 14 | # How to test accuracy 15 | 1) Open FT2.08 or FT2.09 (use a fresh program start for every render) and load an XM/MOD module. Make sure "Stereo" and "Interpolation" are enabled in the config screen 16 | 2) Save as WAV with the following settings: Frequency = 44100, Amplification = 10 (not 4!) 17 | 3) Render the same song to WAV using ft2play (f.ex. "ft2play mysong.xm --render-to-wav") 18 | 4) Use a program capable of verifying the binary integrity between the two output files. If they differ, you found a problem, please create a GitHub issue for it :) 19 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/release/distrib/license.txt: -------------------------------------------------------------------------------- 1 | Protrekkr 2 | Based on Juan Antonio Arguelles Rius's NoiseTrekker. 3 | 4 | Copyright (C) 2008-2024 Franck Charlet. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions 9 | are met: 10 | 11 | 1. Redistributions of source code must retain the above copyright notice, 12 | this list of conditions and the following disclaimer. 13 | 14 | 2. Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 | SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /src/plugin/cli/converter/converter_main.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #include 5 | 6 | #include "converter/converter.h" 7 | 8 | #include 9 | #include 10 | 11 | using namespace std; 12 | 13 | int main(int argc, char *argv[]) { 14 | // TODO stdin support, filename out support 15 | if (argc < 2) { 16 | fprintf(stderr, "File not given\n"); 17 | return EXIT_FAILURE; 18 | } 19 | const char *fname = argv[1]; 20 | FILE *f = fopen(fname, "rb"); 21 | if (!f) { 22 | fprintf(stderr, "File not found: %s\n", fname); 23 | return EXIT_FAILURE; 24 | } 25 | int fd = fileno(f); 26 | 27 | struct stat st; 28 | if (fstat(fd, &st)) { 29 | close(fd); 30 | fprintf(stderr, "Failed to read file size for %s\n", fname); 31 | return EXIT_FAILURE; 32 | } 33 | 34 | char buf[4096]; 35 | vector buffer; 36 | buffer.reserve(st.st_size); 37 | 38 | ssize_t count; 39 | while ((count = read(fd, buf, sizeof buf)) > 0) { 40 | buffer.insert(buffer.end(), buf, buf + count); 41 | } 42 | close(fd); 43 | 44 | auto res = converter::convert(buffer.data(), buffer.size()); 45 | if (!res.success) { 46 | fprintf(stderr, "Conversion failed: %s\n", res.reason_failed.c_str()); 47 | return EXIT_FAILURE; 48 | } 49 | #ifdef __MINGW32__ 50 | _setmode(_fileno(stdout), 0x8000); 51 | #endif 52 | fwrite(res.data.data(), res.data.size(), 1, stdout); 53 | 54 | return EXIT_SUCCESS; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/plugin/deadbeef/logger.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2025 Matti Tiainen 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "common/constexpr.h" 9 | #include "common/logger.h" 10 | 11 | namespace plugin::deadbeef { 12 | extern DB_decoder_t *uade_plugin; 13 | extern DB_functions_t *deadbeef; 14 | } 15 | 16 | using namespace std; 17 | using namespace plugin::deadbeef; 18 | 19 | // file, line, func ignored 20 | namespace logger { 21 | 22 | void debug(const char *, int, const char *, const char *fmt, ...) noexcept { 23 | (void)fmt; 24 | #if DEBUG_TRACE 25 | va_list args; 26 | va_start(args, fmt); 27 | deadbeef->vlog_detailed(&uade_plugin->plugin, DDB_LOG_LAYER_INFO, fmt, args); 28 | va_end(args); 29 | #endif 30 | } 31 | 32 | void info(const char *, int, const char *, const char *fmt, ...) noexcept { 33 | va_list args; 34 | va_start(args, fmt); 35 | deadbeef->vlog_detailed(&uade_plugin->plugin, DDB_LOG_LAYER_INFO, fmt, args); 36 | va_end(args); 37 | } 38 | 39 | void warn(const char *, int, const char *, const char *fmt, ...) noexcept { 40 | va_list args; 41 | va_start(args, fmt); 42 | deadbeef->vlog_detailed(&uade_plugin->plugin, DDB_LOG_LAYER_INFO, fmt, args); 43 | va_end(args); 44 | } 45 | 46 | void error(const char *, int, const char *, const char *fmt, ...) noexcept { 47 | va_list args; 48 | va_start(args, fmt); 49 | deadbeef->vlog_detailed(&uade_plugin->plugin, DDB_LOG_LAYER_DEFAULT, fmt, args); 50 | va_end(args); 51 | } 52 | 53 | } // namespace logger 54 | -------------------------------------------------------------------------------- /src/3rdparty/replay/st23play/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2020, Olav "8bitbubsy" Sørensen 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL OLAV SØRENSEN BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /src/3rdparty/replay/st3play/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2020, Olav "8bitbubsy" Sørensen 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL OLAV SØRENSEN BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/pmp_mix.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | #include "pmplay.h" 5 | #include 6 | #include 7 | #endif 8 | 9 | enum 10 | { 11 | Status_SetVol = 1, 12 | Status_SetPan = 2, 13 | Status_SetFrq = 4, 14 | Status_StartTone = 8, 15 | Status_StopTone = 16, 16 | Status_QuickVol = 32, 17 | 18 | SType_Fwd = 1, 19 | SType_Rev = 2, 20 | SType_RevDir = 4, 21 | SType_Off = 8, 22 | SType_16 = 16, 23 | SType_Fadeout = 32 24 | }; 25 | 26 | typedef struct 27 | { 28 | const void *SBase, *SRevBase; 29 | uint8_t SType, SPan, SVol; 30 | int32_t SLVol1, SRVol1, SLVol2, SRVol2, SLVolIP, SRVolIP, SVolIPLen; 31 | int32_t SLen, SRepS, SRepL, SPos, SMixType; 32 | uint32_t SPosDec, SFrq; 33 | } CIType; 34 | 35 | typedef struct 36 | { 37 | const void *SBase; 38 | uint8_t Status, SType; 39 | int16_t SVol, SPan; 40 | int32_t SFrq, SLen, SRepS, SRepL, SStartPos; 41 | } WaveChannelInfoType; 42 | 43 | extern int16_t chnReloc[32]; 44 | extern int32_t *CDA_MixBuffer; 45 | extern CIType CI[32 * 2]; 46 | 47 | void P_SetSpeed(uint16_t bpm); 48 | void P_StartTone(sampleTyp *s, int32_t smpStartPos); 49 | 50 | // 8bb: added these two 51 | bool mix_Init(int32_t audioBufferSize); 52 | void mix_Free(void); 53 | // ------------------- 54 | 55 | void mix_ClearChannels(void); 56 | void mix_UpdateBuffer(int16_t *buffer, int32_t numSamples); 57 | 58 | bool dump_Init(int32_t frq, int32_t amp, int16_t songPos); 59 | void dump_Close(void); 60 | bool dump_EndOfTune(int32_t endSongPos); 61 | int32_t dump_GetFrame(int16_t *p); 62 | -------------------------------------------------------------------------------- /src/3rdparty/replay/hivelytracker/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2006-2018, Pete Gordon 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /scripts/crossbuild/blackberry10.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # BlackBerry 10 binaries not tested 6 | # note libstdc++.a not installed by default with DidactiCOde toolchain, needs to be copied manually 7 | 8 | #autoreconf -i 9 | 10 | APP_ROOT="/opt/cross/BB10" 11 | BBNDK_ROOT="${APP_ROOT}/bbndk" 12 | 13 | export BBNDK_TARGET="${BBNDK_ROOT}/target_10_3_1_995/qnx6" 14 | export BBNDK_HOST="${BBNDK_ROOT}/host_10_3_1_12/linux/x86" 15 | export BBNDK_ABI="arm-unknown-nto-qnx8.0.0eabi" 16 | 17 | HOST_OS=`uname -s | tr '[:upper:]' '[:lower:]'` 18 | HOST_ARCH=`uname -m` 19 | HOST_SYSTEM="${HOST_ARCH}-${HOST_OS}" 20 | 21 | export QNX_VERSION="qnx800" # matches builtin gcc/config/nto.h 22 | export QNX_TARGET="${APP_ROOT}/${QNX_VERSION}" 23 | export QNX_HOST="${QNX_TARGET}/${HOST_SYSTEM}" 24 | export QNX_INC="${QNX_TARGET}/include" 25 | export QNX_ARCH="armle-v7" 26 | export QNX_ABI="arm-blackberry-qnx8eabi" 27 | 28 | export QNX_BIN="${QNX_TARGET}/bin" 29 | export QNX_PREBUILT="${QNX_TARGET}/${QNX_ABI}" 30 | export QNX_PREBUILT_BIN="${QNX_HOST}/${QNX_ABI}/bin" 31 | export QNX_PREBUILT_LIBEXEC="${QNX_HOST}/${QNX_ABI}/${HOST_LIBNAME}" 32 | export QNX_PREBUILT_GCCLIB="${QNX_PREBUILT_LIBEXEC}/gcc/${QNX_ABI}/${GCC_VER}" 33 | 34 | export PATH="${QNX_TARGET}/bin:${QNX_CONFIGURATION}/bin:${PATH}" 35 | export PATH="${QNX_TARGET}/features/${LATEST_LINUX_JRE}/jre/bin:${PATH}" 36 | export PATH="${QNX_HOST}/usr/python32/bin:${QNX_BIN}:${QNX_PREBUILT_BIN}:${PATH}" 37 | 38 | export PKG_CONFIG_PATH=/dev/null 39 | export PKG_CONFIG_LIBDIR=/dev/null 40 | export PKG_CONFIG_SYSROOT_DIR=/dev/null 41 | 42 | ./configure --host=${QNX_ABI} 43 | 44 | make clean 45 | 46 | make -j check 47 | -------------------------------------------------------------------------------- /src/3rdparty/replay/ft2play/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020-2024, Olav Sørensen 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/protrekkr2_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | #include 3 | #include 4 | #include 5 | 6 | #include "protrekkr2.h" 7 | 8 | using namespace std; 9 | 10 | namespace replay::protrekkr2 { 11 | 12 | int Read_Data(void *value, int size, int amount, FILE *handle) noexcept { 13 | ssize_t bytes = min((size_t)(size * amount), handle->size - handle->pos); 14 | if (bytes <= 0) return 0; 15 | assert(bytes > 0); 16 | assert(handle->pos <= handle->size); 17 | assert(handle->pos + bytes <= handle->size); 18 | memcpy(value, handle->data + handle->pos, bytes); 19 | handle->pos += bytes; 20 | return bytes; 21 | } 22 | 23 | #include "release/distrib/replay/lib/endianness.cpp" 24 | #include "release/distrib/replay/lib/samples_unpack.cpp" 25 | #include "release/distrib/replay/lib/spline.cpp" 26 | #include "release/distrib/replay/lib/wavpack.cpp" 27 | 28 | namespace play { 29 | char artist[20]; 30 | char style[20]; 31 | char SampleName[128][16][64]; 32 | int Midiprg[128]; 33 | char nameins[128][20]; 34 | int Chan_Midi_Prg[MAX_TRACKS]; 35 | char Chan_History_State[256][MAX_TRACKS]; 36 | // sound driver 37 | int AUDIO_Latency = 0; 38 | int AUDIO_Play_Flag = 0; 39 | int done = 0; 40 | #include "src/editors/patterns_blocks.cpp" 41 | #include "src/files/303s.cpp" 42 | #include "src/files/files.cpp" 43 | #include "src/files/reverbs.cpp" 44 | #include "src/files/synths.cpp" 45 | #include "release/distrib/replay/lib/replay.cpp" 46 | #include "release/distrib/replay/lib/synth.cpp" 47 | #include "release/distrib/replay/lib/tb_303.cpp" 48 | } 49 | 50 | } // namespace replay::protrekkr2 51 | -------------------------------------------------------------------------------- /src/plugin/audacious/logger.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2014-2025 Matti Tiainen 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "common/constexpr.h" 9 | 10 | using namespace std; 11 | 12 | namespace { 13 | 14 | // audlog:* doesn't support va_list... 15 | constexpr_f2 void log(audlog::Level level, const char *file, int line, const char *func, const char *fmt, va_list args) noexcept { 16 | char buffer[512]; 17 | vsnprintf(buffer, sizeof buffer, fmt, args); 18 | audlog::log(level, file, line, func, "%s", buffer); 19 | } 20 | 21 | } // namespace {} 22 | 23 | namespace logger { 24 | 25 | void debug(const char *file, int line, const char *func, const char *fmt, ...) noexcept { 26 | va_list args; 27 | va_start(args, fmt); 28 | log(audlog::Debug, file, line, func, fmt, args); 29 | va_end(args); 30 | } 31 | 32 | void info(const char *file, int line, const char *func, const char *fmt, ...) noexcept { 33 | va_list args; 34 | va_start(args, fmt); 35 | log(audlog::Info, file, line, func, fmt, args); 36 | va_end(args); 37 | } 38 | 39 | void warn(const char *file, int line, const char *func, const char *fmt, ...) noexcept { 40 | va_list args; 41 | va_start(args, fmt); 42 | log(audlog::Warning, file, line, func, fmt, args); 43 | va_end(args); 44 | } 45 | 46 | void error(const char *file, int line, const char *func, const char *fmt, ...) noexcept { 47 | va_list args; 48 | va_start(args, fmt); 49 | log(audlog::Error, file, line, func, fmt, args); 50 | va_end(args); 51 | } 52 | 53 | } // namespace logger 54 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022-2024, Olav Sørensen 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /src/3rdparty/replay/st3play/st3play.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | // for endianess check 9 | #include "config.h" 10 | 11 | #define AUDACIOUS_UADE 1 12 | #define register // error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 13 | 14 | #define ST3PLAY(ns) \ 15 | namespace ns { \ 16 | extern bool np_restarted, moduleLoaded; \ 17 | extern int8_t patterndelay, patloopcount; \ 18 | extern uint8_t order[256], chnsettings[32], *patdata[100]; \ 19 | extern int16_t np_ord, np_row, np_pat; \ 20 | extern uint16_t ordNum, insNum, patNum; \ 21 | extern uint16_t patDataLens[100]; \ 22 | extern int32_t *mixBufferL, *mixBufferR; \ 23 | bool loadS3M(const uint8_t *dat, uint32_t modLen); \ 24 | bool st3play_PlaySong(const uint8_t *moduleData, uint32_t dataLength, bool useInterpolationFlag, uint32_t audioFreq); \ 25 | void st3play_Close(void); \ 26 | bool st3play_FillAudioBuffer(int16_t *buffer, int32_t samples); \ 27 | void st3play_SetInterpolation(bool flag); \ 28 | void reset(); \ 29 | inline void setPos(int16_t pos) { \ 30 | np_ord = pos; \ 31 | np_pat = order[pos]; \ 32 | np_row = 0; \ 33 | } \ 34 | inline void clearMixBuffer() { \ 35 | constexpr int MIX_BUF_SAMPLES = 4096; \ 36 | if (mixBufferL) memset(mixBufferL, 0, MIX_BUF_SAMPLES * sizeof (int32_t)); \ 37 | if (mixBufferR) memset(mixBufferR, 0, MIX_BUF_SAMPLES * sizeof (int32_t)); \ 38 | } \ 39 | } 40 | 41 | ST3PLAY(replay::st3play::play) 42 | #ifdef PLAYER_PROBE 43 | ST3PLAY(replay::st3play::probe) 44 | #else 45 | namespace replay::st3play { namespace probe = replay::st3play::play; } 46 | #endif 47 | -------------------------------------------------------------------------------- /scripts/crossbuild/wip/wiiu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Wii U does not actually build yet 6 | 7 | # TODO test if libwut works on wii 8 | 9 | # XXX devkitpro/devkitppc outdated ? (missing wiiuvars.sh which is included in devkitA64) 10 | 11 | # devkitppcvars.sh 12 | export DEVKITPRO=/opt/devkitpro 13 | export DEVKITPPC=${DEVKITPRO}/devkitPPC 14 | export PORTLIBS_ROOT=${DEVKITPRO}/portlibs 15 | export PATH=${DEVKITPRO}/tools/bin:${DEVKITPRO}/devkitPPC/bin:$PATH 16 | export TOOL_PREFIX=powerpc-eabi- 17 | export CC=${TOOL_PREFIX}gcc 18 | export CXX=${TOOL_PREFIX}g++ 19 | export AR=${TOOL_PREFIX}gcc-ar 20 | export RANLIB=${TOOL_PREFIX}gcc-ranlib 21 | 22 | # wiiuvars.sh 23 | export PORTLIBS_PREFIX=${PORTLIBS_ROOT}/wiiu 24 | export PORTLIBS_PPC=${PORTLIBS_ROOT}/ppc 25 | export PORTLIBS_WIIU=${PORTLIBS_PREFIX} 26 | 27 | export CFLAGS="-mcpu=750 -meabi -mhard-float -O2 -ffunction-sections -fdata-sections" 28 | export CXXFLAGS="${CFLAGS}" 29 | export CPPFLAGS="-DESPRESSO -D__WIIU__ -D__WUT__ -I${PORTLIBS_WIIU}/include -I${PORTLIBS_PPC}/include -I${DEVKITPRO}/wut/include" 30 | export LDFLAGS="-L${PORTLIBS_WIIU}/lib -L${PORTLIBS_PPC}/lib -L${DEVKITPRO}/wut/lib -specs=${DEVKITPRO}/wut/share/wut.specs" 31 | # must be in configure.ac 32 | #export LIBS="-lwut -lm" 33 | 34 | export PATH=${PORTLIBS_WIIU}/bin:${PORTLIBS_PPC}/bin:$PATH 35 | 36 | if [ $# -eq 0 ] 37 | then 38 | docker run --rm -t -v .:/audacious-uade -w /audacious-uade \ 39 | --entrypoint /bin/sh devkitpro/devkitppc \ 40 | $0 build 41 | else 42 | apt update && apt install -y build-essential autoconf automake libtool pkg-config 43 | LDFLAGS="${LDFLAGS} -lwut -lm" \ 44 | ./configure --host=powerpc-eabi 45 | make clean 46 | make -j check 47 | fi 48 | -------------------------------------------------------------------------------- /src/plugin/common/copyright.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include "config.h" 7 | 8 | #if PLAYER_uade 9 | #include "../uade/src/frontends/include/uade/options.h" 10 | #else 11 | #define UADE_VERSION "N/A" 12 | #endif 13 | 14 | #if PLAYER_libopenmpt 15 | #include 16 | #endif 17 | 18 | #if PLAYER_libxmp 19 | #include 20 | #endif 21 | 22 | static constexpr const char *plugin_copyright = 23 | "audacious-uade " PACKAGE_VERSION " (GPL-2.0-or-later)\n" 24 | "Copyright (c) 2014-2025, Matti Tiainen\n" 25 | "\n" 26 | #if PLAYER_uade 27 | "UADE " UADE_VERSION " (GPL-2.0-or-later)\n" 28 | "https://zakalwe.fi/uade/\n" 29 | "\n" 30 | #endif 31 | #if PLAYER_hivelytracker 32 | "HivelyTracker 1.9 (BSD-3-Clause)\n" 33 | "Copyright (c) 2006-2018, Pete Gordon\n" 34 | "\n" 35 | #endif 36 | #if PLAYER_libdigibooster3 37 | "libdigibooster3 1.2 (BSD-2-Clause)\n" 38 | "Copyright (c) 2014, Grzegorz Kraszewski\n" 39 | "\n" 40 | #endif 41 | #if PLAYER_ft2play || PLAYER_it2play || PLAYER_st3play || PLAYER_st23play 42 | "ft2play, it2play, st3play v1.0.1,\n" 43 | "st23play v0.35 (BSD-3-Clause)\n" 44 | "Copyright (c) 2016-2024, Olav Sørensen\n" 45 | "\n" 46 | #endif 47 | #if PLAYER_protrekkr1 || PLAYER_protrekkr2 48 | "ProTrekkr v1.99e, v2.8.1 (BSD-2-Clause)\n" 49 | "Copyright (C) 2008-2024, Franck Charlet\n" 50 | "\n" 51 | #endif 52 | #if PLAYER_noisetrekker2 53 | "NoiseTrekker2 final by Arguru\n" 54 | "\n" 55 | #endif 56 | #if PLAYER_libopenmpt 57 | "libopenmpt " OPENMPT_API_VERSION_STRING " (BSD-3-Clause)\n" 58 | "https://lib.openmpt.org/libopenmpt/\n" 59 | "\n" 60 | #endif 61 | #if PLAYER_libxmp 62 | "libxmp " XMP_VERSION " (MIT)\n" 63 | "https://xmp.sourceforge.net/\n" 64 | "\n" 65 | #endif 66 | "See README for more information\n"; 67 | -------------------------------------------------------------------------------- /src/common/songend.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2014-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "constexpr.h" 11 | 12 | namespace common { 13 | 14 | struct SongEnd { 15 | enum Status : int8_t { 16 | ERROR = -1, 17 | NONE = 0, 18 | PLAYER = 1, 19 | TIMEOUT = 2, 20 | DETECT_SILENCE = 3, 21 | // these only with precalcing 22 | DETECT_LOOP = 4, 23 | DETECT_VOLUME = 5, 24 | DETECT_REPEAT = 6, 25 | PLAYER_PLUS_SILENCE = 7, 26 | PLAYER_PLUS_VOLUME = 8, 27 | LOOP_PLUS_SILENCE = 9, 28 | LOOP_PLUS_VOLUME = 10, 29 | NOSOUND = 11, 30 | }; 31 | Status status; 32 | uint32_t length = 0; 33 | static std::string status_string(const Status status) noexcept { 34 | switch (status) { 35 | case ERROR: return "error"; 36 | case NONE: return "none"; 37 | case PLAYER: return "player"; 38 | case TIMEOUT: return "timeout"; 39 | case DETECT_SILENCE: return "silence"; 40 | case DETECT_LOOP: return "loop"; 41 | case DETECT_VOLUME: return "volume"; 42 | case DETECT_REPEAT: return "repeat"; 43 | case PLAYER_PLUS_SILENCE: return "player+silence"; 44 | case PLAYER_PLUS_VOLUME: return "player+volume"; 45 | case LOOP_PLUS_SILENCE: return "loop+silence"; 46 | case LOOP_PLUS_VOLUME: return "loop+volume"; 47 | case NOSOUND: return "nosound"; 48 | default: assert(false); return "error"; 49 | } 50 | } 51 | constexpr_f2 std::string status_string() const noexcept { 52 | return status_string(status); 53 | } 54 | }; 55 | 56 | } // namespace common 57 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2play.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | // for endianess check 13 | #include "config.h" 14 | 15 | #define AUDACIOUS_UADE 1 16 | 17 | namespace replay::it2play { 18 | #include "cpu.h" 19 | #include "it_structs.h" 20 | #include "it_tables.h" 21 | #include "it2drivers/zerovol.h" 22 | } // namespace replay::it2play 23 | 24 | namespace replay::it2play::play { 25 | using namespace replay::it2play; 26 | extern hostChn_t hChn[MAX_HOST_CHANNELS]; 27 | extern slaveChn_t sChn[MAX_SLAVE_CHANNELS]; 28 | extern song_t Song; 29 | extern driver_t Driver; 30 | #include "it_d_rm.h" 31 | #include "it_m_eff.h" 32 | #include "it_music.h" 33 | #include "loaders/it.h" 34 | #include "loaders/s3m.h" 35 | // add noop impls to fix compile (not used for anything) 36 | inline void lockMixer(void) {} 37 | inline void unlockMixer(void) {} 38 | inline bool openMixer(int32_t mixingFrequency, int32_t mixingBufferSize) { return true; } 39 | inline void closeMixer(void) {} 40 | } // namespace replay::it2play::play 41 | 42 | #ifdef PLAYER_PROBE 43 | namespace replay::it2play::probe { 44 | using namespace replay::it2play; 45 | extern hostChn_t hChn[MAX_HOST_CHANNELS]; 46 | extern slaveChn_t sChn[MAX_SLAVE_CHANNELS]; 47 | extern song_t Song; 48 | extern driver_t Driver; 49 | #include "it_d_rm.h" 50 | #include "it_m_eff.h" 51 | #include "it_music.h" 52 | #include "loaders/it.h" 53 | #include "loaders/s3m.h" 54 | // add noop impls to fix compile (not used for anything) 55 | inline void lockMixer(void) {} 56 | inline void unlockMixer(void) {} 57 | inline bool openMixer(int32_t mixingFrequency, int32_t mixingBufferSize) { return true; } 58 | inline void closeMixer(void) {} 59 | } // namespace replay::it2play::probe 60 | #else 61 | namespace replay::it2play { namespace probe = replay::it2play::play; } 62 | #endif 63 | -------------------------------------------------------------------------------- /src/3rdparty/replay/noisetrekker2/noisetrekker2_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LicenseRef-NoiseTrekker2 2 | #include 3 | #include 4 | #include 5 | 6 | #include "noisetrekker2.h" 7 | 8 | // XXX fix AIX compile 9 | #undef SACTIVE 10 | 11 | using namespace std; 12 | 13 | namespace replay::noisetrekker2 { 14 | 15 | size_t fread(void *ptr, size_t size, size_t n, FILE *stream) { 16 | ssize_t bytes = min((size_t)(size * n), stream->size - stream->pos); 17 | if (bytes <= 0) return 0; 18 | assert(bytes > 0); 19 | assert(stream->pos <= stream->size); 20 | assert(stream->pos + bytes <= stream->size); 21 | memcpy(ptr, stream->data + stream->pos, bytes); 22 | stream->pos += bytes; 23 | return bytes / size; 24 | } 25 | 26 | } 27 | 28 | namespace replay::noisetrekker2::play { 29 | 30 | long SamplesPerTick = 0; 31 | #include "NtkSourceCode/Alphatrack.cpp" 32 | #include "NtkSourceCode/tb303.cpp" 33 | #include "NtkSourceCode/cubicspline.cpp" 34 | #include "NtkSourceCode/main.cpp" 35 | 36 | void reset() noexcept { 37 | ped_line = 0; 38 | cPosition = 0; 39 | memset(buf0, 0, sizeof(buf0)); 40 | memset(buf1, 0, sizeof(buf1)); 41 | memset(buf024, 0, sizeof(buf024)); 42 | memset(buf124, 0, sizeof(buf124)); 43 | memset(FLANGE_LEFTBUFFER, 0, sizeof(FLANGE_LEFTBUFFER)); 44 | memset(FLANGE_RIGHTBUFFER, 0, sizeof(FLANGE_RIGHTBUFFER)); 45 | memset(delay_left_buffer, 0, sizeof(delay_left_buffer)); 46 | memset(delay_right_buffer, 0, sizeof(delay_right_buffer)); 47 | memset(allBuffer_L, 0, sizeof(allBuffer_L)); 48 | memset(allBuffer_L2, 0, sizeof(allBuffer_L2)); 49 | memset(allBuffer_L3, 0, sizeof(allBuffer_L3)); 50 | memset(allBuffer_L4, 0, sizeof(allBuffer_L4)); 51 | memset(allBuffer_L5, 0, sizeof(allBuffer_L5)); 52 | memset(allBuffer_L6, 0, sizeof(allBuffer_L6)); 53 | for (int i = 0; i < MAX_TRACKS; ++i) { 54 | Synthesizer[i].ENV1_STAGE = 0; 55 | Synthesizer[i].ENV2_STAGE = 0; 56 | } 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/3rdparty/xxhash/xxhash.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | /* 3 | * xxHash - Extremely Fast Hash algorithm 4 | * Copyright (C) 2012-2023 Yann Collet 5 | * 6 | * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * You can contact the author at: 32 | * - xxHash homepage: https://www.xxhash.com 33 | * - xxHash source repository: https://github.com/Cyan4973/xxHash 34 | */ 35 | 36 | /* 37 | * xxhash.c instantiates functions defined in xxhash.h 38 | */ 39 | 40 | #define XXH_STATIC_LINKING_ONLY /* access advanced declarations */ 41 | #define XXH_IMPLEMENTATION /* access definitions */ 42 | 43 | #include "xxhash.h" 44 | -------------------------------------------------------------------------------- /src/player/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | noinst_LTLIBRARIES += \ 4 | player/libplayer.la 5 | 6 | player_libplayer_la_SOURCES = \ 7 | player/extensions.h \ 8 | player/player.h \ 9 | player/player.cc \ 10 | player/players/internal.h 11 | 12 | player_libplayer_la_CXXFLAGS = $(AM_CXXFLAGS) 13 | player_libplayer_la_CPPFLAGS = $(AM_CPPFLAGS) 14 | 15 | if PLAYER_ft2play 16 | player_libplayer_la_SOURCES += player/players/player_ft2play.cc 17 | endif 18 | 19 | if PLAYER_hivelytracker 20 | player_libplayer_la_SOURCES += player/players/player_hivelytracker.cc 21 | endif 22 | 23 | if PLAYER_it2play 24 | player_libplayer_la_SOURCES += player/players/player_it2play.cc 25 | endif 26 | 27 | if PLAYER_libdigibooster3 28 | player_libplayer_la_SOURCES += player/players/player_libdigibooster3.cc 29 | endif 30 | 31 | if PLAYER_libopenmpt 32 | player_libplayer_la_SOURCES += player/players/player_libopenmpt.cc 33 | player_libplayer_la_CXXFLAGS += $(LIBOPENMPT_CFLAGS) 34 | endif 35 | 36 | if PLAYER_libxmp 37 | player_libplayer_la_SOURCES += player/players/player_libxmp.cc 38 | player_libplayer_la_CXXFLAGS += $(LIBXMP_CFLAGS) 39 | endif 40 | 41 | if PLAYER_noisetrekker2 42 | player_libplayer_la_SOURCES += player/players/player_noisetrekker2.cc 43 | endif 44 | 45 | if PLAYER_protrekkr1 46 | player_libplayer_la_SOURCES += player/players/player_protrekkr1.cc 47 | endif 48 | 49 | if PLAYER_protrekkr2 50 | player_libplayer_la_SOURCES += player/players/player_protrekkr2.cc 51 | endif 52 | 53 | if PLAYER_st23play 54 | player_libplayer_la_SOURCES += player/players/player_st23play.cc 55 | endif 56 | 57 | if PLAYER_st3play 58 | player_libplayer_la_SOURCES += player/players/player_st3play.cc 59 | endif 60 | 61 | if PLAYER_uade 62 | player_libplayer_la_SOURCES += player/players/player_uade.cc 63 | # TODO fix uadecore dependency tracking 64 | player_libplayer_la_CPPFLAGS += $(UADE_CPPFLAGS) 65 | endif 66 | 67 | player_libplayer_la_LIBADD = \ 68 | converter/libconverter.la \ 69 | 3rdparty/libreplay.la 70 | 71 | player/players/% : CXXFLAGS += -Wno-keyword-macro 72 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it_m_eff.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #ifndef AUDACIOUS_UADE 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #endif 8 | 9 | void NoCommand(hostChn_t *hc); 10 | 11 | void VolumeCommandC(hostChn_t *hc); 12 | void VolumeCommandD(hostChn_t *hc); 13 | void VolumeCommandE(hostChn_t *hc); 14 | void VolumeCommandF(hostChn_t *hc); 15 | void VolumeCommandG(hostChn_t *hc); 16 | 17 | void InitNoCommand(hostChn_t *hc); 18 | void InitCommandA(hostChn_t *hc); 19 | void InitCommandB(hostChn_t *hc); 20 | void InitCommandC(hostChn_t *hc); 21 | void InitCommandD(hostChn_t *hc); 22 | void InitCommandE(hostChn_t *hc); 23 | void InitCommandF(hostChn_t *hc); 24 | void InitCommandG(hostChn_t *hc); 25 | void InitCommandH(hostChn_t *hc); 26 | void InitCommandI(hostChn_t *hc); 27 | void InitCommandI(hostChn_t *hc); 28 | void InitCommandJ(hostChn_t *hc); 29 | void InitCommandK(hostChn_t *hc); 30 | void InitCommandL(hostChn_t *hc); 31 | void InitCommandM(hostChn_t *hc); 32 | void InitCommandN(hostChn_t *hc); 33 | void InitCommandO(hostChn_t *hc); 34 | void InitCommandP(hostChn_t *hc); 35 | void InitCommandQ(hostChn_t *hc); 36 | void InitCommandR(hostChn_t *hc); 37 | void InitCommandS(hostChn_t *hc); 38 | void InitCommandT(hostChn_t *hc); 39 | void InitCommandU(hostChn_t *hc); 40 | void InitCommandV(hostChn_t *hc); 41 | void InitCommandW(hostChn_t *hc); 42 | void InitCommandX(hostChn_t *hc); 43 | void InitCommandY(hostChn_t *hc); 44 | void InitCommandZ(hostChn_t *hc); 45 | 46 | void CommandD(hostChn_t *hc); 47 | void CommandE(hostChn_t *hc); 48 | void CommandF(hostChn_t *hc); 49 | void CommandG(hostChn_t *hc); 50 | void CommandH(hostChn_t *hc); 51 | void CommandI(hostChn_t *hc); 52 | void CommandJ(hostChn_t *hc); 53 | void CommandK(hostChn_t *hc); 54 | void CommandL(hostChn_t *hc); 55 | void CommandN(hostChn_t *hc); 56 | void CommandP(hostChn_t *hc); 57 | void CommandQ(hostChn_t *hc); 58 | void CommandR(hostChn_t *hc); 59 | void CommandS(hostChn_t *hc); 60 | void CommandT(hostChn_t *hc); 61 | void CommandW(hostChn_t *hc); 62 | void CommandY(hostChn_t *hc); 63 | -------------------------------------------------------------------------------- /m4/ax_check_link_flag.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check whether the given FLAG works with the linker or gives an error. 12 | # (Warnings, however, are ignored) 13 | # 14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 15 | # success/failure. 16 | # 17 | # If EXTRA-FLAGS is defined, it is added to the linker's default flags 18 | # when the check is done. The check is thus made with the flags: "LDFLAGS 19 | # EXTRA-FLAGS FLAG". This can for example be used to force the linker to 20 | # issue an error when a bad flag is given. 21 | # 22 | # INPUT gives an alternative input source to AC_LINK_IFELSE. 23 | # 24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this 25 | # macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. 26 | # 27 | # LICENSE 28 | # 29 | # Copyright (c) 2008 Guido U. Draheim 30 | # Copyright (c) 2011 Maarten Bosmans 31 | # 32 | # Copying and distribution of this file, with or without modification, are 33 | # permitted in any medium without royalty provided the copyright notice 34 | # and this notice are preserved. This file is offered as-is, without any 35 | # warranty. 36 | 37 | #serial 6 38 | 39 | AC_DEFUN([AX_CHECK_LINK_FLAG], 40 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF 41 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl 42 | AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ 43 | ax_check_save_flags=$LDFLAGS 44 | LDFLAGS="$LDFLAGS $4 $1" 45 | AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], 46 | [AS_VAR_SET(CACHEVAR,[yes])], 47 | [AS_VAR_SET(CACHEVAR,[no])]) 48 | LDFLAGS=$ax_check_save_flags]) 49 | AS_VAR_IF(CACHEVAR,yes, 50 | [m4_default([$2], :)], 51 | [m4_default([$3], :)]) 52 | AS_VAR_POPDEF([CACHEVAR])dnl 53 | ])dnl AX_CHECK_LINK_FLAGS 54 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/release/distrib/replay/lib/include/spline.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // ------------------------------------------------------ 3 | // Protrekkr 4 | // Based on Juan Antonio Arguelles Rius's NoiseTrekker. 5 | // 6 | // Copyright (C) 2008-2024 Franck Charlet. 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 13 | // 1. Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // 2. Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 21 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 24 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | // SUCH DAMAGE. 31 | // ------------------------------------------------------ 32 | 33 | #ifndef AUDACIOUS_UADE 34 | #pragma once 35 | #endif 36 | 37 | // ------------------------------------------------------ 38 | // Constants 39 | #define RESOLUTION 1024 40 | 41 | // ------------------------------------------------------ 42 | // Functions 43 | void Spline_Init(void); 44 | float Spline_Work(float yo, float y0, float y1, float y2, unsigned int res); 45 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2play_probe.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "it2play.h" 3 | 4 | namespace replay::it2play::probe { 5 | using namespace replay::it2play; 6 | namespace hq { 7 | #include "it2drivers/hq_m.h" 8 | #include "it2drivers/hq_m.c" 9 | #include "it2drivers/hq.h" 10 | #include "it2drivers/hq.c" 11 | #undef Get8BitWaveForm 12 | #undef Get16BitWaveForm 13 | #undef FilterSample 14 | #undef MixSample 15 | #undef MixSampleSurround 16 | #undef RampCurrVolumeL 17 | #undef RampCurrVolumeR 18 | #undef RAMPSPEED 19 | #undef RAMPCOMPENSATE 20 | #undef UpdatePos 21 | } 22 | namespace sb16 { 23 | #include "it2drivers/sb16_m.h" 24 | #include "it2drivers/sb16_m.c" 25 | #include "it2drivers/sb16.h" 26 | #include "it2drivers/sb16.c" 27 | #undef Get8BitWaveForm 28 | #undef Get16BitWaveForm 29 | #undef FilterSample 30 | #undef MixSample 31 | #undef MixSampleSurround 32 | #undef RampCurrVolumeL 33 | #undef RampCurrVolumeR 34 | #undef RAMPSPEED 35 | #undef RAMPCOMPENSATE 36 | #undef UpdatePos 37 | } 38 | namespace sb16mmx { 39 | #include "it2drivers/sb16mmx_m.h" 40 | #include "it2drivers/sb16mmx_m.c" 41 | #include "it2drivers/sb16mmx.h" 42 | #include "it2drivers/sb16mmx.c" 43 | #undef Get8BitWaveForm 44 | #undef Get16BitWaveForm 45 | #undef FilterSample 46 | #undef MixSample 47 | #undef MixSampleSurround 48 | #undef RampCurrVolumeL 49 | #undef RampCurrVolumeR 50 | #undef RAMPSPEED 51 | #undef RAMPCOMPENSATE 52 | #undef UpdatePos 53 | } 54 | namespace wavwriter { 55 | #include "it2drivers/wavwriter_m.h" 56 | #include "it2drivers/wavwriter_m.c" 57 | #include "it2drivers/wavwriter.h" 58 | #include "it2drivers/wavwriter.c" 59 | #undef Get8BitWaveForm 60 | #undef Get16BitWaveForm 61 | #undef FilterSample 62 | #undef MixSample 63 | #undef MixSampleSurround 64 | #undef RampCurrVolumeL 65 | #undef RampCurrVolumeR 66 | #undef RAMPSPEED 67 | #undef RAMPCOMPENSATE 68 | #undef UpdatePos 69 | } 70 | using namespace hq; 71 | using namespace sb16; 72 | using namespace sb16mmx; 73 | using namespace wavwriter; 74 | #include "it_structs.c" 75 | #include "it_d_rm.c" 76 | #include "it_m_eff.c" 77 | #include "it_music.c" 78 | #include "loaders/it.c" 79 | #include "loaders/s3m.c" 80 | 81 | } // namespace replay::it2play::probe 82 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr1/release/distrib/replay/lib/include/spline.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // ------------------------------------------------------ 3 | // Protrekkr 4 | // Based on Juan Antonio Arguelles Rius's NoiseTrekker. 5 | // 6 | // Copyright (C) 2008-2010 Franck Charlet. 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 13 | // 1. Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // 2. Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 21 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 24 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | // SUCH DAMAGE. 31 | // ------------------------------------------------------ 32 | 33 | #ifndef AUDACIOUS_UADE 34 | #pragma once 35 | #endif 36 | 37 | // ------------------------------------------------------ 38 | // Constants 39 | #define RESOLUTION 1024 40 | 41 | // ------------------------------------------------------ 42 | // Functions 43 | void Spline_Init(void); 44 | float Spline_Work(float yo, float y0, float y1, float y2, 45 | unsigned int res, long offset, long length); 46 | -------------------------------------------------------------------------------- /src/3rdparty/replay/noisetrekker2/NtkSourceCode/cubicspline.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LicenseRef-NoiseTrekker2 2 | // CUBIC SPLINE FUNCTION 3 | // 4 | // Arguru 5 | // 6 | 7 | class Cubic 8 | { 9 | public: 10 | Cubic(); 11 | 12 | float Work(float yo,float y0,float y1,float y2,__uint32 res, __uint32 offset, __uint32 length); 13 | 14 | // Work function. Where all is cooked :] 15 | // yo = y[-1] [sample at x-1] 16 | // y0 = y[0] [sample at x (input)] 17 | // y1 = y[1] [sample at x+1] 18 | // y2 = y[2] [sample at x+2] 19 | 20 | // res= distance between two neighboughs sample points [y0 and y1] 21 | // ,so [0...1.0]. You have to multiply this distance * RESOLUTION used 22 | // on the spline conversion table. [256 by default] 23 | // If you are using 256 is asumed you are using 8 bit decimal 24 | // fixed point offsets for resampling. 25 | 26 | // offset = sample offset [info to avoid go out of bounds on sample reading ] 27 | // offset = sample length [info to avoid go out of bounds on sample reading ] 28 | 29 | private: 30 | int RESOLUTION; // Currently is 256, that's enough... 31 | float at[1024]; 32 | float bt[1024]; 33 | float ct[1024]; 34 | float dt[1024]; 35 | 36 | }; 37 | 38 | Cubic::Cubic() /* The resampler constructor */ 39 | { 40 | RESOLUTION=1024; 41 | // Initialize table... 42 | for (int i=0;i>22; 58 | if(offset==0)yo=0; 59 | if(offset+2>length)y1=0; 60 | if(offset+3>length)y2=0; 61 | 62 | return at[res]*yo+bt[res]*y0+ct[res]*y1+dt[res]*y2; 63 | } 64 | 65 | // Despiste this CubicSpline function, only for debuggin purposes, not optimized 66 | float CubicSpline(float oy1,float y0,float y1, float y2, float x) 67 | { 68 | float a=(3*(y0-y1)-oy1+y2)*0.5; 69 | float b=2*y1+oy1-(5*y0+y2)*0.5; 70 | float c=(y1-oy1)*0.5; 71 | return a*x*x*x+b*x*x+c*x+y0; 72 | } 73 | -------------------------------------------------------------------------------- /m4/ax_check_compile_flag.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check whether the given FLAG works with the current language's compiler 12 | # or gives an error. (Warnings, however, are ignored) 13 | # 14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 15 | # success/failure. 16 | # 17 | # If EXTRA-FLAGS is defined, it is added to the current language's default 18 | # flags (e.g. CFLAGS) when the check is done. The check is thus made with 19 | # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to 20 | # force the compiler to issue an error when a bad flag is given. 21 | # 22 | # INPUT gives an alternative input source to AC_COMPILE_IFELSE. 23 | # 24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this 25 | # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. 26 | # 27 | # LICENSE 28 | # 29 | # Copyright (c) 2008 Guido U. Draheim 30 | # Copyright (c) 2011 Maarten Bosmans 31 | # 32 | # Copying and distribution of this file, with or without modification, are 33 | # permitted in any medium without royalty provided the copyright notice 34 | # and this notice are preserved. This file is offered as-is, without any 35 | # warranty. 36 | 37 | #serial 6 38 | 39 | AC_DEFUN([AX_CHECK_COMPILE_FLAG], 40 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF 41 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl 42 | AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ 43 | ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS 44 | _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" 45 | AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], 46 | [AS_VAR_SET(CACHEVAR,[yes])], 47 | [AS_VAR_SET(CACHEVAR,[no])]) 48 | _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) 49 | AS_VAR_IF(CACHEVAR,yes, 50 | [m4_default([$2], :)], 51 | [m4_default([$3], :)]) 52 | AS_VAR_POPDEF([CACHEVAR])dnl 53 | ])dnl AX_CHECK_COMPILE_FLAGS 54 | -------------------------------------------------------------------------------- /src/3rdparty/replay/it2play/it2play_play.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | #include "it2play.h" 3 | 4 | namespace replay::it2play { 5 | using namespace replay::it2play; 6 | #include "it_tables.c" 7 | #include "it2drivers/zerovol.c" 8 | } 9 | 10 | namespace replay::it2play::play { 11 | using namespace replay::it2play; 12 | namespace hq { 13 | #include "it2drivers/hq_m.h" 14 | #include "it2drivers/hq_m.c" 15 | #include "it2drivers/hq.h" 16 | #include "it2drivers/hq.c" 17 | #undef Get8BitWaveForm 18 | #undef Get16BitWaveForm 19 | #undef FilterSample 20 | #undef MixSample 21 | #undef MixSampleSurround 22 | #undef RampCurrVolumeL 23 | #undef RampCurrVolumeR 24 | #undef RAMPSPEED 25 | #undef RAMPCOMPENSATE 26 | #undef UpdatePos 27 | } 28 | namespace sb16 { 29 | #include "it2drivers/sb16_m.h" 30 | #include "it2drivers/sb16_m.c" 31 | #include "it2drivers/sb16.h" 32 | #include "it2drivers/sb16.c" 33 | #undef Get8BitWaveForm 34 | #undef Get16BitWaveForm 35 | #undef FilterSample 36 | #undef MixSample 37 | #undef MixSampleSurround 38 | #undef RampCurrVolumeL 39 | #undef RampCurrVolumeR 40 | #undef RAMPSPEED 41 | #undef RAMPCOMPENSATE 42 | #undef UpdatePos 43 | } 44 | namespace sb16mmx { 45 | #include "it2drivers/sb16mmx_m.h" 46 | #include "it2drivers/sb16mmx_m.c" 47 | #include "it2drivers/sb16mmx.h" 48 | #include "it2drivers/sb16mmx.c" 49 | #undef Get8BitWaveForm 50 | #undef Get16BitWaveForm 51 | #undef FilterSample 52 | #undef MixSample 53 | #undef MixSampleSurround 54 | #undef RampCurrVolumeL 55 | #undef RampCurrVolumeR 56 | #undef RAMPSPEED 57 | #undef RAMPCOMPENSATE 58 | #undef UpdatePos 59 | } 60 | namespace wavwriter { 61 | #include "it2drivers/wavwriter_m.h" 62 | #include "it2drivers/wavwriter_m.c" 63 | #include "it2drivers/wavwriter.h" 64 | #include "it2drivers/wavwriter.c" 65 | #undef Get8BitWaveForm 66 | #undef Get16BitWaveForm 67 | #undef FilterSample 68 | #undef MixSample 69 | #undef MixSampleSurround 70 | #undef RampCurrVolumeL 71 | #undef RampCurrVolumeR 72 | #undef RAMPSPEED 73 | #undef RAMPCOMPENSATE 74 | #undef UpdatePos 75 | } 76 | using namespace hq; 77 | using namespace sb16; 78 | using namespace sb16mmx; 79 | using namespace wavwriter; 80 | #include "it_structs.c" 81 | #include "it_d_rm.c" 82 | #include "it_m_eff.c" 83 | #include "it_music.c" 84 | #include "loaders/it.c" 85 | #include "loaders/s3m.c" 86 | } // namespace replay::it2play::play 87 | -------------------------------------------------------------------------------- /src/songdb/songdb.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2014-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include "common/std/optional.h" 7 | #include "common/std/string_view.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "common/constexpr.h" 15 | #include "common/songend.h" 16 | 17 | namespace songdb { 18 | 19 | constexpr size_t XXH_MAX_BYTES = 256 * 1024; // 256 KiB 20 | 21 | enum Source { 22 | //Hash = 0, // internal 23 | Songlengths = 1, 24 | ModInfos, 25 | Metadata, 26 | }; 27 | 28 | struct MetaData { 29 | std::string author; 30 | std::string album; 31 | std::string publisher; 32 | uint16_t year; 33 | }; 34 | 35 | struct ModInfo { 36 | std::string format; 37 | uint8_t channels; 38 | }; 39 | 40 | struct SubSongInfo { 41 | uint8_t subsong; 42 | common::SongEnd songend; 43 | bool is_duplicate; 44 | }; 45 | 46 | struct Info { 47 | std::vector subsongs; 48 | std::optional modinfo; 49 | std::optional metadata; 50 | constexpr_f2 int min_subsong() const noexcept { 51 | if (!subsongs.empty()) { 52 | return subsongs.front().subsong; 53 | } 54 | return -1; 55 | } 56 | constexpr_f2 int max_subsong() const noexcept { 57 | if (!subsongs.empty()) { 58 | return subsongs.back().subsong; 59 | } 60 | return -1; 61 | } 62 | }; 63 | 64 | // if sources is empty, all builtin sources are used 65 | void init(const std::string &songdb_path, const std::initializer_list &sources = {}) noexcept; 66 | 67 | std::optional lookup(const std::string &hash, int subsong) noexcept; 68 | std::optional lookup(const std::string &hash) noexcept; 69 | 70 | void update(const std::string &hash, const SubSongInfo &info, const int minsubsong, const int maxsubsong) noexcept; 71 | void update(const std::string &hash, const ModInfo &modinfo) noexcept; 72 | 73 | namespace blacklist { 74 | bool is_blacklisted_extension(const std::string &path, const std::string &ext, const std::set &whitelist) noexcept; 75 | bool is_blacklisted_hash(const std::string &hash) noexcept; 76 | bool is_blacklisted_songdb_hash(const std::string &hash) noexcept; 77 | } // namespace songdb::blacklist 78 | 79 | } // namespace songdb 80 | -------------------------------------------------------------------------------- /src/common/md5.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: CC-PDM-1.0 2 | /* MD5 3 | * converted to C++ class by Frank Thilo (thilo@unix-ag.org) 4 | * for bzflag (http://www.bzflag.org) 5 | * 6 | * based on: 7 | * 8 | * This is the header file for the MD5 message-digest algorithm. 9 | * The algorithm is due to Ron Rivest. This code was 10 | * written by Colin Plumb in 1993, no copyright is claimed. 11 | * This code is in the public domain; do with it what you wish. 12 | * 13 | * Equivalent code is available from RSA Data Security, Inc. 14 | * This code has been tested against that, and is equivalent, 15 | * except that you don't need to include two pages of legalese 16 | * with every copy. 17 | * 18 | * To compute the message digest of a chunk of bytes, declare an 19 | * MD5Context structure, pass it to MD5Init, call MD5Update as 20 | * needed on buffers full of bytes, and then call MD5Final, which 21 | * will fill a supplied 16-byte array with the digest. 22 | * 23 | * Changed so as no longer to depend on Colin Plumb's `usual.h' 24 | * header definitions; now uses stuff from dpkg's config.h 25 | * - Ian Jackson . 26 | * Still in the public domain. 27 | */ 28 | 29 | #ifndef BZF_MD5_H 30 | #define BZF_MD5_H 31 | 32 | /* system interface headers */ 33 | #include 34 | #include 35 | #ifdef __EXCEPTIONS 36 | #include 37 | #endif 38 | 39 | // a small class for calculating MD5 hashes of strings or byte arrays 40 | // it is not meant to be fast or secure 41 | // 42 | // usage: 1) feed it blocks of uchars with update() 43 | // 2) finalize() 44 | // 3) get hexdigest() string 45 | // or 46 | // MD5(std::string).hexdigest() 47 | // 48 | // assumes that char is 8 bit and int is 32 bit 49 | class MD5 50 | { 51 | public: 52 | uint8_t digest[16]; 53 | MD5(); 54 | MD5(const std::string& text); 55 | void update(const uint8_t *buf, uint32_t length); 56 | void finalize(); 57 | std::string hexdigest() const; 58 | #ifdef __EXCEPTIONS 59 | friend std::ostream& operator<<(std::ostream&, MD5 md5); 60 | #endif 61 | 62 | private: 63 | uint32_t buf[4]; 64 | uint32_t bytes[2]; 65 | uint32_t in[16]; 66 | bool finalized; 67 | void init(void); 68 | void transform(void); 69 | }; 70 | 71 | #endif 72 | 73 | // Local Variables: *** 74 | // mode: C++ *** 75 | // tab-width: 4 *** 76 | // c-basic-offset: 4 *** 77 | // indent-tabs-mode: nil *** 78 | // End: *** 79 | // ex: shiftwidth=4 tabstop=4 80 | -------------------------------------------------------------------------------- /scripts/audacious-uade.spec: -------------------------------------------------------------------------------- 1 | %define VERSION_ORIG %(cat ../VERSION) 2 | %define VERSION %(cat ../VERSION|sed s/'\-'/_/g) 3 | %global aud_ver 3.8 4 | %global libopenmpt_ver 0.6.0 5 | %global libxmp_ver 4.5.0 6 | %global deadbeef_ver 0.5.0 7 | %bcond_with deadbeef 8 | 9 | Name: audacious-uade 10 | Version: %{VERSION} 11 | Release: 1 12 | Requires: audacious >= %{aud_ver} 13 | %if 0%{?suse_version} 14 | Requires: libopenmpt0 >= %{libopenmpt_ver} 15 | Requires: libxmp4 >= %{libxmp_ver} 16 | %else 17 | Requires: libopenmpt >= %{libopenmpt_ver} 18 | %if %{undefined rhel} && %{undefined centos} 19 | Requires: libxmp >= %{libxmp_ver} 20 | %endif 21 | %endif 22 | %if %{with deadbeef} 23 | Requires: deadbeef >= %{deadbeef_ver} 24 | %endif 25 | Summary: UADE plugin for Audacious and DeaDBeeF 26 | 27 | License: GPL-2.0-or-later 28 | URL: https://github.com/mvtiaine/%{name} 29 | Source: %{name}-%{VERSION_ORIG}.tar.bz2 30 | 31 | BuildRequires: audacious-devel >= %{aud_ver} 32 | %if %{with deadbeef} 33 | BuildRequires: deadbeef-devel >= %{deadbeef_ver} 34 | %endif 35 | BuildRequires: libopenmpt-devel >= %{libopenmpt_ver} 36 | %if %{undefined rhel} && %{undefined centos} 37 | BuildRequires: libxmp-devel >= %{libxmp_ver} 38 | %endif 39 | BuildRequires: gcc-c++ 40 | BuildRequires: make 41 | BuildRequires: autoconf 42 | BuildRequires: automake 43 | BuildRequires: libtool 44 | BuildRequires: pkg-config 45 | 46 | %description 47 | Audacious (https://audacious-media-player.org/) and DeaDBeeF (https://deadbeef.sourceforge.io/) input plugin for UADE (https://zakalwe.fi/uade/) and other retro music replays 48 | 49 | %prep 50 | %autosetup -n %{name}-%{VERSION_ORIG} 51 | 52 | %build 53 | %configure \ 54 | --with-static-stdlibs=no \ 55 | %if %{undefined rhel} && %{undefined centos} 56 | --enable-players=all \ 57 | %endif 58 | --enable-plugin-audacious=yes \ 59 | %{?with_deadbeef:--enable-plugin-deadbeef=yes} \ 60 | %{?with_deadbeef:--with-deadbeef-plugindir=%{_libdir}/deadbeef} 61 | %make_build 62 | 63 | %install 64 | %make_install 65 | 66 | %check 67 | make -j check 68 | 69 | %files 70 | %license COPYING COPYING.LGPL NOTICE 71 | %doc AUTHORS ChangeLog README.md VERSION 72 | %{_libdir}/audacious/Input/uade.so 73 | %if %{with deadbeef} 74 | %{_libdir}/deadbeef/aaa_uade.so 75 | %endif 76 | %{_datadir}/%{name}/doc/* 77 | %{_datadir}/%{name}/ext/* 78 | %{_datadir}/%{name}/lib/uade/uadecore 79 | %{_datadir}/%{name}/share/uade/* 80 | %{_datadir}/%{name}/songdb/* 81 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/release/distrib/replay/lib/include/cubic_spline.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // ------------------------------------------------------ 3 | // Protrekkr 4 | // Based on Juan Antonio Arguelles Rius's NoiseTrekker. 5 | // 6 | // Copyright (C) 2008-2024 Franck Charlet. 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 13 | // 1. Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // 2. Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 21 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 24 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | // SUCH DAMAGE. 31 | // ------------------------------------------------------ 32 | 33 | #ifndef AUDACIOUS_UADE 34 | #pragma once 35 | #endif 36 | 37 | // ------------------------------------------------------ 38 | // Functions 39 | inline float Cubic_Work(float ym, float input, float y1, float y2, unsigned int res) 40 | { 41 | // 0..1.0f 42 | float x = (float) (((double) res) / 4294967296.0); 43 | 44 | // -0.5..0.5 45 | float z = x - 0.5f; 46 | float even1 = y1 + input; 47 | float odd1 = y1 - input; 48 | float even2 = y2 + ym; 49 | float odd2 = y2 - ym; 50 | 51 | float c0 = even1 * 0.45868f + even2 * 0.04131f; 52 | float c1 = odd1 * 0.48068f + odd2 * 0.17577f; 53 | float c2 = even1 * -0.24618f + even2 * 0.24614f; 54 | float c3 = odd1 * -0.36030f + odd2 * 0.10174f; 55 | return(((c3 * z + c2) * z + c1) * z + c0); 56 | } 57 | -------------------------------------------------------------------------------- /src/plugin/cli/precalc/precalc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o pipefail 4 | 5 | 6 | export PROBE=1 7 | export PLAY=$(dirname "$0")/../player/player 8 | export PRECALC=$(dirname "$0")/precalc 9 | export INCLUDEPATH=$1 10 | export TAC=$(which tac 2>/dev/null || echo tail -r) 11 | # avoid "illegal byte sequence" issues 12 | export LANG=C 13 | export LC_ALL=C 14 | export LC_CTYPE=C 15 | 16 | run_uade() { 17 | local HOME="/tmp/songdb/$1" 18 | local WORK="$HOME" 19 | mkdir -p $WORK 20 | echo "Processing $2" >> "$WORK/stderr" 21 | "$PRECALC" "$2" $INCLUDEPATH >> "$WORK/songdb.tsv" 2>> "$WORK/stderr" 22 | local RES=$? 23 | if [ "$RES" -gt "1" ]; then 24 | echo "Failed to process $2 - exit code $RES " | tee -a "$WORK/stderr" 25 | elif [ "$RES" -eq "0" ]; then 26 | local MD5=$(md5sum -b "$2" | head -c 32) 27 | local PLAYER="$(${PRECALC} "$2" player 2> /dev/null)" 28 | local SUBSONGS="$(${PRECALC} "$2" subsongs 2> /dev/null)" 29 | 30 | local AUDIO_CHROMAPRINT 31 | local AUDIO_MD5 32 | local AUDIO_BYTES 33 | 34 | local SUBSONG 35 | 36 | for SUBSONG in $SUBSONGS; do 37 | local SONGLENGTH_MILLIS=$($TAC "$WORK/songdb.tsv" | grep -a -m 1 "$MD5 $SUBSONG " | cut -f 3) 38 | if [ $SONGLENGTH_MILLIS -le 0 ]; then 39 | echo -e $MD5'\t'$PLAYER'\t'$SUBSONG'\t'0 >> "$WORK/audio.tsv" 40 | continue 41 | fi 42 | { 43 | local SONGLENGTH=$(( SONGLENGTH_MILLIS / 1000 + 1)) 44 | local MAX_BYTES=$((4 * 11025 * 1200)) 45 | local BYTES=$(( SONGLENGTH > 1200 ? MAX_BYTES : 4 * 11025 * SONGLENGTH )) 46 | # XXX chromaprint -channels parameter does not work on gentoo (ffmpeg issue?), use sox to force mono 47 | ${PLAY} 11025 "$2" $SUBSONG 2> /dev/null \ 48 | | head -c $BYTES \ 49 | | sox -t raw -b 16 -e signed -c 2 -r 11025 - -t raw -b 16 -e signed -c 1 -r 11025 -D - remix 1-2 \ 50 | | tee \ 51 | >(wc -c | xargs >&2) \ 52 | >(echo $(md5sum | head -c 32) >&2) \ 53 | | fpcalc -length 9999 -rate 11025 -channels 1 -format s16le -plain - 2>/dev/null 54 | } 2>&1 | { 55 | read AUDIO_MD5 56 | read AUDIO_BYTES 57 | read AUDIO_CHROMAPRINT 58 | echo -e $MD5'\t'$PLAYER'\t'$SUBSONG'\t'$AUDIO_BYTES'\t'$AUDIO_MD5'\t'$AUDIO_CHROMAPRINT >> "$WORK/audio.tsv" 59 | } 60 | done 61 | fi 62 | } 63 | 64 | mkdir -p /tmp/songdb 65 | 66 | export -f run_uade 67 | find -L . -type f | sed "s/^\.\///g" | parallel --nice 20 --timeout 3600 run_uade {%} {} 68 | 69 | cat /tmp/songdb/*/songdb.tsv | sort | uniq > /tmp/songdb/songdb.tsv 70 | cat /tmp/songdb/*/audio.tsv | sort | uniq > /tmp/songdb/audio.tsv 71 | cat /tmp/songdb/*/stderr > /tmp/songdb/stderr 72 | -------------------------------------------------------------------------------- /src/plugin/audacious/uade_prefs.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | constexpr const char *PLUGIN_NAME = "uade"; 9 | 10 | const char * const uade_defaults[] = { 11 | "filter", "2", // A1200 12 | "force_led_enabled", "FALSE", 13 | "force_led", "0", // OFF 14 | "resampler", "1", // Sinc 15 | "panning", "0.7", 16 | "headphones", "FALSE", 17 | "headphones2", "FALSE", 18 | "gain", "1.0", 19 | "subsong_timeout", "600", 20 | "silence_timeout", "10", 21 | nullptr 22 | }; 23 | 24 | const PreferencesWidget uade_audio_widgets1[] = { 25 | WidgetLabel("Filter"), 26 | // 0 reserved for "Auto" 27 | WidgetRadio("A500", WidgetInt(PLUGIN_NAME, "filter"), {1}, WIDGET_CHILD), 28 | WidgetRadio("A1200", WidgetInt(PLUGIN_NAME, "filter"), {2}, WIDGET_CHILD), 29 | WidgetRadio("None", WidgetInt(PLUGIN_NAME, "filter"), {3}, WIDGET_CHILD), 30 | 31 | WidgetLabel("Resampler"), 32 | WidgetRadio("Default", WidgetInt(PLUGIN_NAME, "resampler"), {0}, WIDGET_CHILD), 33 | WidgetRadio("Sinc", WidgetInt(PLUGIN_NAME, "resampler"), {1}, WIDGET_CHILD), 34 | WidgetRadio("None", WidgetInt(PLUGIN_NAME, "resampler"), {2}, WIDGET_CHILD), 35 | 36 | WidgetLabel("Force LED"), 37 | WidgetCheck("Enable", WidgetBool(PLUGIN_NAME, "force_led_enabled")), 38 | WidgetRadio("OFF", WidgetInt(PLUGIN_NAME, "force_led"), {0}, WIDGET_CHILD), 39 | WidgetRadio("ON", WidgetInt(PLUGIN_NAME, "force_led"), {1}, WIDGET_CHILD), 40 | }; 41 | 42 | const PreferencesWidget uade_audio_widgets2[] = { 43 | WidgetSeparator(), 44 | WidgetSeparator(), 45 | WidgetSpin("Panning", WidgetFloat(PLUGIN_NAME, "panning"), {0, 1, 0.1}), 46 | WidgetLabel("0 stereo 1 mono"), 47 | WidgetSeparator(), 48 | WidgetSpin("Volume gain", WidgetFloat(PLUGIN_NAME, "gain"), {0, 128.0, 0.1}), 49 | 50 | WidgetLabel("Headphones effect"), 51 | WidgetCheck("Enable", WidgetBool(PLUGIN_NAME, "headphones"), WIDGET_CHILD), 52 | WidgetLabel("Headphones 2 effect"), 53 | WidgetCheck("Enable", WidgetBool(PLUGIN_NAME, "headphones2"), WIDGET_CHILD), 54 | }; 55 | 56 | const PreferencesWidget uade_timeout_widgets[] = { 57 | WidgetLabel("Timeouts (seconds)"), 58 | WidgetLabel("Applied when songlength N/A", WIDGET_CHILD), 59 | WidgetSpin("Song timeout", WidgetInt(PLUGIN_NAME, "subsong_timeout"), {1, 3600, 5}, WIDGET_CHILD), 60 | WidgetSpin("Silence timeout", WidgetInt(PLUGIN_NAME, "silence_timeout"), {1, 3600, 1}, WIDGET_CHILD), 61 | }; 62 | -------------------------------------------------------------------------------- /src/common/compat.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: LGPL-2.1-or-later 2 | // Copyright (C) 2024-2025 Matti Tiainen 3 | 4 | #pragma once 5 | 6 | #include "constexpr.h" 7 | 8 | // XXX need trailing comma depending if __VA_OPT__ is supported or not (gcc < 8.1, clang < 6.0) 9 | #define PP_THIRD_ARG(a,b,c,...) c 10 | #define VA_OPT_SUPPORTED_I(...) PP_THIRD_ARG(__VA_OPT__(,),true,false,) 11 | #define VA_OPT_SUPPORTED VA_OPT_SUPPORTED_I(?) 12 | #if VA_OPT_SUPPORTED 13 | #define TRAILING_COMMA 14 | #else 15 | #define TRAILING_COMMA , 16 | #endif 17 | #define VA_LIST(...) __VA_ARGS__ TRAILING_COMMA 18 | 19 | #if defined(__QNX__) 20 | #include 21 | #if _NTO_VERSION <= 650 22 | // XXX error: call of overloaded 'to_string(const float&)' is ambiguous 23 | #define _GLIBCXX_USE_C99_STDIO 1 24 | #endif 25 | #endif 26 | 27 | #if (defined(__AMIGA__) || defined(__COSMOCC__) || defined(__serenity__)) && !defined(__amigaos4__) && !defined(WARPUP) 28 | #include 29 | #include 30 | extern "C" { 31 | #if defined(__MORPHOS__) 32 | inline void swab(const void *bfrom, void *bto, size_t n) noexcept { 33 | #else 34 | inline void swab(const void *bfrom, void *bto, ssize_t n) noexcept { 35 | #endif 36 | const char *from = (const char *) bfrom; 37 | char *to = (char *) bto; 38 | n &= ~((ssize_t) 1); 39 | while (n > 1) 40 | { 41 | const char b0 = from[--n], b1 = from[--n]; 42 | to[n] = b0; 43 | to[n + 1] = b1; 44 | } 45 | } 46 | } 47 | #endif 48 | 49 | #if (defined(__AMIGA__) || defined(__MINT__)) && !defined(__amigaos4__) && !defined(__MORPHOS__) 50 | 51 | namespace std { 52 | struct mutex { 53 | constexpr_f void lock() {} 54 | constexpr_f void unlock() {} 55 | }; 56 | } 57 | 58 | #endif // __AMIGA__ 59 | 60 | #if (defined(__QNX__) && _NTO_VERSION <= 650) || defined(__BLACKBERRY__) 61 | #include 62 | #include 63 | #include 64 | namespace std { 65 | constexpr_f2 int stoi(const std::string& str, size_t* idx = nullptr, int base = 10) { 66 | assert(idx == nullptr); 67 | assert(base == 10); 68 | return atoi(str.c_str()); 69 | } 70 | } 71 | #endif 72 | 73 | #if defined(__libnix__) || defined(__CLIB2__) || defined(__CLIB4__) || defined (__AROS__) || defined (__ixemul__) 74 | // XXX __NEWLIB__ may get defined via sys includes even with other runtimes 75 | # ifdef __NEWLIB__ 76 | # undef __NEWLIB__ 77 | # endif 78 | #endif 79 | 80 | #if defined(__CLIB2__) 81 | #warning "clib2 runtime not supported" 82 | #endif 83 | 84 | #if defined(__ixemul__) 85 | #warning "ixemul runtime not supported" 86 | #endif 87 | 88 | #if defined(__AMIGA__) && defined(__NEWLIB__) && !defined(__amigaos4__) 89 | #warning "newlib runtime not supported on AmigaOS3" 90 | #endif 91 | -------------------------------------------------------------------------------- /src/plugin/cli/songend/songend_main.cc: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | // Copyright (C) 2023 Matti Tiainen 3 | 4 | // Outputs song length in milliseconds to stdout based on the raw input audio to stdin. 5 | // Input must be raw S16LE mono at 8062Hz and have at least 3600s of audio. 6 | 7 | // Example usage with uade: 8 | // uade123 --stderr -s 0 -1 --subsong-timeout=3600 --silence-timeout=3600 --frequency=8062 --filter=none --resampler=none --panning=1 -e raw -f /dev/stdout 2>/dev/null | ./songend 9 | 10 | #include 11 | #include 12 | 13 | #include "player/player.h" 14 | #include "songend/detector.h" 15 | 16 | #include 17 | 18 | using namespace songend; 19 | using namespace std; 20 | 21 | constexpr ssize_t MINLENGTH = player::PRECALC_FREQ * 2 * 2 * (player::PRECALC_TIMEOUT - 1); 22 | 23 | int main(int argc, char *argv[]) { 24 | char buf[4096]; 25 | ssize_t total = 0; 26 | ssize_t count; 27 | 28 | detector::SongEndDetector detector(player::PRECALC_FREQ, false, endian::native); 29 | 30 | const string fname = argc < 2 ? "-" : argv[1]; 31 | bool is_stdin = (fname == "-"); 32 | 33 | int fd = STDIN_FILENO; 34 | if (!is_stdin) { 35 | FILE *f = fopen(fname.c_str(), "rb"); 36 | if (!f) { 37 | fprintf(stderr, "File not found: %s\n", fname.c_str()); 38 | return EXIT_FAILURE; 39 | } 40 | fd = fileno(f); 41 | } 42 | #ifdef __MINGW32__ 43 | else setmode (fileno (stdin), 0x8000); 44 | #endif 45 | while ((count = read(fd, buf, sizeof buf)) > 0) { 46 | detector.update(buf, count); 47 | total += count; 48 | } 49 | if (!is_stdin) { 50 | close(fd); 51 | } 52 | 53 | if (total < MINLENGTH) { 54 | fprintf(stderr, "Not enough data. got %zu required %zu\n", total, MINLENGTH); 55 | return EXIT_FAILURE; 56 | } 57 | 58 | int res = detector.detect_silence(player::SILENCE_TIMEOUT); 59 | if (res) { 60 | fprintf(stdout, "%d\n", res + player::MAX_SILENCE); 61 | return EXIT_SUCCESS; 62 | } 63 | res = detector.detect_volume(player::SILENCE_TIMEOUT); 64 | if (res) { 65 | fprintf(stdout, "%d\n", res + player::MAX_SILENCE); 66 | return EXIT_SUCCESS; 67 | } 68 | res = detector.detect_repeat(); 69 | if (res) { 70 | fprintf(stdout, "%d\n", res); 71 | return EXIT_SUCCESS; 72 | } 73 | res = detector.detect_loop(); 74 | if (res) { 75 | fprintf(stdout, "%d\n", res); 76 | return EXIT_SUCCESS; 77 | } else { 78 | fprintf(stderr, "Could not determine song length\n"); 79 | return EXIT_FAILURE; 80 | } 81 | 82 | return res ? EXIT_SUCCESS : EXIT_FAILURE; 83 | } 84 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr1/release/distrib/replay/lib/include/cubic_spline.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // ------------------------------------------------------ 3 | // Protrekkr 4 | // Based on Juan Antonio Arguelles Rius's NoiseTrekker. 5 | // 6 | // Copyright (C) 2008-2010 Franck Charlet. 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 13 | // 1. Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // 2. Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 21 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 24 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | // SUCH DAMAGE. 31 | // ------------------------------------------------------ 32 | 33 | #ifndef AUDACIOUS_UADE 34 | #pragma once 35 | #endif 36 | 37 | // ------------------------------------------------------ 38 | // Functions 39 | inline float Cubic_Work(float ym, float input, float y1, float y2, 40 | unsigned int res, long offset, long length) 41 | { 42 | // 0..1.0f 43 | float x = (float) (((float) res) / 4294967296.0); 44 | 45 | if(offset == 0) ym = 0; 46 | if(offset + 2 > length) y1 = 0; 47 | if(offset + 3 > length) y2 = 0; 48 | 49 | // -0.5..0.5 50 | float z = x - 0.5f; 51 | float even1 = y1 + input; 52 | float odd1 = y1 - input; 53 | float even2 = y2 + ym; 54 | float odd2 = y2 - ym; 55 | 56 | float c0 = even1 * 0.45868f + even2 * 0.04131f; 57 | float c1 = odd1 * 0.48068f + odd2 * 0.17577f; 58 | float c2 = even1 * -0.24618f + even2 * 0.24614f; 59 | float c3 = odd1 * -0.36030f + odd2 * 0.10174f; 60 | return(((c3 * z + c2) * z + c1) * z + c0); 61 | } 62 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr2/release/distrib/replay/lib/include/ptkreplay.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // ------------------------------------------------------ 3 | // Protrekkr 4 | // Based on Juan Antonio Arguelles Rius's NoiseTrekker. 5 | // 6 | // Copyright (C) 2008-2024 Franck Charlet. 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 13 | // 1. Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // 2. Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 21 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 24 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | // SUCH DAMAGE. 31 | // ------------------------------------------------------ 32 | 33 | #ifndef AUDACIOUS_UADE 34 | #pragma once 35 | 36 | // ------------------------------------------------------ 37 | // Includes 38 | #if defined(__WIN32__) 39 | #include 40 | #define PTKEXPORT __stdcall 41 | #else 42 | #define PTKEXPORT 43 | #endif 44 | #endif // AUDACIOUS_UADE 45 | // ------------------------------------------------------ 46 | // Functions 47 | #if !defined(__WINAMP__) 48 | #if defined(__WIN32__) 49 | int PTKEXPORT Ptk_InitDriver(HWND hWnd, int Latency); 50 | #else 51 | int PTKEXPORT Ptk_InitDriver(int Latency); 52 | #endif // __WIN32__ 53 | #else 54 | int PTKEXPORT Ptk_InitDriver(void); 55 | #endif // __WINAMP__ 56 | int PTKEXPORT Ptk_InitModule(unsigned char *Module, int start_position); 57 | int PTKEXPORT Ptk_GetRow(void); 58 | int PTKEXPORT Ptk_GetPosition(void); 59 | void PTKEXPORT Ptk_SetPosition(int position); 60 | void PTKEXPORT Ptk_Play(void); 61 | void PTKEXPORT Ptk_Stop(void); 62 | void PTKEXPORT Ptk_ReleaseDriver(void); 63 | -------------------------------------------------------------------------------- /scripts/sanitize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # -Werror 6 | make clean && CFLAGS="-Wall -Wpedantic -Wextra -Werror" CXXFLAGS="${CFLAGS}" ./configure && make -j check 7 | 8 | # assert disabled 9 | #make clean && CPPFLAGS="-DNDEBUG" CFLAGS="-Wall -Wpedantic -Wextra -Werror -Wno-unused" CXXFLAGS="${CFLAGS}" ./configure && make -j check 10 | 11 | # -Wformat 12 | #make clean && CFLAGS="-Wformat=2 -Werror" CXXFLAGS="${CFLAGS}" ./configure && make -j check 13 | 14 | # -D_FORTIFY_SOURCE=3 -fstrict-flex-arrays=3 15 | #make clean && CFLAGS="-O -fstrict-flex-arrays=3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Werror" CXXFLAGS="${CFLAGS}" ./configure && make -j check 16 | 17 | # -fstack-clash-protection -fstack-protector-strong -fcf-protection=full 18 | #make clean && CFLAGS="-fstack-clash-protection -fstack-protector-strong -fcf-protection=full -Werror" CXXFLAGS="${CFLAGS}" ./configure && make -j check 19 | 20 | # scan-build 21 | #make clean && ./configure && scan-build -disable-checker unix.Errno -disable-checker deadcode.DeadStores -analyze-headers --status-bugs make -j 22 | #make clean && ./configure && scan-build -disable-checker unix.Errno --exclude ./uade/src/ -analyze-headers --status-bugs make -j 23 | 24 | # -fanalyzer (no C++ support) 25 | #make clean && \ 26 | # CFLAGS="-fanalyzer" CXXFLAGS="${CFLAGS}" ./configure && \ 27 | # make -j check 28 | 29 | # sanitizers 30 | #make clean && \ 31 | # CFLAGS="-fsanitize=address -fno-sanitize-recover=all -Og -g" \ 32 | # CXXFLAGS="${CFLAGS}" LDFLAGS="-fsanitize=address" \ 33 | # ./configure && make -j check 34 | #make clean && \ 35 | # CFLAGS="-fsanitize=undefined -fno-sanitize-recover=all -fsanitize-ignorelist=$(realpath scripts/ubignorelist.txt) -Og -g" \ 36 | # CXXFLAGS="${CFLAGS}" LDFLAGS="-fsanitize=undefined" \ 37 | # ./configure && make -j check 38 | #make clean && \ 39 | # CFLAGS="-fsanitize=thread -fno-sanitize-recover=all -Og -g" \ 40 | # CXXFLAGS="${CFLAGS}" LDFLAGS="-fsanitize=thread" \ 41 | # ./configure && make -j check 42 | 43 | #make clean && 44 | # CFLAGS="-fsanitize=memory -fno-sanitize-recover=all " \ 45 | # CXXFLAGS="${CFLAGS}" LDFLAGS="-fsanitize=memory" \ 46 | # ./configure && make -j check 47 | #make clean && \ 48 | # CFLAGS="-flto -fsanitize=cfi -fno-sanitize-recover=all " \ 49 | # CXXFLAGS="${CFLAGS}" LDFLAGS="-fsanitize=cfi" \ 50 | # ./configure && make -j check 51 | 52 | # valgrind 53 | #make clean && \ 54 | # CFLAGS="-gdwarf-4" CXXFLAGS="${CFLAGS}" ./configure && \ 55 | # make -j check && \ 56 | # WRAPPER="$(which valgrind || echo valgrind) --quiet --exit-on-first-error=yes --error-exitcode=1 --trace-children=yes --track-origins=yes --leak-check=full " make -j2 check 57 | 58 | # callgrind 59 | #make clean && \ 60 | # CFLAGS="-gdwarf-4" CXXFLAGS="${CFLAGS}" ./configure && \ 61 | # make -j check && \ 62 | # WRAPPER="$(which valgrind || echo valgrind) --tool=callgrind" make -j check 63 | -------------------------------------------------------------------------------- /src/3rdparty/replay/protrekkr1/release/distrib/replay/lib/include/ptkreplay.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // ------------------------------------------------------ 3 | // Protrekkr 4 | // Based on Juan Antonio Arguelles Rius's NoiseTrekker. 5 | // 6 | // Copyright (C) 2008-2010 Franck Charlet. 7 | // All rights reserved. 8 | // 9 | // Redistribution and use in source and binary forms, with or without 10 | // modification, are permitted provided that the following conditions 11 | // are met: 12 | // 13 | // 1. Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // 2. Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND 21 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL FRANCK CHARLET OR CONTRIBUTORS BE LIABLE 24 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | // SUCH DAMAGE. 31 | // ------------------------------------------------------ 32 | 33 | #ifndef AUDACIOUS_UADE 34 | #pragma once 35 | 36 | // ------------------------------------------------------ 37 | // Includes 38 | #if defined(__WIN32__) 39 | #include 40 | #define PTKEXPORT __stdcall 41 | #endif 42 | 43 | #if defined(__LINUX__) || defined(__MACOSX__) || defined(__PSP__) || defined(__AMIGAOS4__) || defined(__AROS__) 44 | #define PTKEXPORT 45 | #endif 46 | #endif // AUDACIOUS_UADE 47 | 48 | // ------------------------------------------------------ 49 | // Functions 50 | #if !defined(__WINAMP__) 51 | #if defined(__WIN32__) 52 | int PTKEXPORT Ptk_InitDriver(HWND hWnd, int Latency); 53 | #else 54 | int PTKEXPORT Ptk_InitDriver(int Latency); 55 | #endif // __WIN32__ 56 | #else 57 | int PTKEXPORT Ptk_InitDriver(void); 58 | #endif // __WINAMP__ 59 | int PTKEXPORT Ptk_InitModule(unsigned char *Module, int start_position); 60 | int PTKEXPORT Ptk_GetRow(void); 61 | int PTKEXPORT Ptk_GetPosition(void); 62 | void PTKEXPORT Ptk_SetPosition(int position); 63 | void PTKEXPORT Ptk_Play(void); 64 | void PTKEXPORT Ptk_Stop(void); 65 | void PTKEXPORT Ptk_ReleaseDriver(void); 66 | -------------------------------------------------------------------------------- /src/plugin/cli/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # NOT a standalone Makefile.am 2 | 3 | noinst_PROGRAMS += \ 4 | plugin/cli/converter/converter \ 5 | plugin/cli/player/player \ 6 | plugin/cli/precalc/precalc \ 7 | plugin/cli/songdb/songdb \ 8 | plugin/cli/songend/songend 9 | 10 | EXTRA_DIST += \ 11 | plugin/cli/precalc/precalc.sh 12 | 13 | plugin_cli_common_SOURCES = \ 14 | plugin/cli/common/logger.cc 15 | 16 | plugin/cli/common/logger.% : CXXFLAGS += -Wno-format-nonliteral 17 | 18 | # converter 19 | plugin_cli_converter_converter_SOURCES = \ 20 | $(plugin_cli_common_SOURCES) \ 21 | plugin/cli/converter/converter_main.cc 22 | 23 | plugin_cli_converter_converter_LDADD = \ 24 | converter/libconverter.la 25 | 26 | # player 27 | plugin_cli_player_player_SOURCES = \ 28 | $(plugin_cli_common_SOURCES) \ 29 | plugin/cli/player/player_main.cc 30 | 31 | plugin_cli_player_player_LDADD = \ 32 | player/libplayer.la \ 33 | $(UADE_LIBS) \ 34 | $(LIBOPENMPT_LIBS) \ 35 | $(LIBXMP_LIBS) 36 | 37 | # precalc 38 | plugin_cli_precalc_precalc_SOURCES = \ 39 | $(plugin_cli_common_SOURCES) \ 40 | plugin/cli/precalc/precalc_main.cc 41 | 42 | plugin_cli_precalc_precalc_LDADD = \ 43 | songend/libsongend.la \ 44 | songdb/libsongdb.la \ 45 | common/libmd5.la \ 46 | 3rdparty/libxxhash.la \ 47 | $(UADE_LIBS) \ 48 | $(LIBOPENMPT_LIBS) \ 49 | $(LIBXMP_LIBS) 50 | 51 | # songdb 52 | plugin_cli_songdb_songdb_SOURCES = \ 53 | $(plugin_cli_common_SOURCES) \ 54 | plugin/cli/songdb/songdb_main.cc 55 | 56 | plugin_cli_songdb_songdb_LDADD = \ 57 | songdb/libsongdb.la \ 58 | 3rdparty/libxxhash.la 59 | 60 | # songend 61 | plugin_cli_songend_songend_SOURCES = \ 62 | $(plugin_cli_common_SOURCES) \ 63 | plugin/cli/songend/songend_main.cc 64 | 65 | plugin_cli_songend_songend_LDADD = \ 66 | songend/libsongend.la \ 67 | $(UADE_LIBS) \ 68 | $(LIBOPENMPT_LIBS) \ 69 | $(LIBXMP_LIBS) 70 | 71 | plugin_cli_converter_converter_SOURCES += plugin/cli/common/compat.cc 72 | plugin_cli_player_player_SOURCES += plugin/cli/common/compat.cc 73 | plugin_cli_precalc_precalc_SOURCES += plugin/cli/common/compat.cc 74 | plugin_cli_songdb_songdb_SOURCES += plugin/cli/common/compat.cc 75 | plugin_cli_songend_songend_SOURCES += plugin/cli/common/compat.cc 76 | 77 | if STATIC_STDLIBS 78 | static_ldflags = $(AM_LDFLAGS) $(STATIC_LDFLAGS) 79 | 80 | plugin_cli_converter_converter_SOURCES += plugin/cli/common/tinynew.cc 81 | plugin_cli_player_player_SOURCES += plugin/cli/common/tinynew.cc 82 | plugin_cli_precalc_precalc_SOURCES += plugin/cli/common/tinynew.cc 83 | plugin_cli_songdb_songdb_SOURCES += plugin/cli/common/tinynew.cc 84 | plugin_cli_songend_songend_SOURCES += plugin/cli/common/tinynew.cc 85 | 86 | plugin_cli_converter_converter_LDFLAGS = $(static_ldflags) 87 | plugin_cli_player_player_LDFLAGS = $(static_ldflags) 88 | plugin_cli_precalc_precalc_LDFLAGS = $(static_ldflags) 89 | plugin_cli_songdb_songdb_LDFLAGS = $(static_ldflags) 90 | plugin_cli_songend_songend_LDFLAGS = $(static_ldflags) 91 | endif 92 | --------------------------------------------------------------------------------