cpp_photon/include/audio/SampleResourceManager.hpp

50 lines
1.1 KiB
C++
Raw Normal View History

2005-07-05 06:44:55 +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-07-18 05:14:18 +00:00
// $Id: SampleResourceManager.hpp,v 1.2 2005/07/18 05:14:18 cozman Exp $
#ifdef PHOTON_USE_OPENAL
2005-07-05 06:44:55 +00:00
#ifndef PHOTON_AUDIO_SAMPLERESOURCEMANAGER_HPP
#define PHOTON_AUDIO_SAMPLERESOURCEMANAGER_HPP
#include "ResourceManager.hpp"
#include "audio/Source.hpp"
namespace photon
{
namespace audio
{
2005-07-18 05:14:18 +00:00
// All that a Sample is is a bufferID, extremely simple resource management
2005-07-05 06:44:55 +00:00
class SampleResource : public Resource
{
public:
uint bufferID;
};
class SampleResourceManager : public ResourceManager<SampleResource>
{
public:
void getAudioData(const std::string& name, uint& bufferID);
private:
virtual void loadResourceData(SampleResource &res,
const ResourceDescriptor& path);
virtual void freeResourceData(SampleResource &res);
};
2005-07-18 05:14:18 +00:00
// Allow users to simply call a Sample a Sample
2005-07-05 06:44:55 +00:00
typedef Source<SampleResourceManager> Sample;
}
}
#endif //PHOTON_AUDIO_SAMPLERESOURCEMANAGER_HPP
2005-07-18 05:14:18 +00:00
#endif //PHOTON_USE_OPENAL