Skip to content

Commit

Permalink
remove the external music player (cmd) support.
Browse files Browse the repository at this point in the history
Closes #640
  • Loading branch information
sezero committed Oct 8, 2024
1 parent e32ba24 commit 1cd7c62
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 451 deletions.
32 changes: 0 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ endif()
option(SDLMIXER_SAMPLES "Build the SDL3_mixer sample program(s)" ${SDLMIXER_SAMPLES_DEFAULT})
cmake_dependent_option(SDLMIXER_SAMPLES_INSTALL "Install the SDL3_mixer sample program(s)" OFF "SDLMIXER_SAMPLES;SDLMIXER_INSTALL" OFF)

if(UNIX AND NOT APPLE)
set(sdl3mixer_cmd_default ON)
else()
set(sdl3mixer_cmd_default OFF)
endif()
option(SDLMIXER_CMD "Support an external music player" ${sdl3mixer_cmd_default})

option(SDLMIXER_SNDFILE "Support loading sounds via libsndfile" OFF)
option(SDLMIXER_SNDFILE_SHARED "Dynamically load libsndfile" "${SDLMIXER_DEPS_SHARED}")

Expand Down Expand Up @@ -236,7 +229,6 @@ add_library(${sdl3_mixer_target_name}
src/codecs/load_voc.c
src/codecs/load_sndfile.c
src/codecs/mp3utils.c
src/codecs/music_cmd.c
src/codecs/music_drflac.c
src/codecs/music_flac.c
src/codecs/music_fluidsynth.c
Expand Down Expand Up @@ -343,30 +335,6 @@ set(PC_LIBS)
set(PC_REQUIRES)
set(SDLMIXER_BACKENDS)

list(APPEND SDLMIXER_BACKENDS CMD)
set(SDLMIXER_CMD_ENABLED FALSE)
if(SDLMIXER_CMD)
target_compile_definitions(${sdl3_mixer_target_name} PRIVATE MUSIC_CMD)
set(fork_found OFF)
if(NOT fork_found)
check_symbol_exists(fork unistd.h HAVE_FORK)
if(HAVE_FORK)
set(SDLMIXER_CMD_ENABLED TRUE)
target_compile_definitions(${sdl3_mixer_target_name} PRIVATE HAVE_FORK)
endif()
endif()
if(NOT fork_found)
check_symbol_exists(vfork unistd.h HAVE_VFORK)
if(HAVE_VFORK)
set(SDLMIXER_CMD_ENABLED TRUE)
target_compile_definitions(${sdl3_mixer_target_name} PRIVATE HAVE_VFORK)
endif()
endif()
if(NOT SDLMIXER_CMD_ENABLED)
message(${fatal_error} "Neither fork() nor vfork() or available on this platform. Reconfigure with -DSDLMIXER_CMD=OFF.")
endif()
endif()

list(APPEND SDLMIXER_BACKENDS SNDFILE)
set(SDLMIXER_SNDFILE_ENABLED FALSE)
if(SDLMIXER_SNDFILE)
Expand Down
2 changes: 0 additions & 2 deletions VisualC/SDL_mixer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@
<ClInclude Include="..\src\codecs\load_sndfile.h" />
<ClInclude Include="..\src\codecs\load_voc.h" />
<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_flac.h" />
<ClInclude Include="..\src\codecs\music_fluidsynth.h" />
Expand Down Expand Up @@ -447,7 +446,6 @@
<ClCompile Include="..\src\codecs\load_sndfile.c" />
<ClCompile Include="..\src\codecs\load_voc.c" />
<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_flac.c" />
<ClCompile Include="..\src\codecs\music_fluidsynth.c" />
Expand Down
6 changes: 0 additions & 6 deletions VisualC/SDL_mixer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
<ClInclude Include="..\src\codecs\mp3utils.h">
<Filter>Sources</Filter>
</ClInclude>
<ClInclude Include="..\src\codecs\music_cmd.h">
<Filter>Sources</Filter>
</ClInclude>
<ClInclude Include="..\src\codecs\music_drflac.h">
<Filter>Sources</Filter>
</ClInclude>
Expand Down Expand Up @@ -167,9 +164,6 @@
<ClCompile Include="..\src\codecs\mp3utils.c">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\music_cmd.c">
<Filter>Sources</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\music_drflac.c">
<Filter>Sources</Filter>
</ClCompile>
Expand Down
2 changes: 0 additions & 2 deletions VisualC/pkg-support/cmake/sdl3_mixer-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ set(SDL3_mixer_FOUND TRUE)

set(SDLMIXER_VENDORED TRUE)

set(SDLMIXER_CMD FALSE)

set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)

