id3tag.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef LAME_ID3_H
  2. #define LAME_ID3_H
  3. #define CHANGED_FLAG (1U << 0)
  4. #define ADD_V2_FLAG (1U << 1)
  5. #define V1_ONLY_FLAG (1U << 2)
  6. #define V2_ONLY_FLAG (1U << 3)
  7. #define SPACE_V1_FLAG (1U << 4)
  8. #define PAD_V2_FLAG (1U << 5)
  9. enum {
  10. MIMETYPE_NONE = 0,
  11. MIMETYPE_JPEG,
  12. MIMETYPE_PNG,
  13. MIMETYPE_GIF
  14. };
  15. typedef struct FrameDataNode {
  16. struct FrameDataNode *nxt;
  17. uint32_t fid; /* Frame Identifier */
  18. char lng[4]; /* 3-character language descriptor */
  19. struct {
  20. union {
  21. char *l; /* ptr to Latin-1 chars */
  22. unsigned short *u; /* ptr to UCS-2 text */
  23. unsigned char *b; /* ptr to raw bytes */
  24. } ptr;
  25. size_t dim;
  26. int enc; /* 0:Latin-1, 1:UCS-2, 2:RAW */
  27. } dsc , txt;
  28. } FrameDataNode;
  29. typedef struct id3tag_spec {
  30. /* private data members */
  31. unsigned int flags;
  32. int year;
  33. char *title;
  34. char *artist;
  35. char *album;
  36. char *comment;
  37. int track_id3v1;
  38. int genre_id3v1;
  39. unsigned char *albumart;
  40. unsigned int albumart_size;
  41. unsigned int padding_size;
  42. int albumart_mimetype;
  43. char language[4]; /* the language of the frame's content, according to ISO-639-2 */
  44. FrameDataNode *v2_head, *v2_tail;
  45. } id3tag_spec;
  46. /* write tag into stream at current position */
  47. extern int id3tag_write_v2(lame_global_flags * gfp);
  48. extern int id3tag_write_v1(lame_global_flags * gfp);
  49. /*
  50. * NOTE: A version 2 tag will NOT be added unless one of the text fields won't
  51. * fit in a version 1 tag (e.g. the title string is longer than 30 characters),
  52. * or the "id3tag_add_v2" or "id3tag_v2_only" functions are used.
  53. */
  54. #endif