mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 23:08:00 +03:00
Renamed all .h to .hpp for consistency
This commit is contained in:
parent
52e7570b4f
commit
6b0b7c95f8
53 changed files with 80 additions and 79 deletions
60
sound/source.hpp
Normal file
60
sound/source.hpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
#ifndef MANGLE_SOUND_SOURCE_H
|
||||
#define MANGLE_SOUND_SOURCE_H
|
||||
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "../stream/stream.hpp"
|
||||
|
||||
namespace Mangle {
|
||||
namespace Sound {
|
||||
|
||||
/// A stream containing raw sound data and information about the format
|
||||
class SampleSource : public Stream::Stream
|
||||
{
|
||||
protected:
|
||||
bool isEof;
|
||||
|
||||
public:
|
||||
SampleSource() : isEof(false) {}
|
||||
|
||||
/// Get the sample rate, number of channels, and bits per
|
||||
/// sample. NULL parameters are ignored.
|
||||
virtual void getInfo(int32_t *rate, int32_t *channels, int32_t *bits) = 0;
|
||||
|
||||
bool eof() const { return isEof; }
|
||||
|
||||
// Disabled functions by default. You can still override them in
|
||||
// subclasses.
|
||||
void seek(size_t pos) { assert(0); }
|
||||
size_t tell() const { assert(0); }
|
||||
size_t size() const { assert(0); }
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<SampleSource> SampleSourcePtr;
|
||||
|
||||
/// A factory interface for loading SampleSources from file or stream
|
||||
class SampleSourceLoader
|
||||
{
|
||||
public:
|
||||
/// If true, the stream version of load() works
|
||||
bool canLoadStream;
|
||||
|
||||
/// If true, the file version of load() works
|
||||
bool canLoadFile;
|
||||
|
||||
/// Load a sound input source from file (if canLoadFile is true)
|
||||
virtual SampleSourcePtr load(const std::string &file) = 0;
|
||||
|
||||
/// Load a sound input source from stream (if canLoadStream is true)
|
||||
virtual SampleSourcePtr load(Stream::StreamPtr input) = 0;
|
||||
|
||||
/// Virtual destructor
|
||||
virtual ~SampleSourceLoader() {}
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<SampleSourceLoader> SampleSourceLoaderPtr;
|
||||
|
||||
}} // namespaces
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue