From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Plugins/Input/in_mp3/ID3v2.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Src/Plugins/Input/in_mp3/ID3v2.h (limited to 'Src/Plugins/Input/in_mp3/ID3v2.h') diff --git a/Src/Plugins/Input/in_mp3/ID3v2.h b/Src/Plugins/Input/in_mp3/ID3v2.h new file mode 100644 index 00000000..f7f21f0e --- /dev/null +++ b/Src/Plugins/Input/in_mp3/ID3v2.h @@ -0,0 +1,33 @@ +#ifndef NULLSOFT_IN_MP3_ID3v2_H +#define NULLSOFT_IN_MP3_ID3v2_H + +#include "../id3v2/id3_tag.h" + +class ID3v2 +{ +public: + ID3v2(); + bool HasData() { return hasData; } + bool IsDirty() { return dirty; } + int Decode(const void *data, size_t len); + int Encode(const void *data, size_t len); + uint32_t EncodeSize(); + // return -1 for empty, 1 for OK, 0 for "don't understand tag name" + int GetString(const char *tag, wchar_t *data, int dataLen); + int SetString(const char *tag, const wchar_t *data); + + int GetAlbumArt(const wchar_t *type, void **bits, size_t *len, wchar_t **mimeType); + int SetAlbumArt(const wchar_t *type, void *bits, size_t len, const wchar_t *mimeType); + int DeleteAlbumArt(const wchar_t *type); + + void Clear(); +private: + void add_set_id3v2_frame(ID3_FrameID id, const wchar_t *c); + void add_set_latin_id3v2_frame(ID3_FrameID id, const wchar_t *c); + bool hasData; + bool dirty; +public: + ID3_Tag id3v2; +}; + +#endif \ No newline at end of file -- cgit