cpp_photon/include/audio/AudioCore.hpp

79 lines
1.8 KiB
C++
Raw Normal View History

2005-02-27 05:55:18 +00:00
//This file is part of Photon (http://photon.sourceforge.net)
//Copyright (C) 2004-2005 James Turk
//
// Author:
// James Turk (jpt2433@rit.edu)
//
// Version:
2005-03-01 07:51:23 +00:00
// $Id: AudioCore.hpp,v 1.2 2005/03/01 07:51:23 cozman Exp $
2005-02-27 05:55:18 +00:00
#ifndef PHOTON_AUDIO_AUDIOCORE_HPP
#define PHOTON_AUDIO_AUDIOCORE_HPP
#include "al.h"
#include "alc.h"
#include "util/Singleton.hpp"
#include "util/VersionInfo.hpp"
namespace photon
{
namespace audio
{
2005-03-01 07:51:23 +00:00
// Class: AudioCore
// Photon's <Singleton> core for audio manipulation/control. Defines the
// interface through which all audio related functions are performed.
//
// Parent:
// <Singleton>
2005-02-27 05:55:18 +00:00
class AudioCore : public util::Singleton<AudioCore>
{
2005-03-01 07:51:23 +00:00
// Group: Accessors
2005-02-27 05:55:18 +00:00
public:
2005-03-01 07:51:23 +00:00
// Function: getAudioDeviceName
// Get name of active audio device.
//
// Returns:
// Name of audio device currently in use.
2005-02-27 05:55:18 +00:00
std::string getAudioDeviceName() const;
2005-03-01 07:51:23 +00:00
// Group: Initialization
public:
// Function: setDesiredDevice
// Set the name of the desired audio device to use. Static function of
// AudioCore, must be called before AudioCore::initialize() or not at all.
//
// If called, the initialization of the audio library will attempt to
// use the specified audio device, otherwise the default device will be
// used.
//
// Parameters:
// name - Name of audio device to use.
static void setDesiredDevice(const std::string& name);
// OpenAL specifics
2005-02-27 05:55:18 +00:00
private:
util::VersionInfo initOpenAL();
static std::string checkOpenALError();
2005-03-01 07:51:23 +00:00
// data members
2005-02-27 05:55:18 +00:00
private:
static std::string deviceName_;
// Singleton-required code
private:
AudioCore();
~AudioCore();
friend class util::Singleton<AudioCore>;
friend class std::auto_ptr<AudioCore>;
};
}
}
#endif //PHOTON_AUDIO_AUDIOCORE_HPP