* Extend CMake build system to reflect all cAudio options (get rid of the cAudioDefines) - now CMake auto generates a cAudioBuildSettings.h based on the user options (this is made per CMake build)

* Modify license headers to reflect new copyrights
This commit is contained in:
Murat Suri 2011-06-02 19:59:20 +00:00
parent 4727870351
commit 3e062d42ca
85 changed files with 932 additions and 932 deletions

View File

@ -0,0 +1,41 @@
#pragma once
// CMake auto-generated configuration options
#define AUDIO_STATIC_LIB @CAUDIO_SET_STATIC@
//! This define controls whether the Ogg/Vorbis decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_OGG_DECODER @CAUDIO_SET_ENABLE_OGG@
//! This define controls whether the RIFF/Wav decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_WAV_DECODER @CAUDIO_SET_ENABLE_WAV@
//! This define controls whether the default filesystem data source is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_SOURCE @CAUDIO_SET_ENABLE_DEFAULT_FILESYSTEM@
//! This define controls whether the default file logger (html) is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER @CAUDIO_SET_ENABLE_DEFAULT_FILE_LOGGER@
//! This define controls whether the default console logger is compiled into the library
#define CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER @CAUDIO_SET_ENABLE_DEFAULT_CONSOLE_LOGGER@
//! Define for making the entire library Thread Safe, comment out to disable. Will also disable internal threading by the library.
#define CAUDIO_MAKE_THREAD_SAFE @CAUDIO_SET_ENABLE_THREAD_SAFETY@
//! EFX support
#define CAUDIO_EFX_ENABLED @CAUDIO_SET_ENABLE_EFX@
//! Tells cAudio to use the C standard memory functions for allocations (memalloc and free)
#define CAUDIO_MEMORY_USE_STD @CAUDIO_SET_ENABLE_STD_MEMORY_ALLOCATOR@
//! Tells cAudio to reroute memory allocations from stl containers into the defined memory provider for cAudio, otherwise the standard std::allocator is used.
#define CAUDIO_REROUTE_STL_ALLOCATIONS @CAUDIO_SET_ENABLE_REROUTE_STL_ALLOCATIONS@
//! Activates the internal memory tracker, which can be used to detect and locate memory leaks.
#define CAUDIO_USE_MEMORYTRACKER @CAUDIO_SET_ENABLE_MEMORYTRACKER@
//! Tells the memory tracker to generate statistics on memory usage by cAudio
#define CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS @CAUDIO_SET_ENABLE_MEMORY_STATISTICS@
//! Tells the memory tracker to log each and every allocation done by cAudio. This can be very slow, use only if you are debugging an issue.
#define CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS @CAUDIO_SET_ENABLE_MEMORY_LOG_ALL_ALLOCATIONS@

View File

