Browse Source

Bootstrap Audio library.

Will require OpenAL for now, although I don't like the state in which AL
currently is. At all. Other alternatives (later) might be FMOD or Miles.
pull/277/head
Vladimír Vondruš 13 years ago
parent
commit
2b32625921
  1. 1
      CMakeLists.txt
  2. 1
      doc/building.dox
  3. 1
      doc/cmake.dox
  4. 12
      doc/namespaces.dox
  5. 14
      modules/FindMagnum.cmake
  6. 35
      src/Audio/Audio.h
  7. 34
      src/Audio/CMakeLists.txt
  8. 4
      src/CMakeLists.txt

1
CMakeLists.txt

@ -37,6 +37,7 @@ cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2" ON "TARGET_GLES" OFF
cmake_dependent_option(TARGET_DESKTOP_GLES "Build for OpenGL ES on desktop" OFF "TARGET_GLES" OFF)
# Parts of the library
option(WITH_AUDIO "Build Audio library" ON)
option(WITH_DEBUGTOOLS "Build DebugTools library" ON)
cmake_dependent_option(WITH_MESHTOOLS "Build MeshTools library" ON "NOT WITH_DEBUGTOOLS" ON)
cmake_dependent_option(WITH_PRIMITIVES "Builf Primitives library" ON "NOT WITH_DEBUGTOOLS" ON)

1
doc/building.dox

@ -96,6 +96,7 @@ By default the engine is built with everything except application libraries (see
below). Using `WITH_*` CMake parameters you can specify which parts will be built
and which not:
- `WITH_AUDIO` - Audio library. Requires **OpenAL** library.
- `WITH_DEBUGTOOLS` - DebugTools library. Enables also building of MeshTools,
Primitives, SceneGraph, Shaders and Shapes libraries.
- `WITH_MESHTOOLS` - MeshTools library. Enabled automatically if `WITH_DEBUGTOOLS`

1
doc/cmake.dox

@ -51,6 +51,7 @@ components. The base library depends on %Corrade, OpenGL and GLEW libraries (or
OpenGL ES libraries). Additional dependencies are specified by the components.
The optional components are:
- `%Audio` -- Audio library (depends on OpenAL library)
- `%DebugTools` -- DebugTools library (depends on `%MeshTools`,
`%Primitives`, `%SceneGraph`, `%Shaders` and `%Shapes` components)
- `%MeshTools` -- MeshTools library

12
doc/namespaces.dox

@ -88,6 +88,18 @@ This library is built by default and found by default in CMake. See
@ref building and @ref cmake for more information.
*/
/** @dir Audio
* @brief Namespace Magnum::Audio
*/
/** @namespace Magnum::Audio
@brief %Audio playback
Audio import, playback and integration with @ref SceneGraph.
This library is built when `WITH_AUDIO` is enabled and found as `%Audio`
component in CMake. See @ref building and @ref cmake for more information.
*/
/** @dir DebugTools
* @brief Namespace Magnum::DebugTools
*/

14
modules/FindMagnum.cmake

@ -19,6 +19,7 @@
# components. The base library depends on Corrade, OpenGL and GLEW
# libraries. Additional dependencies are specified by the components. The
# optional components are:
# Audio - Audio library (depends on OpenAL library)
# DebugTools - DebugTools library (depends on MeshTools, Primitives,
# SceneGraph, Shaders and Shapes components)
# MeshTools - MeshTools library
@ -219,6 +220,19 @@ foreach(component ${Magnum_FIND_COMPONENTS})
endif()
endif()
# Audio library
if(${component} STREQUAL Audio)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Audio.h)
find_package(OpenAL)
if(OPENAL_FOUND)
set(_MAGNUM_${_COMPONENT}_LIBRARIES ${OPENAL_LIBRARY})
set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR})
else()
unset(MAGNUM_${_COMPONENT}_LIBRARY)
endif()
endif()
# DebugTools library
if(${component} STREQUAL DebugTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES DebugTools.h)

35
src/Audio/Audio.h

@ -0,0 +1,35 @@
#ifndef Magnum_Audio_Audio_h
#define Magnum_Audio_Audio_h
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš <mosra@centrum.cz>
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, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
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.
*/
/** @file
* @brief Forward declarations for Magnum::Audio namespace
*/
namespace Magnum { namespace Audio {
}}
#endif

34
src/Audio/CMakeLists.txt

@ -0,0 +1,34 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš <mosra@centrum.cz>
#
# 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, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# 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.
#
find_package(OpenAL REQUIRED)
include_directories(${OPENAL_INCLUDE_DIR})
set(MagnumAudio_SOURCES
)
set(MagnumAudio_HEADERS
Audio.h)
install(FILES ${MagnumAudio_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Audio)

4
src/CMakeLists.txt

@ -191,6 +191,10 @@ add_subdirectory(Math)
add_subdirectory(Platform)
add_subdirectory(Trade)
if(WITH_AUDIO)
add_subdirectory(Audio)
endif()
if(WITH_DEBUGTOOLS)
add_subdirectory(DebugTools)
endif()

Loading…
Cancel
Save