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