@ -49,13 +49,104 @@ set(CAUDIO_LIB_DIRECTORY "/lib")
# Customise what to build
option(CAUDIO_STATIC "Static build" FALSE)
option(CAUDIO_BUILD_SAMPLES "Build Samples" TRUE)
#Custom settings
option(CAUDIO_BUILD_EAX_PLUGIN "Build EAXLegacyPreset Plugin" FALSE)
option(CAUDIO_BUILD_MP3DECODER_PLUGIN "Build mp3Decoder Plugin" FALSE)
option(CAUDIO_ENABLE_OGG "Enable OGG decoder" TRUE)
option(CAUDIO_ENABLE_WAV "Enable RIFF/Wav decoder" TRUE)
option(CAUDIO_ENABLE_DEFAULT_FILESYSTEM "Enable default filesystem data source" TRUE)
option(CAUDIO_ENABLE_DEFAULT_FILE_LOGGER "Enable default file logger (html)" TRUE)
option(CAUDIO_ENABLE_DEFAULT_CONSOLE_LOGGER "Enable default console logger" TRUE)
option(CAUDIO_ENABLE_THREAD_SAFETY "Enable thread safety" TRUE)
option(CAUDIO_ENABLE_STD_MEMORY_ALLOCATOR "Enable Std Memory allocations (memalloc and free)" TRUE)
option(CAUDIO_ENABLE_REROUTE_STL_ALLOCATIONS "Reroute STL memory allocations" TRUE)
option(CAUDIO_ENABLE_MEMORYTRACKER "Enable memory leak tracker" FALSE)
option(CAUDIO_ENABLE_MEMORY_LOG_ALL_ALLOCATIONS "Enable log all memory allocations" FALSE)
option(CAUDIO_ENABLE_MEMORY_STATISTICS "Enable memory statistics generator" FALSE)
if(APPLE)
option(CAUDIO_IOS_BUILD "Build for ios" FALSE)
endif()
mark_as_advanced( CAUDIO_BUILD_EAX_PLUGIN
CAUDIO_BUILD_MP3DECODER_PLUGIN
CAUDIO_ENABLE_OGG
CAUDIO_ENABLE_WAV
CAUDIO_ENABLE_DEFAULT_FILESYSTEM
CAUDIO_ENABLE_DEFAULT_FILE_LOGGER
CAUDIO_ENABLE_DEFAULT_CONSOLE_LOGGER
CAUDIO_ENABLE_THREAD_SAFETY
CAUDIO_ENABLE_STD_MEMORY_ALLOCATOR
CAUDIO_ENABLE_REROUTE_STL_ALLOCATIONS
CAUDIO_ENABLE_MEMORYTRACKER
CAUDIO_ENABLE_MEMORY_LOG_ALL_ALLOCATIONS
CAUDIO_ENABLE_MEMORY_STATISTICS )
set(CAUDIO_SET_STATIC 0)
set(CAUDIO_SET_ENABLE_EFX 0)
set(CAUDIO_SET_ENABLE_OGG 1)
set(CAUDIO_SET_ENABLE_WAV 1)
set(CAUDIO_SET_ENABLE_DEFAULT_FILESYSTEM 1)
set(CAUDIO_SET_ENABLE_DEFAULT_FILE_LOGGER 1)
set(CAUDIO_SET_ENABLE_DEFAULT_CONSOLE_LOGGER 1)
set(CAUDIO_SET_ENABLE_THREAD_SAFETY 1)
set(CAUDIO_SET_ENABLE_STD_MEMORY_ALLOCATOR 1)
set(CAUDIO_SET_ENABLE_REROUTE_STL_ALLOCATIONS 1)
set(CAUDIO_SET_ENABLE_MEMORYTRACKER 0)
set(CAUDIO_SET_ENABLE_MEMORY_LOG_ALL_ALLOCATIONS 0)
set(CAUDIO_SET_ENABLE_MEMORY_STATISTICS 0)
if(CAUDIO_STATIC)
set(CAUDIO_SET_STATIC 1)
endif()
if(CAUDIO_BUILD_EAX_PLUGIN)
set(CAUDIO_SET_ENABLE_EFX 1)
endif()
if(CAUDIO_ENABLE_OGG)
set(CAUDIO_SET_ENABLE_OGG 1)
endif()
if(CAUDIO_ENABLE_WAV)
set(CAUDIO_SET_ENABLE_WAV 1)
endif()
if(CAUDIO_ENABLE_DEFAULT_FILESYSTEM)
set(CAUDIO_SET_ENABLE_DEFAULT_FILESYSTEM 1)
endif()
if(CAUDIO_ENABLE_DEFAULT_FILE_LOGGER)
set(CAUDIO_SET_ENABLE_DEFAULT_FILE_LOGGER 1)
endif()
if(CAUDIO_ENABLE_DEFAULT_CONSOLE_LOGGER)
set(CAUDIO_SET_ENABLE_DEFAULT_CONSOLE_LOGGER 1)
endif()
if(CAUDIO_ENABLE_THREAD_SAFETY)
set(CAUDIO_SET_ENABLE_THREAD_SAFETY 1)
endif()
if(CAUDIO_ENABLE_STD_MEMORY_ALLOCATOR)
set(CAUDIO_SET_ENABLE_STD_MEMORY_ALLOCATOR 1)
endif()
if(CAUDIO_ENABLE_REROUTE_STL_ALLOCATIONS)
set(CAUDIO_SET_ENABLE_REROUTE_STL_ALLOCATIONS 1)
endif()
if(CAUDIO_ENABLE_MEMORYTRACKER)
set(CAUDIO_SET_ENABLE_MEMORYTRACKER 1)
endif()
if(CAUDIO_ENABLE_MEMORY_LOG_ALL_ALLOCATIONS)
set(CAUDIO_SET_ENABLE_MEMORY_LOG_ALL_ALLOCATIONS 1)
endif()
if(CAUDIO_ENABLE_MEMORY_STATISTICS)
set(CAUDIO_SET_ENABLE_MEMORY_STATISTICS 1)
endif()
if(CAUDIO_STATIC)
set(CAUDIO_LIB_TYPE STATIC)
else()
@ -94,10 +185,6 @@ include(InstallDependencies)
add_subdirectory(DependenciesSource/libogg-1.2.2)
add_subdirectory(DependenciesSource/libvorbis-1.3.2)
if(CAUDIO_BUILD_EAX_PLUGIN)
ADD_DEFINITIONS(-DCAUDIO_EFX_ENABLED)
endif()
add_subdirectory(cAudio)
if(CAUDIO_BUILD_EAX_PLUGIN)

View File

