aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsapev2/header.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nsapev2/header.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/nsapev2/header.h')
-rw-r--r--Src/replicant/nsapev2/header.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/Src/replicant/nsapev2/header.h b/Src/replicant/nsapev2/header.h
new file mode 100644
index 00000000..462722e1
--- /dev/null
+++ b/Src/replicant/nsapev2/header.h
@@ -0,0 +1,39 @@
+#pragma once
+#include "foundation/types.h"
+#include "nu/ByteWriter.h"
+class nstest;
+
+namespace APEv2
+{
+ class Header
+ {
+ friend class ::nstest;
+ public:
+ Header();
+ Header(const void *data);
+ void SetSize(uint32_t size) { this->size = size; }
+ void SetFlags(uint32_t flags) { this->flags = flags; }
+ void SetItems(uint32_t items) { this->items = items; }
+ bool Valid() const;
+ uint32_t TagSize() const;
+ bool HasHeader() const;
+ bool HasFooter() const;
+ bool IsFooter() const;
+ bool IsHeader() const;
+ int Encode(bytewriter_t byte_writer) const;
+ uint32_t GetFlags() const;
+ enum
+ {
+ SIZE=32,
+ };
+ private:
+ uint8_t preamble[8];
+ uint32_t version;
+ uint32_t size;
+ uint32_t items;
+ uint32_t flags;
+ uint64_t reserved;
+ };
+}
+
+