2007-05-27 12:01:53 -04:00
|
|
|
// $Id$
|
|
|
|
//
|
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
|
|
|
// Copyright (C) 2006 Patrick Ammann <pammann@aro.ch>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-06-12 20:53:52 -04:00
|
|
|
// as published by the Free Software Foundation; either version 3
|
2007-05-27 12:01:53 -04:00
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
2008-09-17 23:24:19 -04:00
|
|
|
#ifndef HEADER_SFX_OPENAL_HPP
|
|
|
|
#define HEADER_SFX_OPENAL_HPP
|
2007-05-27 12:01:53 -04:00
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#ifdef __APPLE__
|
|
|
|
# include <OpenAL/al.h>
|
|
|
|
#else
|
|
|
|
# include <AL/al.h>
|
|
|
|
#endif
|
2008-09-17 23:24:19 -04:00
|
|
|
#include "audio/sfx_base.hpp"
|
|
|
|
#include "audio/sfx_manager.hpp"
|
2007-05-27 12:01:53 -04:00
|
|
|
|
2008-09-17 23:24:19 -04:00
|
|
|
class SFXOpenAL : public SFXBase
|
2007-05-27 12:01:53 -04:00
|
|
|
{
|
2008-09-17 23:24:19 -04:00
|
|
|
private:
|
|
|
|
ALuint m_soundBuffer; // Buffers hold sound data.
|
|
|
|
ALuint m_soundSource; // Sources are points emitting sound.
|
2008-09-20 10:23:20 -04:00
|
|
|
bool m_ok;
|
2008-11-06 02:17:11 -05:00
|
|
|
bool m_positional;
|
2009-04-12 07:20:13 -04:00
|
|
|
float m_defaultGain;
|
2007-05-27 12:01:53 -04:00
|
|
|
public:
|
2008-11-06 02:17:11 -05:00
|
|
|
SFXOpenAL(ALuint buffer, bool positional, float rolloff, float gain);
|
2008-09-20 10:23:20 -04:00
|
|
|
virtual ~SFXOpenAL();
|
|
|
|
virtual void play();
|
|
|
|
virtual void loop();
|
|
|
|
virtual void stop();
|
|
|
|
virtual void pause();
|
|
|
|
virtual void resume();
|
|
|
|
virtual void speed(float factor);
|
2008-10-09 18:24:19 -04:00
|
|
|
virtual void position(const Vec3 &position);
|
2009-04-12 07:20:13 -04:00
|
|
|
virtual void volume(float gain);
|
2008-09-20 10:23:20 -04:00
|
|
|
virtual SFXManager::SFXStatus getStatus();
|
2009-12-17 19:36:35 -05:00
|
|
|
|
2008-09-17 23:24:19 -04:00
|
|
|
}; // SFXOpenAL
|
|
|
|
|
|
|
|
#endif // HEADER_SFX_OPENAL_HPP
|
2007-05-27 12:01:53 -04:00
|
|
|
|