SDL_mixer: Move the dr_libs files into a subdirectory

From 7c8d77c79027a3af624117947ffa6f650f9774ed Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 20 May 2022 23:33:12 -0700
Subject: [PATCH] Move the dr_libs files into a subdirectory

---
 Xcode/SDL_mixer.xcodeproj/project.pbxproj | 12 ------
 src/codecs/dr_libs/LICENSE                | 47 +++++++++++++++++++++++
 src/codecs/dr_libs/README.md              | 21 ++++++++++
 src/codecs/{ => dr_libs}/dr_flac.h        |  0
 src/codecs/{ => dr_libs}/dr_mp3.h         |  0
 src/codecs/music_drflac.c                 |  2 +-
 src/codecs/music_drmp3.c                  |  2 +-
 7 files changed, 70 insertions(+), 14 deletions(-)
 create mode 100644 src/codecs/dr_libs/LICENSE
 create mode 100644 src/codecs/dr_libs/README.md
 rename src/codecs/{ => dr_libs}/dr_flac.h (100%)
 rename src/codecs/{ => dr_libs}/dr_mp3.h (100%)

diff --git a/Xcode/SDL_mixer.xcodeproj/project.pbxproj b/Xcode/SDL_mixer.xcodeproj/project.pbxproj
index 089237e8..f4885a0b 100644
--- a/Xcode/SDL_mixer.xcodeproj/project.pbxproj
+++ b/Xcode/SDL_mixer.xcodeproj/project.pbxproj
@@ -56,10 +56,6 @@
 		F37A8D302838924900C38E95 /* music_drmp3.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8D2C2838924900C38E95 /* music_drmp3.c */; };
 		F37A8D4A2838A23400C38E95 /* music_drflac.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D412838A23400C38E95 /* music_drflac.h */; };
 		F37A8D4B2838A23400C38E95 /* music_drflac.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D412838A23400C38E95 /* music_drflac.h */; };
-		F37A8D4C2838A23400C38E95 /* dr_mp3.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D472838A23400C38E95 /* dr_mp3.h */; };
-		F37A8D4D2838A23400C38E95 /* dr_mp3.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D472838A23400C38E95 /* dr_mp3.h */; };
-		F37A8D4E2838A23400C38E95 /* dr_flac.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D482838A23400C38E95 /* dr_flac.h */; };
-		F37A8D4F2838A23400C38E95 /* dr_flac.h in Headers */ = {isa = PBXBuildFile; fileRef = F37A8D482838A23400C38E95 /* dr_flac.h */; };
 		F37A8D502838A23400C38E95 /* music_drflac.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8D492838A23400C38E95 /* music_drflac.c */; };
 		F37A8D512838A23400C38E95 /* music_drflac.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8D492838A23400C38E95 /* music_drflac.c */; };
 		F37A8DB52838AD1300C38E95 /* music_ogg_stb.c in Sources */ = {isa = PBXBuildFile; fileRef = F37A8DB42838AD1200C38E95 /* music_ogg_stb.c */; };