@ -4,10 +4,14 @@ if(CAUDIO_STATIC)
ADD_DEFINITIONS(-DCAUDIO_STATIC_LIB)
endif()
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
set(CAUDIO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
# generate cAudioBuildSettings.h
configure_file(${CMAKE_SOURCE_DIR}/CMake/Templates/cAudioBuildSettings.h.in ${CMAKE_BINARY_DIR}/include/cAudioBuildSettings.h @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/include/cAudioBuildSettings.h DESTINATION include/cAudio/include)
include_directories (include ${OPENAL_INCLUDE_DIRS} ${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
set(CAUDIO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include PARENT_SCOPE)
include_directories (include ${CMAKE_BINARY_DIR}/include ${OPENAL_INCLUDE_DIRS} ${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
include(cAudio_src_files.cmake)
add_library(cAudio ${CAUDIO_LIB_TYPE} ${file_root})

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,10 +1,12 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#ifdef CAUDIO_EFX_ENABLED
#include "cAudioDefines.h"
#if CAUDIO_EFX_ENABLED == 1
#include "../include/IAudioEffects.h"
#include "../include/cSTLAllocator.h"

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
@ -78,7 +78,7 @@ namespace cAudio
return (AudioThread != NULL && AudioThread->isRunning());
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
virtual IAudioEffects* getEffects() { return &initEffects; }
#endif
protected:
@ -117,7 +117,7 @@ namespace cAudio
//! The listener object
cListener initlistener;
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
//! Interface for audio effects
cAudioEffects initEffects;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -33,7 +33,7 @@ namespace cAudio
ON_STOP,
};
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
cAudioSource(IAudioDecoder* decoder, ALCcontext* context, cEFXFunctions* oALFunctions);
#else
cAudioSource(IAudioDecoder* decoder, ALCcontext* context);
@ -114,7 +114,7 @@ namespace cAudio
virtual void unRegisterEventHandler(ISourceEventHandler* handler);
virtual void unRegisterAllEventHandlers();
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
virtual unsigned int getNumEffectSlotsAvailable() const;
virtual bool attachEffect(unsigned int slot, IEffect* effect);
virtual void removeEffect(unsigned int slot);
@ -158,7 +158,7 @@ namespace cAudio
//! List of registered event handlers
cAudioList<ISourceEventHandler*>::Type eventHandlerList;
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
//! Holds pointers to all the EFX related functions
cEFXFunctions* EFX;
//! Updates the attached filter

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -7,7 +7,7 @@
#include "../include/ILogReceiver.h"
#include "../include/cAudioDefines.h"
#ifdef CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -6,7 +6,7 @@
#include "../include/cAudioDefines.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
#include <al.h>
#include <alc.h>

View File

@ -1,10 +1,12 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#ifdef CAUDIO_EFX_ENABLED
#include "cAudioDefines.h"
#if CAUDIO_EFX_ENABLED == 1
#include "../include/IEffect.h"
#include "../Headers/cMutex.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -7,7 +7,7 @@
#include "../include/ILogReceiver.h"
#include "../include/cAudioDefines.h"
#ifdef CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -8,7 +8,7 @@
#include "../include/cAudioDefines.h"
#include "../Headers/cMemoryOverride.h"
#ifdef CAUDIO_COMPILE_WITH_FILE_SOURCE
#if CAUDIO_COMPILE_WITH_FILE_SOURCE == 1
#include <fstream>

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -6,7 +6,7 @@
#include "../include/IDataSourceFactory.h"
#ifdef CAUDIO_COMPILE_WITH_FILE_SOURCE
#if CAUDIO_COMPILE_WITH_FILE_SOURCE == 1
#include "../Headers/cFileSource.h"
#include "../Headers/cMemorySource.h"

View File

@ -1,10 +1,12 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#ifdef CAUDIO_EFX_ENABLED
#include "cAudioDefines.h"
#if CAUDIO_EFX_ENABLED == 1
#include "../include/IFilter.h"
#include "../Headers/cMutex.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -30,7 +30,7 @@ namespace cAudio
virtual cVector3 getVelocity(void) const { return Velocity; }
virtual float getMasterVolume(void) const { return MasterGain; }
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
virtual void setMetersPerUnit(const float& meters);
virtual float getMetersPerUnit(void) const;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include <new>

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,8 +1,12 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "../include/cAudioDefines.h"
#ifdef CAUDIO_USE_MEMORYTRACKER
#if CAUDIO_USE_MEMORYTRACKER == 1
#include <map>
#include "../Headers/cMutex.h"
@ -43,7 +47,7 @@ namespace cAudio
std::map<void*, cTrackedMemoryBlock> TrackedBlocks;
#ifdef CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
#if CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS == 1
struct Statistics
{
Statistics() : AllocationHighWaterMark(0), CurrentAllocationBytes(0),
@ -62,7 +66,7 @@ namespace cAudio
void DumpLeaks();
#ifdef CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#if CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS == 1
std::ofstream outMemLog;
#endif
};

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -6,7 +6,7 @@
#include "../include/cAudioDefines.h"
#ifdef CAUDIO_MAKE_THREAD_SAFE
#if CAUDIO_MAKE_THREAD_SAFE == 1
#ifdef CAUDIO_PLATFORM_WIN
#include <windows.h> //Basic windows include
#else
@ -16,7 +16,7 @@
namespace cAudio
{
#ifdef CAUDIO_MAKE_THREAD_SAFE
#if CAUDIO_MAKE_THREAD_SAFE == 1
//! Basic mutex class used for internal thread locking
class cAudioMutex
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -8,7 +8,7 @@
#include "cOggDecoder.h"
#include "../Headers/cMutex.h"
#ifdef CAUDIO_COMPILE_WITH_OGG_DECODER
#if CAUDIO_COMPILE_WITH_OGG_DECODER == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -6,7 +6,7 @@
#include "../include/cAudioDefines.h"
#ifdef CAUDIO_COMPILE_WITH_OGG_DECODER
#if CAUDIO_COMPILE_WITH_OGG_DECODER == 1
#include "../include/IAudioDecoder.h"
#include <ogg/ogg.h>

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "../include/IPluginManager.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "../include/IMemoryProvider.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,9 +1,9 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#ifndef CUTILS_H_INCLUDED
#define CUTILS_H_INCLUDED
#pragma once
#include "../include/cAudioPlatform.h"
#include "../include/cSTLAllocator.h"
#include "../include/cAudioString.h"
@ -82,5 +82,3 @@ static cAudioVector<cAudioString>::Type getFilesInDirectory(cAudioString path)
}
};
#endif //! CUTILS_H_INCLUDED

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -8,7 +8,7 @@
#include "cWavDecoder.h"
#include "../Headers/cMutex.h"
#ifdef CAUDIO_COMPILE_WITH_WAV_DECODER
#if CAUDIO_COMPILE_WITH_WAV_DECODER == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -8,7 +8,7 @@
#include "../include/cAudioDefines.h"
#include "../Headers/cMemoryOverride.h"
#ifdef CAUDIO_COMPILE_WITH_WAV_DECODER
#if CAUDIO_COMPILE_WITH_WAV_DECODER == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -8,7 +8,7 @@
#include "IFilter.h"
#include "cAudioDefines.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -175,7 +175,7 @@ namespace cAudio
//! Returns the interface for the listener.
virtual IListener* getListener() = 0;
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
//! Returns the interface for audio effects.
virtual IAudioEffects* getEffects() = 0;
#endif

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "IRefCounted.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -246,7 +246,7 @@ namespace cAudio
//! Removes all event handlers attached to this source
virtual void unRegisterAllEventHandlers() = 0;
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
//! Returns the number of effects at one time this source can support.
virtual unsigned int getNumEffectSlotsAvailable() const = 0;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -9,7 +9,7 @@
#include "IEffectParameters.h"
#include "cAudioDefines.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -7,7 +7,7 @@
#include "cVector3.h"
#include "cAudioDefines.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -7,7 +7,7 @@
#include "IRefCounted.h"
#include "cAudioDefines.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
namespace cAudio
{

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -63,7 +63,7 @@ namespace cAudio
//! Returns the global volume modifier for all sources
virtual float getMasterVolume(void) const = 0;
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
//! Sets the meters per user world unit for use with sound effects
/**
\param meters: Number of meters per world unit in your simulation. */

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "cAudioDefines.h"

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "IAudioPlugin.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,6 +1,6 @@
/* cAudio.h -- interface of the 'cAudio Engine'
Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View File

@ -1,7 +1,15 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "cAudioPlatform.h"
// CMake-generated build settings.
// %BUILD_DIR%/include to your include search path to find cAudioBuildSettings.h.
#include "cAudioBuildSettings.h"
//! Global define for the version of cAudio.
//! This is used primarily by plugins to make sure they are linking to the right library.
#define CAUDIO_VERSION "2.2.0"
@ -12,105 +20,30 @@
#endif
#endif
//////////////////////
// Windows Settings //
//////////////////////
#ifdef CAUDIO_PLATFORM_WIN
# if CAUDIO_STATIC_LIB == 0
# define CAUDIO_API __declspec(dllexport)
# else
# define CAUDIO_API extern "C"
# endif // CAUDIO_STATIC_LIB
#endif
#ifndef CAUDIO_STATIC_LIB
#define CAUDIO_API __declspec(dllexport)
#else
#define CAUDIO_API extern "C"
#endif // CAUDIO_STATIC_LIB
//!Define for making the entire library Thread Safe, comment out to disable. Will also disable internal threading by the library.
#define CAUDIO_MAKE_THREAD_SAFE
#ifdef CAUDIO_MAKE_THREAD_SAFE
//! Define enables threading for the main update loop. Disable to run the internal update loop yourself. NOTE: Internal threading should NOT be used if the library is not thread safe!
//! Define enables threading for the main update loop. Disable to run the internal update loop yourself. NOTE: Internal threading should NOT be used if the library is not thread safe!
#if CAUDIO_MAKE_THREAD_SAFE == 1
#define CAUDIO_USE_INTERNAL_THREAD
#endif //CAUDIO_MAKE_THREAD_SAFE
#endif
//! This define controls whether the Ogg/Vorbis decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_OGG_DECODER
//! This define controls whether the RIFF/Wav decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_WAV_DECODER
//! This define controls whether the default filesystem data source is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_SOURCE
//! This define controls whether the default file logger (html) is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
//! This define controls whether the default console logger is compiled into the library
#define CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
#if !defined( CAUDIO_PLATFORM_IPHONE ) && CAUDIO_STATIC_LIB == 0
//! This define controls whether plugin support is added into the library, commenting it out will prevent any plugins from working
#define CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
# define CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
#ifdef CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
//! Define enabled support for plugins as dynamic libs
#define CAUDIO_COMPILE_WITH_DYNAMIC_PLUGIN_SUPPORT
#endif //CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
//! Size of the internal buffer per source for audio data (total amount buffered is CAUDIO_SOURCE_BUFFER_SIZE * CAUDIO_SOURCE_NUM_BUFFERS)
#define CAUDIO_SOURCE_BUFFER_SIZE ( 1024 * 64 )
//! Number of internal buffers to cycle through per source (Note: using only 1 leads to choppy sound or premature ending of sources)
#define CAUDIO_SOURCE_NUM_BUFFERS 3
//! Comment out to remove all EFX support from the library
//#define CAUDIO_EFX_ENABLED
//! Max number of effects that can be attached to a single sound source
#define CAUDIO_SOURCE_MAX_EFFECT_SLOTS 4
//! Tells cAudio to use the C standard memory functions for allocations (memalloc and free)
#define CAUDIO_MEMORY_USE_STD
//! Tells cAudio to reroute memory allocations from stl containers into the defined memory provider for cAudio, otherwise the standard std::allocator is used.
#define CAUDIO_REROUTE_STL_ALLOCATIONS
//! Activates the internal memory tracker, which can be used to detect and locate memory leaks.
//#define CAUDIO_USE_MEMORYTRACKER
//! Tells the memory tracker to generate statistics on memory usage by cAudio
//#define CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
//! Tells the memory tracker to log each and every allocation done by cAudio. This can be very slow, use only if you are debugging an issue.
//#define CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#endif //CAUDIO_PLATFORM_WIN
///////////////////////
// Mac OS X Settings //
///////////////////////
#ifdef CAUDIO_PLATFORM_MAC
#define CAUDIO_API extern "C"
//!Define for making the entire library Thread Safe, comment out to disable. Will also disable internal threading by the library.
#define CAUDIO_MAKE_THREAD_SAFE
#ifdef CAUDIO_MAKE_THREAD_SAFE
//! Define enables threading for the main update loop. Disable to run the internal update loop yourself. NOTE: Internal threading should NOT be used if the library is not thread safe!
#define CAUDIO_USE_INTERNAL_THREAD
#endif //CAUDIO_MAKE_THREAD_SAFE
//! This define controls whether the Ogg/Vorbis decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_OGG_DECODER
//! This define controls whether the RIFF/Wav decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_WAV_DECODER
//! This define controls whether the default filesystem data source is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_SOURCE
//! This define controls whether the default file logger (html) is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
//! This define controls whether the default console logger is compiled into the library
#define CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
//! This define controls whether plugin support is added into the library, commenting it out will prevent any plugins from working
#define CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
#ifdef CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
//! Define enabled support for plugins as dynamic libs
#define CAUDIO_COMPILE_WITH_DYNAMIC_PLUGIN_SUPPORT
#endif //CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
//! Define enabled support for plugins as dynamic libs
# ifdef CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
# define CAUDIO_COMPILE_WITH_DYNAMIC_PLUGIN_SUPPORT
# endif
#endif
//! Size of the internal buffer per source for audio data (total amount buffered is CAUDIO_SOURCE_BUFFER_SIZE * CAUDIO_SOURCE_NUM_BUFFERS)
#define CAUDIO_SOURCE_BUFFER_SIZE ( 1024 * 64 )
@ -119,130 +52,3 @@
//! Max number of effects that can be attached to a single sound source
#define CAUDIO_SOURCE_MAX_EFFECT_SLOTS 4
//! Tells cAudio to use the C standard memory functions for allocations (memalloc and free)
#define CAUDIO_MEMORY_USE_STD
//! Tells cAudio to reroute memory allocations from stl containers into the defined memory provider for cAudio, otherwise the standard std::allocator is used.
//#define CAUDIO_REROUTE_STL_ALLOCATIONS
//! Activates the internal memory tracker, which can be used to detect and locate memory leaks.
//#define CAUDIO_USE_MEMORYTRACKER
//! Tells the memory tracker to generate statistics on memory usage by cAudio
//#define CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
//! Tells the memory tracker to log each and every allocation done by cAudio. This can be very slow, use only if you are debugging an issue.
//#define CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#endif //CAUDIO_PLATFORM_MAC
/////////////////////
// IPhone Settings //
/////////////////////
#ifdef CAUDIO_PLATFORM_IPHONE
#define CAUDIO_API extern "C"
//!Define for making the entire library Thread Safe, comment out to disable. Will also disable internal threading by the library.
#define CAUDIO_MAKE_THREAD_SAFE
#ifdef CAUDIO_MAKE_THREAD_SAFE
//! Define enables threading for the main update loop. Disable to run the internal update loop yourself. NOTE: Internal threading should NOT be used if the library is not thread safe!
#define CAUDIO_USE_INTERNAL_THREAD
#endif //CAUDIO_MAKE_THREAD_SAFE
//! This define controls whether the Ogg/Vorbis decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_OGG_DECODER
//! This define controls whether the RIFF/Wav decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_WAV_DECODER
//! This define controls whether the default filesystem data source is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_SOURCE
//! This define controls whether the default file logger (html) is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
//! This define controls whether the default console logger is compiled into the library
#define CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
//! Size of the internal buffer per source for audio data (total amount buffered is CAUDIO_SOURCE_BUFFER_SIZE * CAUDIO_SOURCE_NUM_BUFFERS)
#define CAUDIO_SOURCE_BUFFER_SIZE ( 1024 * 64 )
//! Number of internal buffers to cycle through per source (Note: using only 1 leads to choppy sound or premature ending of sources)
#define CAUDIO_SOURCE_NUM_BUFFERS 3
//! Tells cAudio to use the C standard memory functions for allocations (memalloc and free)
#define CAUDIO_MEMORY_USE_STD
//! Tells cAudio to reroute memory allocations from stl containers into the defined memory provider for cAudio, otherwise the standard std::allocator is used.
//#define CAUDIO_REROUTE_STL_ALLOCATIONS
//! Activates the internal memory tracker, which can be used to detect and locate memory leaks.
//#define CAUDIO_USE_MEMORYTRACKER
//! Tells the memory tracker to generate statistics on memory usage by cAudio
//#define CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
//! Tells the memory tracker to log each and every allocation done by cAudio. This can be very slow, use only if you are debugging an issue.
//#define CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#endif //CAUDIO_PLATFORM_IPHONE
////////////////////
// Linux Settings //
////////////////////
#ifdef CAUDIO_PLATFORM_LINUX
#define CAUDIO_API extern "C"
//!Define for making the entire library Thread Safe, comment out to disable. Will also disable internal threading by the library.
#define CAUDIO_MAKE_THREAD_SAFE
#ifdef CAUDIO_MAKE_THREAD_SAFE
//! Define enables threading for the main update loop. Disable to run the internal update loop yourself. NOTE: Internal threading should NOT be used if the library is not thread safe!
#define CAUDIO_USE_INTERNAL_THREAD
#endif //CAUDIO_MAKE_THREAD_SAFE
//! This define controls whether the Ogg/Vorbis decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_OGG_DECODER
//! This define controls whether the RIFF/Wav decoder is compiled into the library.
#define CAUDIO_COMPILE_WITH_WAV_DECODER
//! This define controls whether the default filesystem data source is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_SOURCE
//! This define controls whether the default file logger (html) is compiled into the library
#define CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
//! This define controls whether the default console logger is compiled into the library
#define CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
//! This define controls whether plugin support is added into the library, commenting it out will prevent any plugins from working
#define CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
#ifdef CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
//! Define enabled support for plugins as dynamic libs
#define CAUDIO_COMPILE_WITH_DYNAMIC_PLUGIN_SUPPORT
#endif //CAUDIO_COMPILE_WITH_PLUGIN_SUPPORT
//! Size of the internal buffer per source for audio data (total amount buffered is CAUDIO_SOURCE_BUFFER_SIZE * CAUDIO_SOURCE_NUM_BUFFERS)
#define CAUDIO_SOURCE_BUFFER_SIZE ( 1024 * 64 )
//! Number of internal buffers to cycle through per source (Note: using only 1 leads to choppy sound or premature ending of sources)
#define CAUDIO_SOURCE_NUM_BUFFERS 3
//! Since linux has license issues with OpenAL EFX, we cannot release the header files necessary for it. Therefore, we must disable EFX on linux. Uncomment this define if you have EFX available on linux.
//#define CAUDIO_EFX_ENABLED
//! Max number of effects that can be attached to a single sound source
//#define CAUDIO_SOURCE_MAX_EFFECT_SLOTS 4
//! Tells cAudio to use the C standard memory functions for allocations (memalloc and free)
#define CAUDIO_MEMORY_USE_STD
//! Tells cAudio to reroute memory allocations from stl containers into the defined memory provider for cAudio, otherwise the standard std::allocator is used.
#define CAUDIO_REROUTE_STL_ALLOCATIONS
//! Activates the internal memory tracker, which can be used to detect and locate memory leaks.
//#define CAUDIO_USE_MEMORYTRACKER
//! Tells the memory tracker to generate statistics on memory usage by cAudio
//#define CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
//! Tells the memory tracker to log each and every allocation done by cAudio. This can be very slow, use only if you are debugging an issue.
//#define CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#endif //CAUDIO_PLATFORM_LINUX

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "cAudioDefines.h"

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#if !defined( CAUDIO_PLATFORM_WIN )

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "cAudioDefines.h"
@ -29,7 +33,7 @@ namespace cAudio
# define cfopen fopen
#endif
#ifdef CAUDIO_REROUTE_STL_ALLOCATIONS
#if CAUDIO_REROUTE_STL_ALLOCATIONS == 1
typedef std::basic_string< cAudioChar, std::char_traits<cAudioChar>, cSTLAllocator<cAudioChar> > cAudioString;
#else
//typedef std::string cAudioString;

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#pragma once
#include "cAudioDefines.h"
@ -12,7 +16,7 @@
namespace cAudio
{
#ifdef CAUDIO_REROUTE_STL_ALLOCATIONS
#if CAUDIO_REROUTE_STL_ALLOCATIONS == 1
//! Reroutes allocations from STL containers into cAudio's memory system
template <typename T> class cSTLAllocator
{
@ -113,7 +117,7 @@ namespace cAudio
}
#endif
#ifdef CAUDIO_REROUTE_STL_ALLOCATIONS
#if CAUDIO_REROUTE_STL_ALLOCATIONS == 1
//typedef std::basic_string< cAudioChar, std::char_traits<cAudioChar>, cSTLAllocator<cAudioChar> > cAudioString;
template<typename T1, typename T2> struct cAudioMap { typedef std::map< T1, T2, std::less< T1 >, cSTLAllocator< std::pair< T1, T2 > > > Type; };
template<typename T> struct cAudioSet { typedef std::set< T, std::less< T >, cSTLAllocator< T > > Type; };

View File

@ -1,16 +1,16 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#ifndef CVECTOR3_H
#define CVECTOR3_H
#pragma once
#include <math.h>
#include <limits>
namespace cAudio
{
//! Smallest number that can be represented with a 32 bit float (may not match your compiler/os varient)
const float Epsilon = 0.000001f;
const float Epsilon = std::numeric_limits<float>::epsilon();
//! Internal function that compares two floats while keeping the Epsilon in mind.
inline bool float_equals(const float a, const float b)
@ -151,6 +151,4 @@ namespace cAudio
output[2] = z;
}
};
};
#endif //! CVECTOR3_H
};

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cAudioCapture.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cAudioManager.h"
@ -20,7 +20,7 @@
#include <string.h>
#include <algorithm>
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
#ifdef CAUDIO_PLATFORM_WIN
#include <efx.h>
@ -36,16 +36,16 @@
namespace cAudio
{
#ifdef CAUDIO_COMPILE_WITH_OGG_DECODER
#if CAUDIO_COMPILE_WITH_OGG_DECODER == 1
static cOggAudioDecoderFactory OggDecoderFactory;
#endif
#ifdef CAUDIO_COMPILE_WITH_WAV_DECODER
#if CAUDIO_COMPILE_WITH_WAV_DECODER == 1
static cWavAudioDecoderFactory WavDecoderFactory;
#endif
static cRawAudioDecoderFactory RawDecoderFactory;
#ifdef CAUDIO_COMPILE_WITH_FILE_SOURCE
#if CAUDIO_COMPILE_WITH_FILE_SOURCE == 1
static cFileSourceFactory FileSourceFactory;
#endif
@ -75,7 +75,7 @@ namespace cAudio
attribs[currentAttrib++] = ALC_FREQUENCY;
attribs[currentAttrib++] = outputFrequency;
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
if(eaxEffectSlots > 0)
{
attribs[currentAttrib++] = ALC_MAX_AUXILIARY_SENDS;
@ -114,7 +114,7 @@ namespace cAudio
return false;
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
initEffects.getEFXInterface()->Mutex.lock();
EFXSupported = initEffects.getEFXInterface()->CheckEFXSupport(Device);
initEffects.getEFXInterface()->Mutex.unlock();
@ -124,7 +124,7 @@ namespace cAudio
getLogger()->logInfo("AudioManager", "OpenAL Version: %s", alGetString(AL_VERSION));
getLogger()->logInfo("AudioManager", "Vendor: %s", alGetString(AL_VENDOR));
getLogger()->logInfo("AudioManager", "Renderer: %s", alGetString(AL_RENDERER));
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
if(EFXSupported)
{
int EFXMajorVersion = 0;
@ -176,7 +176,7 @@ namespace cAudio
source->drop();
if(decoder && decoder->isValid())
{
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
IAudioSource* audio = CAUDIO_NEW cAudioSource(decoder, Context, initEffects.getEFXInterface());
#else
IAudioSource* audio = CAUDIO_NEW cAudioSource(decoder, Context);
@ -233,7 +233,7 @@ namespace cAudio
{
if(decoder->isValid())
{
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
IAudioSource* audio = CAUDIO_NEW cAudioSource(decoder, Context, initEffects.getEFXInterface());
#else
IAudioSource* audio = CAUDIO_NEW cAudioSource(decoder, Context);
@ -297,7 +297,7 @@ namespace cAudio
{
if(decoder->isValid())
{
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
IAudioSource* audio = CAUDIO_NEW cAudioSource(decoder, Context, initEffects.getEFXInterface());
#else
IAudioSource* audio = CAUDIO_NEW cAudioSource(decoder, Context);
@ -733,16 +733,16 @@ namespace cAudio
manager->getAvailableDevices();
#ifdef CAUDIO_COMPILE_WITH_OGG_DECODER
#if CAUDIO_COMPILE_WITH_OGG_DECODER == 1
manager->registerAudioDecoder(&OggDecoderFactory, "ogg");
#endif
#ifdef CAUDIO_COMPILE_WITH_WAV_DECODER
#if CAUDIO_COMPILE_WITH_WAV_DECODER == 1
manager->registerAudioDecoder(&WavDecoderFactory, "wav");
#endif
manager->registerAudioDecoder(&RawDecoderFactory, "raw");
#ifdef CAUDIO_COMPILE_WITH_FILE_SOURCE
#if CAUDIO_COMPILE_WITH_FILE_SOURCE == 1
manager->registerDataSource(&FileSourceFactory, "FileSystem", 0);
#endif

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../include/cAudioMemory.h"
#include "../Headers/cStandardMemoryProvider.h"
@ -5,11 +9,12 @@ namespace cAudio
{
CAUDIO_API IMemoryProvider* getMemoryProvider()
{
#ifdef CAUDIO_MEMORY_USE_STD
//To use your own memory provider, add it in here and set its name to memoryProvider
#if CAUDIO_MEMORY_USE_STD == 1
static cStandardMemoryProvider memoryProvider;
#endif
//To use your own memory provider, add it in here and set its name to memoryProvider
return &memoryProvider;
#else
# error "No custom memory provider enabled here!"
#endif
}
};

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../include/cAudioPlatform.h"

View File

@ -1,4 +1,4 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
@ -12,7 +12,7 @@
namespace cAudio
{
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
cAudioSource::cAudioSource(IAudioDecoder* decoder, ALCcontext* context, cEFXFunctions* oALFunctions)
: Context(context), Source(0), Decoder(decoder), Loop(false), Valid(false),
EFX(oALFunctions), Filter(NULL), EffectSlotsAvailable(0), LastFilterTimeStamp(0)
@ -26,7 +26,7 @@ namespace cAudio
for(int i=0; i<CAUDIO_SOURCE_NUM_BUFFERS; ++i)
Buffers[i] = 0;
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
for(int i=0; i<CAUDIO_SOURCE_MAX_EFFECT_SLOTS; ++i)
Effects[i] = NULL;
@ -46,13 +46,13 @@ namespace cAudio
alGenSources(1, &Source);
state = !checkError();
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
Valid = state && (Decoder != NULL) && (Context != NULL) && (EFX != NULL);
#else
Valid = state && (Decoder != NULL) && (Context != NULL);
#endif
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
int numSlots = 0;
ALCdevice* device = alcGetContextsDevice(Context);
alcGetIntegerv(device, ALC_MAX_AUXILIARY_SENDS, 1, &numSlots);
@ -68,7 +68,7 @@ namespace cAudio
if(Decoder)
Decoder->drop();
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
for(int i=0; i<CAUDIO_SOURCE_MAX_EFFECT_SLOTS; ++i)
{
if(Effects[i])
@ -107,7 +107,7 @@ namespace cAudio
alSourceQueueBuffers(Source, queueSize, Buffers);
checkError();
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
updateFilter();
for(unsigned int i=0; i<CAUDIO_SOURCE_MAX_EFFECT_SLOTS; ++i)
updateEffect(i);
@ -229,7 +229,7 @@ namespace cAudio
bool active = true;
if(isValid() || isPlaying())
{
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
updateFilter();
for(unsigned int i=0; i<CAUDIO_SOURCE_MAX_EFFECT_SLOTS; ++i)
updateEffect(i);
@ -574,7 +574,7 @@ namespace cAudio
return velocity;
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
unsigned int cAudioSource::getNumEffectSlotsAvailable() const
{
return EffectSlotsAvailable;
@ -731,7 +731,7 @@ namespace cAudio
};
}
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
void cAudioSource::updateFilter(bool remove)
{
if(!remove)

View File

@ -1,10 +1,10 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cConsoleLogReceiver.h"
#ifdef CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER == 1
#include <iostream>
namespace cAudio

View File

@ -1,12 +1,12 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cEffect.h"
#include "../Headers/cLogger.h"
#include "../Headers/cUtils.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
namespace cAudio
{

View File

@ -1,10 +1,10 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cFileLogReceiver.h"
#ifdef CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER == 1
#include <iostream>
#include <fstream>

View File

@ -1,11 +1,11 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cFileSource.h"
#include "../Headers/cUtils.h"
#ifdef CAUDIO_COMPILE_WITH_FILE_SOURCE
#if CAUDIO_COMPILE_WITH_FILE_SOURCE == 1
#include <cstring>

View File

@ -1,12 +1,12 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cFilter.h"
#include "../Headers/cLogger.h"
#include "../Headers/cUtils.h"
#ifdef CAUDIO_EFX_ENABLED
#if CAUDIO_EFX_ENABLED == 1
namespace cAudio
{

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cListener.h"
@ -49,18 +49,18 @@ namespace cAudio
alListener3f(AL_POSITION, Position.x, Position.y, Position.z);
alListener3f(AL_VELOCITY, Velocity.x, Velocity.y, Velocity.z);
}
#ifdef CAUDIO_EFX_ENABLED
void cListener::setMetersPerUnit(const float& meters)
{
cAudioMutexBasicLock lock(Mutex);
alListenerf(AL_METERS_PER_UNIT, meters);
}
#if CAUDIO_EFX_ENABLED == 1
void cListener::setMetersPerUnit(const float& meters)
{
cAudioMutexBasicLock lock(Mutex);
alListenerf(AL_METERS_PER_UNIT, meters);
}
float cListener::getMetersPerUnit(void) const
{
float value = 1.0f;
alGetListenerf(AL_METERS_PER_UNIT, &value);
return value;
}
float cListener::getMetersPerUnit(void) const
{
float value = 1.0f;
alGetListenerf(AL_METERS_PER_UNIT, &value);
return value;
}
#endif
};

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include <time.h>
@ -14,11 +14,11 @@ namespace cAudio
static cLogger Logger;
static bool FirstTimeLogInit(false);
#ifdef CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER == 1
static cConsoleLogReceiver ConsoleLog;
#endif
#ifdef CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER == 1
static cFileLogReceiver FileLog;
#endif
@ -154,10 +154,10 @@ namespace cAudio
if(!FirstTimeLogInit)
{
FirstTimeLogInit = true;
#ifdef CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_CONSOLE_LOG_RECEIVER == 1
Logger.registerLogReceiver(&ConsoleLog, "Console");
#endif
#ifdef CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER
#if CAUDIO_COMPILE_WITH_FILE_LOG_RECEIVER == 1
Logger.registerLogReceiver(&FileLog,"File");
#endif
}

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cMemorySource.h"

View File

@ -1,20 +1,24 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cMemoryTracker.h"
#ifdef CAUDIO_USE_MEMORYTRACKER
#if CAUDIO_USE_MEMORYTRACKER == 1
namespace cAudio
{
cMemoryTracker::cMemoryTracker()
{
#ifdef CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#if CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS == 1
outMemLog.open("cAudioMemoryLog.log");
#endif
}
cMemoryTracker::~cMemoryTracker()
{
#ifdef CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#if CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS == 1
outMemLog.close();
#endif
DumpLeaks();
@ -30,7 +34,7 @@ void cMemoryTracker::AddAllocation(void* pointer, size_t size, const char* filen
block.function = function;
TrackedBlocks[pointer] = block;
#ifdef CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
#if CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS == 1
MemStats.CurrentAllocationBytes += size;
MemStats.TotalAllocationBytes += size;
@ -41,7 +45,7 @@ void cMemoryTracker::AddAllocation(void* pointer, size_t size, const char* filen
MemStats.MaxNumAllocations = MemStats.CurrentNumAllocations > MemStats.MaxNumAllocations ? MemStats.CurrentNumAllocations : MemStats.MaxNumAllocations;
#endif
#ifdef CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#if CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS == 1
if(outMemLog.good())
{
outMemLog << "Allocation at " << pointer << " with size " << size << " bytes in " << filename << " (Line: " << line << ") function: " << function << std::endl;
@ -56,7 +60,7 @@ void cMemoryTracker::RemoveAllocation(void* pointer)
std::map<void*, cTrackedMemoryBlock>::iterator it = TrackedBlocks.find(pointer);
if(it != TrackedBlocks.end())
{
#ifdef CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS
#if CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS == 1
if(outMemLog.good())
{
outMemLog << "Deallocation of address " << pointer << " with size " << it->second.size << " bytes in " << it->second.filename << " (Line: " << it->second.line << ") function: " << it->second.function << std::endl;
@ -64,7 +68,7 @@ void cMemoryTracker::RemoveAllocation(void* pointer)
}
#endif
#ifdef CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
#if CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS == 1
size_t size = it->second.size;
MemStats.CurrentAllocationBytes -= size;
MemStats.CurrentNumAllocations -= 1;
@ -79,7 +83,7 @@ void cMemoryTracker::DumpLeaks()
std::ofstream leakFile("cAudioMemoryLeaks.log");
#ifdef CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS
#if CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS == 1
//Dump Statistics
leakFile << "Highest Amount of Allocated Memory: " << MemStats.AllocationHighWaterMark << " bytes." << std::endl;
leakFile << "Memory Allocated at Shutdown: " << MemStats.CurrentAllocationBytes << " bytes." << std::endl;

View File

@ -1,12 +1,12 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cMutex.h"
namespace cAudio
{
#ifdef CAUDIO_MAKE_THREAD_SAFE
#if CAUDIO_MAKE_THREAD_SAFE == 1
cAudioMutex::cAudioMutex() : Initialized(false)
{
}

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cOggAudioDecoderFactory.h"

View File

@ -1,10 +1,10 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cOggDecoder.h"
#ifdef CAUDIO_COMPILE_WITH_OGG_DECODER
#if CAUDIO_COMPILE_WITH_OGG_DECODER == 1
namespace cAudio
{

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cPluginManager.h"
#include "../Headers/cUtils.h"
#include "../include/cAudioPlatform.h"

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cRawDecoder.h"

View File

@ -1,3 +1,7 @@
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cStandardMemoryProvider.h"
#include "../Headers/cMemoryTracker.h"
#include <stdlib.h>
@ -16,7 +20,7 @@ namespace cAudio
void* cStandardMemoryProvider::Allocate(size_t size, const char* filename, int line, const char* function)
{
void* ptr = malloc(size);
#ifdef CAUDIO_USE_MEMORYTRACKER
#if CAUDIO_USE_MEMORYTRACKER == 1
cMemoryTracker::Instance()->AddAllocation(ptr, size, filename, line, function);
#endif
return ptr;
@ -26,7 +30,7 @@ namespace cAudio
{
if(pointer)
{
#ifdef CAUDIO_USE_MEMORYTRACKER
#if CAUDIO_USE_MEMORYTRACKER == 1
cMemoryTracker::Instance()->RemoveAllocation(pointer);
#endif
free(pointer);

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cThread.h"

View File

@ -1,5 +1,5 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cWavAudioDecoderFactory.h"

View File

@ -1,11 +1,11 @@
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
#include "../Headers/cWavDecoder.h"
#include <string.h>
#ifdef CAUDIO_COMPILE_WITH_WAV_DECODER
#if CAUDIO_COMPILE_WITH_WAV_DECODER == 1
namespace cAudio
{