1
0

id3_header_frame.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // The authors have released ID3Lib as Public Domain (PD) and claim no copyright,
  2. // patent or other intellectual property protection in this work. This means that
  3. // it may be modified, redistributed and used in commercial and non-commercial
  4. // software and hardware without restrictions. ID3Lib is distributed on an "AS IS"
  5. // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
  6. //
  7. // The ID3Lib authors encourage improvements and optimisations to be sent to the
  8. // ID3Lib coordinator, currently Dirk Mahoney ([email protected]). Approved
  9. // submissions may be altered, and will be included and released under these terms.
  10. //
  11. // Mon Nov 23 18:34:01 1998
  12. #ifndef ID3LIB_HEADER_FRAME_H
  13. #define ID3LIB_HEADER_FRAME_H
  14. #include "id3_types.h"
  15. #include "id3_header.h"
  16. #include "id3_header_tag.h"
  17. #include "id3_field.h"
  18. #define ID3FL_TAGALTER_2_3 (1 << 15)
  19. #define ID3FL_FILEALTER_2_3 (1 << 14)
  20. #define ID3FL_SIGNED_2_3 (1 << 13)
  21. #define ID3FL_COMPRESSION_2_3 (1 << 7)
  22. #define ID3FL_ENCRYPTION_2_3 (1 << 6)
  23. #define ID3FL_GROUPING_2_3 (1 << 5)
  24. #define ID3FL_TAGALTER_2_4 (1 << 14)
  25. #define ID3FL_FILEALTER_2_4 (1 << 13)
  26. #define ID3FL_SIGNED_2_4 (1 << 12)
  27. #define ID3FL_COMPRESSION_2_4 (1 << 3)
  28. #define ID3FL_ENCRYPTION_2_4 (1 << 2)
  29. #define ID3FL_GROUPING_2_4 (1 << 6)
  30. #define ID3FL_UNSYNC_2_4 (1 << 1)
  31. #define ID3FL_DATA_LENGTH_2_4 (1 << 0)
  32. struct ID3_FrameAttr
  33. {
  34. ID3_FrameAttr(void) : size(0), flags(0) { memset(&textID, 0, sizeof(textID)); }
  35. ~ID3_FrameAttr(void) {}
  36. char textID[5];
  37. luint size;
  38. public:
  39. void ClearUnSync(int version);
  40. void SetFlags(luint _flags);
  41. bool HasCompression(int version);
  42. bool HasDataLength(int version);
  43. bool HasEncryption(int version);
  44. bool HasGrouping(int version);
  45. bool HasUnsync(int version);
  46. private:
  47. luint flags;
  48. };
  49. class ID3_FrameHeader : public ID3_Header
  50. {
  51. public:
  52. virtual luint Size(void);
  53. void SetFrameID(ID3_FrameID id);
  54. luint GetFrameInfo(ID3_FrameAttr &attr, const uchar *buffer, size_t remSize);
  55. virtual luint Render(uchar *buffer);
  56. // *** PRIVATE INTERNAL DATA - DO NOT USE *** PRIVATE INTERNAL DATA - DO NOT USE ***
  57. protected:
  58. ID3_FrameID frameID; // which frame are we the header for?
  59. };
  60. #endif