You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
2.1 KiB

  1. /*
  2. * cdtext.h
  3. *
  4. * Copyright (C) 2004 Svend Sorensen
  5. * For license terms, see the file COPYING in this distribution.
  6. */
  7. /* references: MMC-3 draft revsion - 10g */
  8. #ifndef CDTEXT_H
  9. #define CDTEXT_H
  10. #include <stdio.h>
  11. /* cdtext pack type indicators */
  12. enum Pti {
  13. PTI_TITLE, /* title of album or track titles */
  14. PTI_PERFORMER, /* name(s) of the performer(s) */
  15. PTI_SONGWRITER, /* name(s) of the songwriter(s) */
  16. PTI_COMPOSER, /* name(s) of the composer(s) */
  17. PTI_ARRANGER, /* name(s) of the arranger(s) */
  18. PTI_MESSAGE, /* message(s) from the content provider and/or artist */
  19. PTI_DISC_ID, /* (binary) disc identification information */
  20. PTI_GENRE, /* (binary) genre identification and genre information */
  21. PTI_TOC_INFO1, /* (binary) table of contents information */
  22. PTI_TOC_INFO2, /* (binary) second table of contents information */
  23. PTI_RESERVED1, /* reserved */
  24. PTI_RESERVED2, /* reserved */
  25. PTI_RESERVED3, /* reserved */
  26. PTI_RESERVED4, /* reserved for content provider only */
  27. PTI_UPC_ISRC, /* UPC/EAN code of the album and ISRC code of each track */
  28. PTI_SIZE_INFO, /* (binary) size information of the block */
  29. PTI_END /* terminating PTI (for stepping through PTIs) */
  30. };
  31. enum PtiFormat {
  32. FORMAT_CHAR, /* single or double byte character string */
  33. FORMAT_BINARY /* binary data */
  34. };
  35. typedef struct Cdtext Cdtext;
  36. /* return a pointer to a new Cdtext */
  37. Cdtext *cdtext_init ();
  38. /* release a Cdtext */
  39. void cdtext_delete (Cdtext *cdtext);
  40. /* returns non-zero if there are no CD-TEXT fields set, zero otherwise */
  41. int cdtext_is_empty (Cdtext *cdtext);
  42. /* set CD-TEXT field to value for PTI pti */
  43. void cdtext_set (int pti, char *value, Cdtext *cdtext);
  44. /* returns pointer to CD-TEXT value for PTI pti */
  45. char *cdtext_get (int pti, Cdtext *cdtext);
  46. /*
  47. * returns appropriate string for PTI pti
  48. * if istrack is zero, UPC/EAN string will be returned for PTI_UPC_ISRC
  49. * othwise ISRC string will be returned
  50. */
  51. const char *cdtext_get_key (int pti, int istrack);
  52. /*
  53. * dump all cdtext info
  54. * in human readable format (for debugging)
  55. */
  56. void cdtext_dump (Cdtext *cdtext, int istrack);
  57. #endif