Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/SDL2' into MorphOS
Browse files Browse the repository at this point in the history
  • Loading branch information
BeWorld2018 committed Feb 2, 2024
2 parents a713372 + b25e80c commit ccac3d5
Show file tree
Hide file tree
Showing 67 changed files with 7,473 additions and 5,830 deletions.
10 changes: 5 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ SUPPORT_OGG ?= false
OGG_LIBRARY_PATH := external/ogg
VORBIS_LIBRARY_PATH := external/tremor

# Enable this if you want to support loading MP3 music via dr_mp3
SUPPORT_MP3_DRMP3 ?= true
# Enable this if you want to support loading MP3 music via MINIMP3
SUPPORT_MP3_MINIMP3 ?= true

# Enable this if you want to support loading MP3 music via MPG123
SUPPORT_MP3_MPG123 ?= false
Expand Down Expand Up @@ -120,8 +120,8 @@ ifeq ($(SUPPORT_OGG),true)
LOCAL_STATIC_LIBRARIES += ogg vorbisidec
endif

ifeq ($(SUPPORT_MP3_DRMP3),true)
LOCAL_CFLAGS += -DMUSIC_MP3_DRMP3
ifeq ($(SUPPORT_MP3_MINIMP3),true)
LOCAL_CFLAGS += -DMUSIC_MP3_MINIMP3
endif

# This needs to be a shared library to comply with the LGPL license
Expand All @@ -132,7 +132,7 @@ ifeq ($(SUPPORT_MP3_MPG123),true)
endif

ifeq ($(SUPPORT_WAVPACK),true)
LOCAL_CFLAGS += -DMUSIC_WAVPACK -DWAVPACK_HEADER=\"../external/wavpack/include/wavpack.h\"
LOCAL_CFLAGS += -DMUSIC_WAVPACK -DMUSIC_WAVPACK_DSD -DWAVPACK_HEADER=\"../external/wavpack/include/wavpack.h\"
LOCAL_STATIC_LIBRARIES += wavpack
endif

