aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsid3v2/header.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/replicant/nsid3v2/header.h')
-rw-r--r--Src/replicant/nsid3v2/header.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Src/replicant/nsid3v2/header.h b/Src/replicant/nsid3v2/header.h
new file mode 100644
index 00000000..bb009958
--- /dev/null
+++ b/Src/replicant/nsid3v2/header.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "foundation/types.h"
+
+namespace ID3v2
+{
+ class Header
+ {
+ public:
+ Header();
+ Header(uint8_t version, uint8_t revision);
+ Header(const void *data);
+ Header(const Header *copy, uint32_t new_size);
+ void Parse(const void *data);
+ int Serialize(void *data);
+ int SerializeAsHeader(void *data);
+ int SerializeAsFooter(void *data);
+ /* Does this seem like a valid ID3v2 header? */
+ bool Valid() const;
+ bool FooterValid() const;
+ /* how much space the tag occupies on disk */
+ uint32_t TagSize() const;
+ bool HasExtendedHeader() const;
+ uint8_t GetVersion() const;
+ uint8_t GetRevision() const;
+ bool Unsynchronised() const;
+ bool HasFooter() const;
+ void SetFooter(bool footer);
+ enum
+ {
+ SIZE=10,
+ };
+
+ void ClearExtendedHeader();
+ void ClearUnsynchronized();
+ private:
+
+ uint8_t marker[3];
+ uint8_t version;
+ uint8_t revision;
+ uint8_t flags;
+ uint32_t size;
+ };
+}