48 lines
1.0 KiB
C
48 lines
1.0 KiB
C
|
#pragma once
|
||
|
|
||
|
#include "ehs/EHS.h"
|
||
|
#include "ehs/Str.h"
|
||
|
#include "ehs/io/File.h"
|
||
|
|
||
|
namespace ehs
|
||
|
{
|
||
|
class Audio;
|
||
|
|
||
|
class AudioCodec
|
||
|
{
|
||
|
private:
|
||
|
Str_8 id;
|
||
|
UInt_64 hashExt;
|
||
|
Str_8 ext;
|
||
|
Endianness endianness;
|
||
|
bool (*encodeCb)(const AudioCodec* const, Serializer<UInt_64>&, const Audio*);
|
||
|
bool (*decodeCb)(const AudioCodec* const, Serializer<UInt_64>&, Audio*);
|
||
|
|
||
|
public:
|
||
|
AudioCodec();
|
||
|
|
||
|
AudioCodec(Str_8 id, Str_8 ext, const Endianness end,
|
||
|
bool (*encodeCb)(const AudioCodec* const, Serializer<UInt_64>&, const Audio*),
|
||
|
bool (*decodeCb)(const AudioCodec* const, Serializer<UInt_64>&, Audio*));
|
||
|
|
||
|
AudioCodec(AudioCodec&& codec) noexcept;
|
||
|
|
||
|
AudioCodec(const AudioCodec& codec);
|
||
|
|
||
|
AudioCodec& operator=(AudioCodec&& codec) noexcept;
|
||
|
|
||
|
AudioCodec& operator=(const AudioCodec& codec);
|
||
|
|
||
|
Str_8 GetId() const;
|
||
|
|
||
|
UInt_64 GetHashExt() const;
|
||
|
|
||
|
Str_8 GetExt() const;
|
||
|
|
||
|
Endianness GetEndianness() const;
|
||
|
|
||
|
bool Encode(Serializer<UInt_64>& out, const Audio* in) const;
|
||
|
|
||
|
bool Decode(Serializer<UInt_64>& in, Audio* out) const;
|
||
|
};
|
||
|
}
|