Expand Down
8 changes: 0 additions & 8 deletions Xcode/SDL_mixer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
AAE405FB1F9607C300EDAF53 /* music_timidity.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405D71F9607C200EDAF53 /* music_timidity.c */; };
AAE405FD1F9607C300EDAF53 /* music_ogg.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405D91F9607C200EDAF53 /* music_ogg.c */; };
AAE405FE1F9607C300EDAF53 /* music_nativemidi.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE405DA1F9607C200EDAF53 /* music_nativemidi.h */; };
AAE405FF1F9607C300EDAF53 /* music_cmd.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE405DB1F9607C200EDAF53 /* music_cmd.h */; };
AAE406021F9607C300EDAF53 /* music_cmd.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405DE1F9607C300EDAF53 /* music_cmd.c */; };
AAE406031F9607C300EDAF53 /* music_mpg123.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405DF1F9607C300EDAF53 /* music_mpg123.c */; };
AAE406041F9607C300EDAF53 /* effect_stereoreverse.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE405E01F9607C300EDAF53 /* effect_stereoreverse.c */; };
AAE406051F9607C300EDAF53 /* effects_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = AAE405E11F9607C300EDAF53 /* effects_internal.h */; };
Expand Down Expand Up @@ -202,8 +200,6 @@
AAE405D71F9607C200EDAF53 /* music_timidity.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_timidity.c; sourceTree = "<group>"; };
AAE405D91F9607C200EDAF53 /* music_ogg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_ogg.c; sourceTree = "<group>"; };
AAE405DA1F9607C200EDAF53 /* music_nativemidi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_nativemidi.h; sourceTree = "<group>"; };
AAE405DB1F9607C200EDAF53 /* music_cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_cmd.h; sourceTree = "<group>"; };
AAE405DE1F9607C300EDAF53 /* music_cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_cmd.c; sourceTree = "<group>"; };
AAE405DF1F9607C300EDAF53 /* music_mpg123.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_mpg123.c; sourceTree = "<group>"; };
AAE405E01F9607C300EDAF53 /* effect_stereoreverse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = effect_stereoreverse.c; sourceTree = "<group>"; };
AAE405E11F9607C300EDAF53 /* effects_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = effects_internal.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -321,8 +317,6 @@
AAE405C31F9607C000EDAF53 /* load_voc.h */,
639197EF239FE66700F1D8F8 /* mp3utils.c */,
639197F0239FE66700F1D8F8 /* mp3utils.h */,
AAE405DE1F9607C300EDAF53 /* music_cmd.c */,
AAE405DB1F9607C200EDAF53 /* music_cmd.h */,
F37A8D492838A23400C38E95 /* music_drflac.c */,
F37A8D412838A23400C38E95 /* music_drflac.h */,
AAE405D41F9607C100EDAF53 /* music_flac.c */,
Expand Down Expand Up @@ -481,7 +475,6 @@
F30240632881DF95002F32D6 /* music_xmp.h in Headers */,
AAE405E41F9607C300EDAF53 /* mixer.h in Headers */,
F3F8795829B30FDA0007FDA1 /* load_sndfile.h in Headers */,
AAE405FF1F9607C300EDAF53 /* music_cmd.h in Headers */,
F3F8795229B30FDA0007FDA1 /* music_gme.h in Headers */,
AAE405EB1F9607C300EDAF53 /* music_flac.h in Headers */,
AAE406051F9607C300EDAF53 /* effects_internal.h in Headers */,
Expand Down Expand Up @@ -701,7 +694,6 @@
AAE405F41F9607C300EDAF53 /* effect_position.c in Sources */,
AAE405F81F9607C300EDAF53 /* music_flac.c in Sources */,
AAE405F21F9607C300EDAF53 /* effects_internal.c in Sources */,
AAE406021F9607C300EDAF53 /* music_cmd.c in Sources */,
F3F8795029B30FDA0007FDA1 /* load_sndfile.c in Sources */,
AAE405FB1F9607C300EDAF53 /* music_timidity.c in Sources */,
F37A8DB52838AD1300C38E95 /* music_ogg_stb.c in Sources */,
Expand Down
2 changes: 0 additions & 2 deletions Xcode/pkg-support/resources/CMake/sdl3_mixer-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ set(SDL3_mixer_FOUND TRUE)

set(SDLMIXER_VENDORED TRUE)

set(SDLMIXER_CMD FALSE)

set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)

Expand Down
2 changes: 0 additions & 2 deletions cmake/SDL3_mixerConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ set(SDL3_mixer_FOUND ON)

set(SDLMIXER_VENDORED @SDLMIXER_VENDORED@)

set(SDLMIXER_CMD @SDLMIXER_CMD_ENABLED@)

set(SDLMIXER_SNDFILE @SDLMIXER_SNDFILE_ENABLED@)

set(SDLMIXER_FLAC @SDLMIXER_FLAC_ENABLED@)
Expand Down
6 changes: 0 additions & 6 deletions examples/playmus.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ int main(int argc, char *argv[])
/* Set the music volume */
Mix_VolumeMusic(audio_volume);

/* Set the external music player, if any */
Mix_SetMusicCMD(SDL_getenv("MUSIC_CMD"));

while (argv[i]) {
next_track = 0;

Expand All @@ -222,9 +219,6 @@ int main(int argc, char *argv[])
}

switch (Mix_GetMusicType(music)) {
case MUS_CMD:
typ = "CMD";
break;
case MUS_WAV:
typ = "WAV";
break;
Expand Down
25 changes: 0 additions & 25 deletions include/SDL3_mixer/SDL_mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ typedef enum Mix_Fading {
*/
typedef enum Mix_MusicType {
MUS_NONE,
MUS_CMD,
MUS_WAV,
MUS_MOD,
MUS_MID,
Expand Down Expand Up @@ -2440,30 +2439,6 @@ extern SDL_DECLSPEC int SDLCALL Mix_Playing(int channel);
*/
extern SDL_DECLSPEC bool SDLCALL Mix_PlayingMusic(void);

/**
* Run an external command as the music stream.
*
* This halts any currently-playing music, and next time the music stream is
* played, SDL_mixer will spawn a process using the command line specified in
* `command`. This command is not subject to shell expansion, and beyond some
* basic splitting up of arguments, is passed to execvp() on most platforms,
* not system().
*
* The command is responsible for generating sound; it is NOT mixed by
* SDL_mixer! SDL_mixer will kill the child process if asked to halt the
* music, but otherwise does not have any control over what the process does.
*
* You are strongly encouraged not to use this function without an extremely
* good reason.
*
* \param command command.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL_mixer 3.0.0.
*/
extern SDL_DECLSPEC bool SDLCALL Mix_SetMusicCMD(const char *command);

/**
* Set SoundFonts paths to use by supported MIDI backends.
*
Expand Down
1 change: 0 additions & 1 deletion src/SDL_mixer.sym
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ SDL3_mixer_0.0.0 {
Mix_ResumeMusic;
Mix_RewindMusic;
Mix_SetDistance;
Mix_SetMusicCMD;
Mix_SetMusicPosition;
Mix_SetPanning;
Mix_SetPosition;
Expand Down
Loading

0 comments on commit 1cd7c62

Please sign in to comment.