/*****************************************************************************
 * $LastChangedDate: 2010-03-28 22:05:39 -0400 (Sun, 28 Mar 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Main sound header file.
 *//*
 * LEGAL:   COPYRIGHT (C) 2009 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef SOUND_SOUND_HH
#define SOUND_SOUND_HH 1

#define GET_SOUND() (sound::Sound::GetInstance())

//------------------------------------------------------------------------------

// Sound resources can be freed or left allocated.
// Leaving allocated could be safer but memory checkers will complain.
// A reason for these is lack of SDL documentation regarding memory ownershp.
#define SOUND_FREE 1  // generic
#if COMPILE_SDL
#define SOUND_FREE_SDL 1
#elif COMPILE_PLIB
#define SOUND_FREE_PLIB 1
#endif

#if VERBOSE || DEBUG
#define SOUND_VERBOSE 1
#endif

// LOG_SOUND_ERRORS logs all sound errors (severe errors will still be shown unconditionally).
#if DEBUG
#define LOG_SOUND_ERRORS 1
#endif

#include "sound/defs.hh"

#if COMPILE_SDL
#   include "sound/sound_sdl.hh"
#elif COMPILE_PLIB
#   include "sound/sound_plib.hh"
#else
#   include "sound/sound_nop.hh"
#endif

//------------------------------------------------------------------------------

namespace sound {

#if COMPILE_SDL
    typedef SoundSDL  Sound;
#elif COMPILE_PLIB
    typedef SoundPLIB Sound;
#else
    typedef SoundNOP  Sound;
#endif

} // namespace sound

#endif // SOUND_SOUND_HH
