NSUNI/NSLAR Library
a250670
Loading...
Searching...
No Matches
phd.hpp
Go to the documentation of this file.
1
13
#pragma once
14
#include "
NNL/common/fixed_type.hpp
"
15
#include "
NNL/common/io.hpp
"
16
#include "
NNL/utility/data.hpp
"
17
namespace
nnl
{
24
29
namespace
phd
{
35
48
bool
IsOfType
(
BufferView
buffer);
49
50
bool
IsOfType
(
const
std::filesystem::path& path);
51
52
bool
IsOfType
(
Reader
& f);
53
55
56
namespace
raw {
62
constexpr
u32
kMagicBytes
=
utl::data::FourCC
(
"PPHD"
);
63
64
// PBD Header
65
NNL_PACK
(
struct
RCommonAttr {
66
u32
id
=
kMagicBytes
;
67
u32
attr_size =
sizeof
(RCommonAttr) -
sizeof
(
u32
) * 2;
68
u32
version = 0x10000;
69
u32
reserved_0 = -1;
70
u32
program_attr_offset =
sizeof
(RCommonAttr);
71
u32
tone_attr_offset =
sizeof
(RCommonAttr);
72
u32
vag_attr_offset =
sizeof
(RCommonAttr);
73
i32
reserved[9] = {-1, -1, -1, -1, -1, -1, -1, -1, -1};
74
});
75
76
static_assert
(
sizeof
(RCommonAttr) == 0x40);
77
78
NNL_PACK
(
struct
RVagParam {
79
u32
offset = -1;
80
u32
sample_rate = -1;
81
u32
size = -1;
82
u32
reserved = -1;
83
});
84
85
static_assert
(
sizeof
(RVagParam) == 0x10);
86
88
}
// namespace raw
89
}
// namespace phd
90
91
}
// namespace nnl
data.hpp
Provides functions and classes for handling binary data.
fixed_type.hpp
Contains macros and definitions for fixed-width types.
nnl::utl::data::FourCC
constexpr u32 FourCC(const char(&str)[5]) noexcept
Generates a numeric four character code from a given string.
Definition
data.hpp:36
nnl::i32
std::int32_t i32
32-bit signed integer
Definition
fixed_type.hpp:61
nnl::u32
std::uint32_t u32
32-bit unsigned integer
Definition
fixed_type.hpp:60
NNL_PACK
#define NNL_PACK(...)
A structure packing directive.
Definition
fixed_type.hpp:41
nnl::BufferView
Reader implementation for read-only memory buffers.
Definition
io.hpp:598
nnl::Reader
Abstract class for reading data.
Definition
io.hpp:78
nnl::phd::IsOfType
bool IsOfType(BufferView buffer)
Tests if the provided file is a PHD header.
nnl::phd::raw::kMagicBytes
constexpr u32 kMagicBytes
Magic bytes.
Definition
phd.hpp:62
io.hpp
Provides classes for reading and writing binary data to and from various sources.
nnl::phd
Contains a few functions and structures for working with PHD files from PHD/PBD sound banks,...
Definition
phd.hpp:29
nnl
Definition
exception.hpp:56
include
NNL
game_asset
audio
phd.hpp
Generated by
1.14.0