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.

190 lines
4.8 KiB

15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
  1. /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
  2. Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
  3. Provided under GPL version 2 or later.
  4. */
  5. #ifndef BURN__STRUCTURE_H
  6. #define BURN__STRUCTURE_H
  7. struct isrc
  8. {
  9. int has_isrc;
  10. char country[2]; /* each must be 0-9, A-Z */
  11. char owner[3]; /* each must be 0-9, A-Z */
  12. unsigned char year; /* must be 0-99 */
  13. unsigned int serial; /* must be 0-99999 */
  14. };
  15. /* ts B11206 */
  16. #define Libburn_pack_type_basE 0x80
  17. #define Libburn_pack_num_typeS 0x10
  18. #define Libburn_pack_type_nameS \
  19. "TITLE", "PERFORMER", "SONGWRITER", "COMPOSER", \
  20. "ARRANGER", "MESSAGE", "DISCID", "GENRE", \
  21. "TOC", "TOC2", "", "", \
  22. "", "CLOSED", "UPC_ISRC", "BLOCKSIZE"
  23. struct burn_cdtext
  24. {
  25. unsigned char *(payload[Libburn_pack_num_typeS]);
  26. int length[Libburn_pack_num_typeS];
  27. int flags; /* bit0 - bit15= double byte characters */
  28. };
  29. struct burn_track
  30. {
  31. int refcnt;
  32. struct burn_toc_entry *entry;
  33. unsigned char indices;
  34. /* lba address of the index. CD only. 0x7fffffff means undefined index.
  35. To be programmed relative to track source start before burning,
  36. but to hold absolute addresses after burning or reading.
  37. */
  38. int index[100];
  39. /** number of 0 bytes to write before data */
  40. int offset;
  41. /** how much offset has been used */
  42. int offsetcount;
  43. /** Number of zeros to write after data */
  44. int tail;
  45. /** how much tail has been used */
  46. int tailcount;
  47. /** 1 means Pad with zeros, 0 means start reading the next track */
  48. int pad;
  49. /* ts A70213 : whether to expand this track to full available media */
  50. int fill_up_media;
  51. /* ts A70218 : a track size to use if it is mandarory to have some */
  52. off_t default_size;
  53. /** Data source */
  54. struct burn_source *source;
  55. /** End of Source flag */
  56. int eos;
  57. /* ts A61101 */
  58. off_t sourcecount;
  59. off_t writecount;
  60. off_t written_sectors;
  61. /* ts A61031 */
  62. /** Source is of undefined length */
  63. int open_ended;
  64. /** End of open ended track flag : offset+payload+tail are delivered */
  65. int track_data_done;
  66. /* ts B10103 */
  67. /** End track writing on premature End-of-input if source is of
  68. defined length.
  69. 0= normal operation in case of eoi
  70. 1= be ready to end track writing on eoi
  71. 2= eoi was encountered with previously set value of 1
  72. */
  73. int end_on_premature_eoi;
  74. /** The audio/data mode for the entry. Derived from control and
  75. possibly from reading the track's first sector. */
  76. int mode;
  77. /** The track contains interval one of a pregap */
  78. int pregap1;
  79. /** The track contains interval two of a pregap */
  80. int pregap2;
  81. /* ts B20110 */
  82. /** The number of sectors in pre-gap 2, if .pregap2 is set */
  83. int pregap2_size;
  84. /** The track contains a postgap */
  85. int postgap;
  86. /* ts B20111 */
  87. /** The number of sectors in post-gap, if .postgap is set */
  88. int postgap_size;
  89. struct isrc isrc;
  90. /* ts A61024 */
  91. /** Byte swapping on source data stream : 0=none , 1=pairwise */
  92. int swap_source_bytes;
  93. /* ts A90910 : conversions from CD XA prepared input */
  94. int cdxa_conversion; /* 0=none, 1=remove -xa1 headers (first 8 bytes)*/
  95. /* ts B11206 */
  96. struct burn_cdtext *cdtext[8];
  97. };
  98. struct burn_session
  99. {
  100. unsigned char firsttrack;
  101. unsigned char lasttrack;
  102. int hidefirst;
  103. unsigned char start_m;
  104. unsigned char start_s;
  105. unsigned char start_f;
  106. struct burn_toc_entry *leadout_entry;
  107. int tracks;
  108. struct burn_track **track;
  109. int refcnt;
  110. /* ts B11206 */
  111. struct burn_cdtext *cdtext[8];
  112. unsigned char cdtext_char_code[8];
  113. unsigned char cdtext_copyright[8];
  114. unsigned char cdtext_language[8];
  115. /* ts B11226 */
  116. unsigned char mediacatalog[14]; /* overridable by burn_write_opts */
  117. };
  118. struct burn_disc
  119. {
  120. int sessions;
  121. struct burn_session **session;
  122. #ifdef Libburn_disc_with_incomplete_sessioN
  123. int incomplete_sessions;
  124. #endif
  125. int refcnt;
  126. };
  127. int burn_track_get_shortage(struct burn_track *t);
  128. /* ts A61031 : might go to libburn.h */
  129. int burn_track_is_open_ended(struct burn_track *t);
  130. int burn_track_is_data_done(struct burn_track *t);
  131. /* ts A70125 : sets overall sectors of a track: offset+payload+padding */
  132. int burn_track_set_sectors(struct burn_track *t, int sectors);
  133. /* ts A70218 : sets the payload size alone */
  134. int burn_track_set_size(struct burn_track *t, off_t size);
  135. /* ts A70213 */
  136. int burn_track_set_fillup(struct burn_track *t, int fill_up_media);
  137. int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag);
  138. /* ts A70218 */
  139. off_t burn_track_get_default_size(struct burn_track *t);
  140. /* ts A80808 : Enhance CD toc to DVD toc */
  141. int burn_disc_cd_toc_extensions(struct burn_drive *drive, int flag);
  142. /* ts B11206 */
  143. struct burn_cdtext *burn_cdtext_create(void);
  144. void burn_cdtext_free(struct burn_cdtext **cdtext);
  145. /* ts B20119 */
  146. /* @param flag bit0= do not add post-gap
  147. */
  148. int burn_track_get_sectors_2(struct burn_track *t, int flag);
  149. #endif /* BURN__STRUCTURE_H */