Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

more nice comments, and also updated the KeepLevel loading (if you want to load a Resource to a KeepLevel just append it at loadtime:
eg.:
Texture tex = ResourceTexture(orxonox.png, GL_TEXTURE_2D, GameEnd);
where GameEnd is the KeepLevel as defined in orxonox.cc→initResources()

File size: 1.3 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::Resource
16  {
17    ObjectListDeclaration(ResourceSoundBuffer);
18  public:
19    ResourceSoundBuffer(const std::string& soundName,
20                        const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
21    static ResourceSoundBuffer createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel())
22    { return ResourceSoundBuffer(loadString, keepLevel); };
23
24  private:
25  class SoundBufferResourcePointer : public Resources::StorePointer
26    {
27    public:
28      SoundBufferResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const SoundBufferData::Pointer& data);
29      inline const SoundBufferData::Pointer& ptr() const { return pointer; }
30      virtual bool last() const { return pointer.count() == 1; }
31    private:
32      SoundBufferData::Pointer pointer;
33    };
34
35  private:
36    static Resources::tType<ResourceSoundBuffer> type;
37  };
38}
39
40
41#endif /* _RESOURCE_SOUND_BUFFER_H */
Note: See TracBrowser for help on using the repository browser.