Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/sound/resource_sound_buffer.h @ 9823

Last change on this file since 9823 was 9823, checked in by bensch, 18 years ago

orxonox/new_class_id: now it should also be possible, to cache the resources, by suppling a LoadString.
This is vital to loading Resources, when you only know the TypeName and a LoadString, but not the c++-type and the LoadParameters as is the case when loading over the internet.

File size: 1.1 KB
Line 
1/*!
2 * @file resource_sound_buffer.h
3 * @brief Contains the ResourceSoundBuffer class, that handles the Resource-specific loading part of the SoundBuffer.
4 *
5 */
6
7#ifndef _RESOURCE_SOUND_BUFFER_H
8#define _RESOURCE_SOUND_BUFFER_H
9
10#include "util/loading/resource.h"
11#include "sound_buffer.h"
12
13namespace OrxSound
14{
15  class ResourceSoundBuffer : public SoundBuffer, public Resources::NewResource
16  {
17    ObjectListDeclaration(ResourceSoundBuffer);
18  public:
19    ResourceSoundBuffer(const std::string& soundName);
20    static ResourceSoundBuffer createFromString(const std::string& loadString) { return ResourceSoundBuffer(loadString); };
21
22  private:
23  class SoundBufferResourcePointer : public Resources::StorePointer
24    {
25    public:
26      SoundBufferResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const SoundBufferData::Pointer& data);
27      inline const SoundBufferData::Pointer& ptr() const { return pointer; }
28    private:
29      SoundBufferData::Pointer pointer;
30    };
31
32  private:
33    static Resources::tType<ResourceSoundBuffer> type;
34  };
35}
36
37
38#endif /* _RESOURCE_SOUND_BUFFER_H */
Note: See TracBrowser for help on using the repository browser.