Skip to content

Commit

Permalink
SDL_Audio support. (#340)
Browse files Browse the repository at this point in the history
* SDL_Audio support.

Replace RtAudio with SDL2-Audio system.  Requires at least SDL 2.24.

* SDL Audio: Introduce <autoselect> device

Add an "autoselect" device which uses whatever SDL Audio deems
best.

* SDL Audio: simply deviceId setup

Previous patch introduced the autoselect device, which is always available.
Use it if the GUI/Settings selected DeviceId is out of range.

* SDL_Audio: remove always-false check

* remove outdated comment in sdlInit()

---------

Co-authored-by: luciusDXL <ldarkxl@gmail.com>
  • Loading branch information
mlauss2 and luciusDXL authored Sep 27, 2023
1 parent 9680f11 commit 65a58f2
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 12,093 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ set_target_properties(tfe PROPERTIES OUTPUT_NAME "theforceengine")
if(LINUX)
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
pkg_check_modules(RTAUDIO REQUIRED rtaudio>=5.2.0)
pkg_check_modules(RTMIDI REQUIRED rtmidi>=5.0.0)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(GLEW REQUIRED glew)
Expand All @@ -60,7 +59,6 @@ if(LINUX)
${SDL2_LIBRARIES}
${IL_LIBRARIES}
${ILU_LIBRARIES}
${RTAUDIO_LIBRARIES}
${RTMIDI_LIBRARIES}
)

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ This can be overridden by defining the "__TFE_DATA_HOME__" environment variable.
### Required Libraries
* [SDL2](TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp) 2.24 or higher
* [devIL](https://openil.sourceforge.net)
* [RtAudio](https://www.music.mcgill.ca/~gary/rtaudio/) 5.2.0 or higher
* [RtMidi](https://www.music.mcgill.ca/~gary/rtmidi/) 5.0.0 or higher
* [GLEW](http://glew.sourceforge.net/) 2.2.0
* OpenGL 3.3 capable driver (latest [mesa](https://www.mesa3d.org) or nvidia proprietary driver recommended)
Expand Down
8 changes: 2 additions & 6 deletions TheForceEngine/Documentation/markdown/Credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Most of the source code listed below is embedded within the project so that it c

Note that some libraries will be replaced by custom code or simpler libraries in the future (such as DevIL).

**Windowing/OpenGL**
**Windowing/OpenGL/Audio**
SDL 2.0.x
* [https://www.libsdl.org/](https://www.libsdl.org/)
* License: ZLIB
Expand Down Expand Up @@ -94,11 +94,7 @@ DevIL
* [http://openil.sourceforge.net/](http://openil.sourceforge.net/)
* License: LGPL 2.1

**Audio**
RtAudio (Core Audio I/O)
* [http://www.music.mcgill.ca/~gary/rtaudio/](http://www.music.mcgill.ca/~gary/rtaudio/)
* License: Custom

**Music**
RtMidi (Core Midi Hardware I/O)
* [https://www.music.mcgill.ca/~gary/rtmidi/](https://www.music.mcgill.ca/~gary/rtmidi/)
* License: Custom
Expand Down
1 change: 0 additions & 1 deletion TheForceEngine/TFE_Audio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
file(GLOB_RECURSE SOURCES "*.cpp" "*.c")
if(LINUX)
# we use the system libraries on Linux
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/RtAudio.cpp")
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/RtMidi.cpp")
endif()
target_sources(tfe PRIVATE ${SOURCES})
Loading

0 comments on commit 65a58f2

Please sign in to comment.