post-Kernel
This commit is contained in:
parent
51f0f64807
commit
e118a3bcaf
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: AudioCore.hpp,v 1.3 2005/03/14 05:34:08 cozman Exp $
|
// $Id: AudioCore.hpp,v 1.4 2005/03/15 18:41:27 cozman Exp $
|
||||||
|
|
||||||
#ifndef PHOTON_AUDIO_AUDIOCORE_HPP
|
#ifndef PHOTON_AUDIO_AUDIOCORE_HPP
|
||||||
#define PHOTON_AUDIO_AUDIOCORE_HPP
|
#define PHOTON_AUDIO_AUDIOCORE_HPP
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include "al.h"
|
#include "al.h"
|
||||||
#include "alc.h"
|
#include "alc.h"
|
||||||
|
|
||||||
#include "Task.hpp"
|
#include "util/Singleton.hpp"
|
||||||
#include "util/VersionInfo.hpp"
|
#include "util/VersionInfo.hpp"
|
||||||
|
|
||||||
namespace photon
|
namespace photon
|
||||||
@ -27,7 +27,7 @@ namespace audio
|
|||||||
//
|
//
|
||||||
// Parent:
|
// Parent:
|
||||||
// <Singleton>
|
// <Singleton>
|
||||||
class AudioCore : public Singleton<AudioCore>
|
class AudioCore : public util::Singleton<AudioCore>
|
||||||
{
|
{
|
||||||
|
|
||||||
// Group: (Con/De)structors
|
// Group: (Con/De)structors
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: AudioCore.cpp,v 1.3 2005/03/14 05:34:25 cozman Exp $
|
// $Id: AudioCore.cpp,v 1.4 2005/03/15 18:42:40 cozman Exp $
|
||||||
|
|
||||||
#include "audio/AudioCore.hpp"
|
#include "audio/AudioCore.hpp"
|
||||||
|
|
||||||
@ -17,11 +17,9 @@ namespace photon
|
|||||||
namespace audio
|
namespace audio
|
||||||
{
|
{
|
||||||
|
|
||||||
AudioCore::AudioCore() :
|
AudioCore::AudioCore()
|
||||||
Task("AudioCore",PRI_CORE)
|
|
||||||
{
|
{
|
||||||
util::VersionInfo oalReq(1,0,0); // requires OpenAL 1.0 (TODO: check?)
|
util::VersionInfo oalReq(1,0,0); // requires OpenAL 1.0 (TODO: check?)
|
||||||
|
|
||||||
util::ensureVersion("OpenAL", initOpenAL(), oalReq);
|
util::ensureVersion("OpenAL", initOpenAL(), oalReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,10 +49,10 @@ util::VersionInfo AudioCore::initOpenAL()
|
|||||||
{
|
{
|
||||||
ALCdevice* device(0);
|
ALCdevice* device(0);
|
||||||
ALCcontext* context(0);
|
ALCcontext* context(0);
|
||||||
std::stringstream ss;
|
std::stringstream ss; // stream for parsing version
|
||||||
std::string junks;
|
std::string junks; // junk string for parsing
|
||||||
char junkc;
|
char junkc; // junk character for parsing
|
||||||
uint major,minor;
|
uint major,minor; // version numbers
|
||||||
|
|
||||||
// obtain default device if no deviceName is set, otherwise use deviceName
|
// obtain default device if no deviceName is set, otherwise use deviceName
|
||||||
device = alcOpenDevice(deviceName_.empty() ? 0 :
|
device = alcOpenDevice(deviceName_.empty() ? 0 :
|
||||||
@ -119,6 +117,7 @@ std::string AudioCore::checkOpenALError()
|
|||||||
void AudioCore::setDesiredDevice(const std::string& name)
|
void AudioCore::setDesiredDevice(const std::string& name)
|
||||||
{
|
{
|
||||||
// deviceName_ is used inside initOpenAL, must be set prior to construction
|
// deviceName_ is used inside initOpenAL, must be set prior to construction
|
||||||
|
// or not set at all (in which case default device will be used)
|
||||||
deviceName_ = name;
|
deviceName_ = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user