Skip to content

Commit

Permalink
Merge branch 'Zorbn-main'
Browse files Browse the repository at this point in the history
Fixes #62 and #61
  • Loading branch information
morew4rd committed Apr 30, 2024
2 parents e7020d1 + 4b244ad commit 033a3f6
Show file tree
Hide file tree
Showing 15 changed files with 20,839 additions and 16,165 deletions.
1 change: 1 addition & 0 deletions deps/raudio/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*.i*86
*.x86_64
*.hex
build

# Debug files
*.dSYM/
Expand Down
2 changes: 1 addition & 1 deletion deps/raudio/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
zlib License

Copyright (c) 2014-2022 Ramon Santamaria (@raysan5)
Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion deps/raudio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## features

- Simplifies `miniaudio` usage exposing only basic functionality
- Audio formats supported: `.wav`, `.ogg`, `.mp3`, `.flac`, `.xm` and `.mod`.
- Audio formats supported: `.wav`, `.qoa`, `.ogg`, `.mp3`, `.flac`, `.xm`, `.mod`
- Select desired input formats at compilation time
- Load and play audio, static or streamed modes
- Support for plugable audio effects with callbacks
Expand Down
91 changes: 91 additions & 0 deletions deps/raudio/projects/CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.11)
project(raudio
DESCRIPTION "raudio: A simple and easy-to-use audio library based on miniaudio"
HOMEPAGE_URL "https://github.com/raylib5/raudio"
LANGUAGES C
)

# Config options
option(BUILD_RAUDIO_EXAMPLES "Build the examples." OFF)

# Force building examples if building in the root as standalone.
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(BUILD_RAUDIO_EXAMPLES TRUE)
endif()

# Directory Variables
set(RAUDIO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
set(RAUDIO_SRC ${RAUDIO_ROOT}/src)
set(RAUDIO_EXAMPLES ${RAUDIO_ROOT}/examples)

option(SUPPORT_FILEFORMAT_WAV "WAV Support" TRUE)
option(SUPPORT_FILEFORMAT_OGG "OGG Support" TRUE)
option(SUPPORT_FILEFORMAT_MP3 "MP3 Support" TRUE)
option(SUPPORT_FILEFORMAT_QOA "QOA Support" TRUE)
option(SUPPORT_FILEFORMAT_FLAC "FLAC Support" TRUE)
option(SUPPORT_FILEFORMAT_XM "XM Support" TRUE)
option(SUPPORT_FILEFORMAT_MOD "MOD Support" TRUE)

# raudio
add_library(raudio STATIC
${RAUDIO_SRC}/raudio.c
)

# Includes
target_include_directories(raudio INTERFACE ${RAUDIO_SRC})

# Defines
target_compile_definitions(raudio PUBLIC
RAUDIO_STANDALONE
SUPPORT_MODULE_RAUDIO
)

# Dependenices
target_link_libraries(raudio
m # math
)

# Audio file support options
if (SUPPORT_FILEFORMAT_WAV)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_WAV)
endif()
if (SUPPORT_FILEFORMAT_OGG)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_OGG)
endif()
if (SUPPORT_FILEFORMAT_MP3)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_MP3)
endif()
if (SUPPORT_FILEFORMAT_QOA)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_QOA)
endif()
if (SUPPORT_FILEFORMAT_FLAC)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_FLAC)
endif()
if (SUPPORT_FILEFORMAT_XM)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_XM)
endif()
if (SUPPORT_FILEFORMAT_MOD)
target_compile_definitions(raudio PUBLIC SUPPORT_FILEFORMAT_MOD)
endif()

# Examples
if (BUILD_RAUDIO_EXAMPLES)
# Create a list of all examples
set(examples)
file(GLOB sources ${RAUDIO_EXAMPLES}/*.c)
list(APPEND examples ${sources})

# Build each example
foreach(example_source ${examples})
# Create the basename for the example
get_filename_component(example_name ${example_source} NAME)
string(REPLACE ".c" "${OUTPUT_EXT}" example_name ${example_name})

# Setup the example
add_executable(${example_name} ${example_source})
target_link_libraries(${example_name} PUBLIC raudio)
endforeach()

# Resources
file(COPY ${RAUDIO_EXAMPLES}/resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()

0 comments on commit 033a3f6

Please sign in to comment.