@@ -186,8 +182,6 @@
 		F37A8D2B2838924900C38E95 /* music_drmp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_drmp3.h; sourceTree = "<group>"; };
 		F37A8D2C2838924900C38E95 /* music_drmp3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_drmp3.c; sourceTree = "<group>"; };
 		F37A8D412838A23400C38E95 /* music_drflac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = music_drflac.h; sourceTree = "<group>"; };
-		F37A8D472838A23400C38E95 /* dr_mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dr_mp3.h; sourceTree = "<group>"; };
-		F37A8D482838A23400C38E95 /* dr_flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dr_flac.h; sourceTree = "<group>"; };
 		F37A8D492838A23400C38E95 /* music_drflac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_drflac.c; sourceTree = "<group>"; };
 		F37A8DB42838AD1200C38E95 /* music_ogg_stb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = music_ogg_stb.c; sourceTree = "<group>"; };
 		F3968B90281F817E00661875 /* opus.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = opus.xcodeproj; path = opus/opus.xcodeproj; sourceTree = "<group>"; };
@@ -281,8 +275,6 @@
 		6398B0BB238528360024EEA1 /* codecs */ = {
 			isa = PBXGroup;
 			children = (
-				F37A8D482838A23400C38E95 /* dr_flac.h */,
-				F37A8D472838A23400C38E95 /* dr_mp3.h */,
 				AAE405BE1F9607BF00EDAF53 /* load_aiff.c */,
 				AAE405D21F9607C100EDAF53 /* load_aiff.h */,
 				AAE405CC1F9607C000EDAF53 /* load_voc.c */,
@@ -406,7 +398,6 @@
 				AAE405E31F9607C300EDAF53 /* music_fluidsynth.h in Headers */,
 				AAE405F31F9607C300EDAF53 /* music_mikmod.h in Headers */,
 				AAE405F61F9607C300EDAF53 /* load_aiff.h in Headers */,
-				F37A8D4E2838A23400C38E95 /* dr_flac.h in Headers */,
 				AAE405E71F9607C300EDAF53 /* load_voc.h in Headers */,
 				AAE405EC1F9607C300EDAF53 /* music_wav.h in Headers */,
 				F37A8D2D2838924900C38E95 /* music_drmp3.h in Headers */,
@@ -423,7 +414,6 @@
 				AAE405E61F9607C300EDAF53 /* music.h in Headers */,
 				F382335F2731963800F7F527 /* native_midi.h in Headers */,
 				BE1FA8CD07AF96B2004B6283 /* SDL_mixer.h in Headers */,
-				F37A8D4C2838A23400C38E95 /* dr_mp3.h in Headers */,
 				AAE405F51F9607C300EDAF53 /* music_ogg.h in Headers */,
 				630FBD8520D5211F009867AB /* music_opus.h in Headers */,
 				639008C92385A822009019FA /* utils.h in Headers */,
@@ -436,7 +426,6 @@
 			buildActionMask = 2147483647;
 			files = (
 				F3823346273195F300F7F527 /* music_flac.h in Headers */,
-				F37A8D4D2838A23400C38E95 /* dr_mp3.h in Headers */,
 				F382333E273195DF00F7F527 /* mixer.h in Headers */,
 				F382335A2731962600F7F527 /* load_aiff.h in Headers */,
 				F3823348273195F800F7F527 /* music_fluidsynth.h in Headers */,
@@ -445,7 +434,6 @@
 				F382334E2731960700F7F527 /* music_modplug.h in Headers */,
 				F3823340273195E400F7F527 /* music.h in Headers */,
 				F38233522731961400F7F527 /* music_nativemidi.h in Headers */,
-				F37A8D4F2838A23400C38E95 /* dr_flac.h in Headers */,
 				F382334C2731960200F7F527 /* music_mikmod.h in Headers */,
 				F382334A273195FD00F7F527 /* music_mad.h in Headers */,
 				F3823338273195CF00F7F527 /* utils.h in Headers */,
diff --git a/src/codecs/dr_libs/LICENSE b/src/codecs/dr_libs/LICENSE
new file mode 100644
index 00000000..16dfbdfd
--- /dev/null
+++ b/src/codecs/dr_libs/LICENSE
@@ -0,0 +1,47 @@
+This software is available as a choice of the following licenses. Choose
+whichever you prefer.
+
+===============================================================================
+ALTERNATIVE 1 - Public Domain (www.unlicense.org)
+===============================================================================
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
+commercial or non-commercial, and by any means.
+
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/>
+
+===============================================================================
+ALTERNATIVE 2 - MIT No Attribution
+===============================================================================
+Copyright 2020 David Reid
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/src/codecs/dr_libs/README.md b/src/codecs/dr_libs/README.md
new file mode 100644
index 00000000..6e8ca408
--- /dev/null
+++ b/src/codecs/dr_libs/README.md
@@ -0,0 +1,21 @@
+<h4 align="center">Public domain, single file audio decoding libraries for C and C++.</h4>
+
+<p align="center">
+    <a href="https://discord.gg/9vpqbjU"><img src="https://img.shields.io/discord/712952679415939085?label=discord&logo=discord" alt="discord"></a>
+    <a href="https://twitter.com/mackron"><img src="https://img.shields.io/twitter/follow/mackron?style=flat&label=twitter&color=1da1f2&logo=twitter" alt="twitter"></a>
+</p>
+
+
+Library                                         | Description
+----------------------------------------------- | -----------
+[dr_flac](dr_flac.h)                            | FLAC audio decoder.
+[dr_mp3](dr_mp3.h)                              | MP3 audio decoder. Based off [minimp3](https://github.com/lieff/minimp3).
+[dr_wav](dr_wav.h)                              | WAV audio loader and writer.
+
+
+# Other Libraries
+Below are some of my other libraries you may be interested in.
+
+Library                                           | Description
+------------------------------------------------- | -----------
+[miniaudio](https://github.com/mackron/miniaudio) | A public domain, single file library for audio playback and recording.
diff --git a/src/codecs/dr_flac.h b/src/codecs/dr_libs/dr_flac.h
similarity index 100%
rename from src/codecs/dr_flac.h
rename to src/codecs/dr_libs/dr_flac.h
diff --git a/src/codecs/dr_mp3.h b/src/codecs/dr_libs/dr_mp3.h
similarity index 100%
rename from src/codecs/dr_mp3.h
rename to src/codecs/dr_libs/dr_mp3.h
diff --git a/src/codecs/music_drflac.c b/src/codecs/music_drflac.c
index ad36e3b9..0254573c 100644
--- a/src/codecs/music_drflac.c
+++ b/src/codecs/music_drflac.c
@@ -36,7 +36,7 @@
 #define DRFLAC_MALLOC(sz) SDL_malloc((sz))
 #define DRFLAC_REALLOC(p, sz) SDL_realloc((p), (sz))
 #define DRFLAC_FREE(p) SDL_free((p))
-#include "dr_flac.h"
+#include "dr_libs/dr_flac.h"
 
 
 typedef struct {
diff --git a/src/codecs/music_drmp3.c b/src/codecs/music_drmp3.c
index 7bdd323f..58c55037 100644
--- a/src/codecs/music_drmp3.c
+++ b/src/codecs/music_drmp3.c
@@ -34,7 +34,7 @@
 #define DRMP3_MALLOC(sz) SDL_malloc((sz))
 #define DRMP3_REALLOC(p, sz) SDL_realloc((p), (sz))
 #define DRMP3_FREE(p) SDL_free((p))
-#include "dr_mp3.h"
+#include "dr_libs/dr_mp3.h"
 
 
 typedef struct {