Backup.
This commit is contained in:
45
include/ehs/io/Resource.h
Normal file
45
include/ehs/io/Resource.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/Types.h"
|
||||
#include "ehs/Str.h"
|
||||
#include "ehs/Vec2.h"
|
||||
#include "ehs/BaseObj.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Resource : public BaseObj
|
||||
{
|
||||
private:
|
||||
ehs::UInt_64 hashId;
|
||||
ehs::Str_8 id;
|
||||
|
||||
public:
|
||||
Resource();
|
||||
|
||||
Resource(ehs::Str_8 id);
|
||||
|
||||
Resource(Resource&& rsrc) noexcept;
|
||||
|
||||
Resource(const Resource& rsrc);
|
||||
|
||||
Resource& operator=(Resource&& rsrc) noexcept;
|
||||
|
||||
Resource& operator=(const Resource& rsrc);
|
||||
|
||||
bool operator==(ehs::UInt_64 otherHashId) const;
|
||||
|
||||
bool operator!=(ehs::UInt_64 otherHashId) const;
|
||||
|
||||
virtual void Release();
|
||||
|
||||
void SetId(ehs::Str_8 newId);
|
||||
|
||||
ehs::UInt_64 GetHashId() const;
|
||||
|
||||
ehs::Str_8 GetId() const;
|
||||
|
||||
virtual bool IsValid() const;
|
||||
|
||||
Resource* Clone() const override;
|
||||
};
|
||||
}
|
@@ -1,22 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/Types.h"
|
||||
#include "ehs/BaseObj.h"
|
||||
#include "ehs/DataType.h"
|
||||
#include "ehs/Str.h"
|
||||
#include "ehs/Serializer.h"
|
||||
#include "ehs/Vector.h"
|
||||
#include "ehs/Array.h"
|
||||
#include "ehs/io/Resource.h"
|
||||
#include "AudioCodec.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class Audio : public BaseObj
|
||||
class Audio : public Resource
|
||||
{
|
||||
private:
|
||||
static Array<AudioCodec> codecs;
|
||||
UInt_64 hashId;
|
||||
Str_8 id;
|
||||
UInt_64 sampleRate;
|
||||
DataType dataType;
|
||||
UInt_8 byteDepth;
|
||||
@@ -37,7 +35,7 @@ namespace ehs
|
||||
|
||||
static const AudioCodec* GetCodec(const Str_8& ext);
|
||||
|
||||
~Audio();
|
||||
~Audio() override;
|
||||
|
||||
Audio();
|
||||
|
||||
@@ -65,13 +63,7 @@ namespace ehs
|
||||
|
||||
operator Byte*();
|
||||
|
||||
void Release();
|
||||
|
||||
UInt_64 GetHashId() const;
|
||||
|
||||
void SetId(Str_8 newId);
|
||||
|
||||
Str_8 GetId() const;
|
||||
void Release() override;
|
||||
|
||||
UInt_64 GetSampleRate() const;
|
||||
|
||||
|
Reference in New Issue
Block a user