Expand Down
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2.8.0:
* Added support for loading wavpack sound files (https://www.wavpack.com/)
* Added support for loading classic console sound files using Game_Music_Emu (https://github.com/libgme/game-music-emu)
* Use minimp3 instead of dr_mp3 as the default backend for MP3 music
* Use libxmp instead of modplug as the default backend for MOD music
To use libmodplug instead, configure using --enable-music-mod-modplug --disable-music-mod-xmp
* Added support for FLAC audio in Ogg containers
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

# See docs/release_checklist.md
set(MAJOR_VERSION 2)
set(MINOR_VERSION 7)
set(MICRO_VERSION 1)
set(MINOR_VERSION 8)
set(MICRO_VERSION 0)
set(SDL_REQUIRED_VERSION 2.0.9)

include(PrivateSdlFunctions)
Expand Down Expand Up @@ -126,13 +126,13 @@ endif()

option(SDL2MIXER_MP3 "Enable MP3 music" ON)

cmake_dependent_option(SDL2MIXER_MP3_DRMP3 "Support loading MP3 music via dr_mp3" ON SDL2MIXER_MP3 OFF)
cmake_dependent_option(SDL2MIXER_MP3_MINIMP3 "Support loading MP3 music via minimp3" ON SDL2MIXER_MP3 OFF)

cmake_dependent_option(SDL2MIXER_MP3_MPG123 "Support loading MP3 music via MPG123" OFF SDL2MIXER_MP3 OFF)
cmake_dependent_option(SDL2MIXER_MP3_MPG123_SHARED "Dynamically load mpg123" "${SDL2MIXER_DEPS_SHARED}" SDL2MIXER_MP3_MPG123 OFF)

if(SDL2MIXER_MP3 AND NOT (SDL2MIXER_MP3_DRMP3 OR SDL2MIXER_MP3_MPG123))
message(FATAL_ERROR "MP3 support was enabled (SDL2MIXER_MP3) but neither drmp3 (SDL2MIXER_MP3_DRMP3) or mpg123 (SDL2MIXER_MP3_MPG123) were enabled.")
if(SDL2MIXER_MP3 AND NOT (SDL2MIXER_MP3_MINIMP3 OR SDL2MIXER_MP3_MPG123))
message(FATAL_ERROR "MP3 support was enabled (SDL2MIXER_MP3) but neither minimp3 (SDL2MIXER_MP3_MINIMP3) or mpg123 (SDL2MIXER_MP3_MPG123) were enabled.")
endif()

option(SDL2MIXER_MIDI "Enable MIDI music" ON)
Expand Down Expand Up @@ -219,10 +219,10 @@ add_library(SDL2_mixer
src/codecs/mp3utils.c
src/codecs/music_cmd.c
src/codecs/music_drflac.c
src/codecs/music_drmp3.c
src/codecs/music_flac.c
src/codecs/music_fluidsynth.c
src/codecs/music_gme.c
src/codecs/music_minimp3.c
src/codecs/music_modplug.c
src/codecs/music_mpg123.c
src/codecs/music_nativemidi.c
Expand Down Expand Up @@ -726,8 +726,8 @@ if(SDL2MIXER_MOD_XMP)
endif()
endif()

if(SDL2MIXER_MP3_DRMP3)
target_compile_definitions(SDL2_mixer PRIVATE MUSIC_MP3_DRMP3)
if(SDL2MIXER_MP3_MINIMP3)
target_compile_definitions(SDL2_mixer PRIVATE MUSIC_MP3_MINIMP3)
endif()

if(SDL2MIXER_MP3_MPG123)
Expand Down
17 changes: 10 additions & 7 deletions Makefile.os2
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

LIBNAME = SDL2mix
MAJOR_VERSION = 2
MINOR_VERSION = 7
MICRO_VERSION = 1
MINOR_VERSION = 8
MICRO_VERSION = 0
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)

TITLENAME = $(LIBNAME) $(VERSION)
Expand All @@ -33,8 +33,8 @@ USE_DRFLAC=no
USE_OPUS=yes
# mp3 music support (using mpg123)
USE_MPG123=yes
# mp3 music support (using dr_mp3)
USE_DRMP3=no
# mp3 music support (using minimp3)
USE_MINIMP3=no
# wavpack music support
USE_WAVPACK=yes
# wavpack DSD music support
Expand All @@ -60,7 +60,7 @@ SRCS = utils.c effect_position.c effects_internal.c effect_stereoreverse.c mixer
SRCS+= load_aiff.c load_voc.c music_wav.c &
music_ogg.c music_ogg_stb.c music_opus.c &
music_flac.c music_drflac.c music_wavpack.c &
mp3utils.c music_mpg123.c music_drmp3.c &
mp3utils.c music_mpg123.c music_minimp3.c &
music_xmp.c music_modplug.c music_gme.c &
music_fluidsynth.c music_timidity.c
# timidity sources:
Expand Down Expand Up @@ -142,8 +142,8 @@ NEED_LIBOGG=yes
CFLAGS+= -DMUSIC_MP3_MPG123
LIBS+= mpg123.lib
!endif
!ifeq USE_DRMP3 yes
CFLAGS+= -DMUSIC_MP3_DRMP3
!ifeq USE_MINIMP3 yes
CFLAGS+= -DMUSIC_MP3_MINIMP3
!endif

!ifeq USE_XMP yes
Expand Down Expand Up @@ -199,6 +199,9 @@ $(LNKFILE):
.c.obj:
wcc386 $(CFLAGS) -fo=$^@ $<

music_minimp3.obj: music_minimp3.c
wcc386 $(CFLAGS) -za99 -fo=$^@ $<

playmus.obj: playmus.c
wcc386 $(CFLAGS_BASE) -fo=$^@ $<

Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Support for software MIDI, MOD, and Opus are not included by default because of
- When building with Xcode, you can edit the config at the top of the project to enable them, and you will need to include the appropriate framework in your application.
- For Android, you can edit the config at the top of Android.mk to enable them.

The default MP3 support is provided using dr_mp3. SDL_mixer also supports using libmpg123: you can enable it by passing --enable-music-mp3-mpg123 to configure.
The default MP3 support is provided using minimp3. SDL_mixer also supports using libmpg123: you can enable it by passing --enable-music-mp3-mpg123 to configure.
2 changes: 1 addition & 1 deletion SDL2_mixerConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set(SDL2MIXER_MOD_XMP @SDL2MIXER_MOD_XMP@)
set(SDL2MIXER_MOD_XMP_LITE @SDL2MIXER_MOD_XMP_LITE@)

set(SDL2MIXER_MP3 @SDL2MIXER_MP3@)
set(SDL2MIXER_MP3_DRMP3 @SDL2MIXER_MP3_DRMP3@)
set(SDL2MIXER_MP3_MINIMP3 @SDL2MIXER_MP3_MINIMP3@)
set(SDL2MIXER_MP3_MPG123 @SDL2MIXER_MP3_MPG123@)

set(SDL2MIXER_MIDI @SDL2MIXER_MIDI@)
Expand Down
16 changes: 8 additions & 8 deletions VisualC-WinRT/SDL_mixer-UWP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
<ClCompile Include="..\src\codecs\mp3utils.c" />
<ClCompile Include="..\src\codecs\music_cmd.c" />
<ClCompile Include="..\src\codecs\music_drflac.c" />
<ClCompile Include="..\src\codecs\music_drmp3.c" />
<ClCompile Include="..\src\codecs\music_flac.c" />
<ClCompile Include="..\src\codecs\music_fluidsynth.c" />
<ClCompile Include="..\src\codecs\music_gme.c" />
<ClCompile Include="..\src\codecs\music_minimp3.c" />
<ClCompile Include="..\src\codecs\music_modplug.c" />
<ClCompile Include="..\src\codecs\music_mpg123.c" />
<ClCompile Include="..\src\codecs\music_nativemidi.c" />
Expand Down Expand Up @@ -69,10 +69,10 @@
<ClInclude Include="..\src\codecs\mp3utils.h" />
<ClInclude Include="..\src\codecs\music_cmd.h" />
<ClInclude Include="..\src\codecs\music_drflac.h" />
<ClInclude Include="..\src\codecs\music_drmp3.h" />
<ClInclude Include="..\src\codecs\music_flac.h" />
<ClInclude Include="..\src\codecs\music_fluidsynth.h" />
<ClInclude Include="..\src\codecs\music_gme.h" />
<ClInclude Include="..\src\codecs\music_minimp3.h" />
<ClInclude Include="..\src\codecs\music_modplug.h" />
<ClInclude Include="..\src\codecs\music_mpg123.h" />
<ClInclude Include="..\src\codecs\music_nativemidi.h" />
Expand Down Expand Up @@ -202,7 +202,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -215,7 +215,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -228,7 +228,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -241,7 +241,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -254,7 +254,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -267,7 +267,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\include;..\src;..\src\codecs;..\src\codecs\timidity;..\external\ogg\include;..\external\vorbis\include;..\..\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_DRMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_CRT_SECURE_NO_WARNINGS;MUSIC_WAV;MUSIC_FLAC_DRFLAC;MUSIC_MP3_MINIMP3;MUSIC_OGG;OGG_USE_STB;MUSIC_MID_TIMIDITY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
14 changes: 7 additions & 7 deletions VisualC-WinRT/SDL_mixer-UWP.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@
<ClCompile Include="..\src\codecs\music_drflac.c">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\music_drmp3.c">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\music_flac.c">
<Filter>Sources</Filter>
</ClCompile>
Expand All @@ -73,6 +70,9 @@
<ClCompile Include="..\src\codecs\music_gme.c">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\music_minimp3.c">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\music_modplug.c">
<Filter>Sources</Filter>
</ClCompile>
Expand Down Expand Up @@ -156,9 +156,6 @@
<ClInclude Include="..\src\codecs\music_drflac.h">
<Filter>Sources</Filter>
</ClInclude>
<ClInclude Include="..\src\codecs\music_drmp3.h">
<Filter>Sources</Filter>
</ClInclude>
<ClInclude Include="..\src\codecs\music_flac.h">
<Filter>Sources</Filter>
</ClInclude>
Expand All @@ -168,6 +165,9 @@
<ClInclude Include="..\src\codecs\music_gme.h">
<Filter>Sources</Filter>
</ClInclude>
<ClInclude Include="..\src\codecs\music_minimp3.h">
<Filter>Sources</Filter>
</ClInclude>
<ClInclude Include="..\src\codecs\music_modplug.h">
<Filter>Sources</Filter>
</ClInclude>
Expand Down Expand Up @@ -207,4 +207,4 @@
<UniqueIdentifier>{9c43d0b0-edae-4dea-bb19-5bd7972e58bc}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>
Loading

0 comments on commit ccac3d5

Please sign in to comment.