File: disc.h

package info (click to toggle)
libcdio 2.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,140 kB
  • sloc: ansic: 39,407; cpp: 2,556; sh: 1,263; makefile: 826; yacc: 324; ruby: 116; perl: 34
file content (145 lines) | stat: -rw-r--r-- 4,763 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* -*- c -*-

    Copyright (C) 2018 Thomas Schmitt
    Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014
    Rocky Bernstein <rocky@gnu.org>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
   \file disc.h
   \brief  The top-level header for disc-related libcdio calls.
 */
#ifndef CDIO_DISC_H_
#define CDIO_DISC_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

    /**
       disc modes. The first combined from MMC-5 6.33.3.13 (Send
       CUESHEET), "DVD Book" from MMC-5 Table 400, page 419.  and
       GNU/Linux /usr/include/linux/cdrom.h and we've added DVD.
    */
  typedef enum {
    CDIO_DISC_MODE_CD_DA,           /**< CD-DA */
    CDIO_DISC_MODE_CD_DATA,         /**< CD-ROM form 1 */
    CDIO_DISC_MODE_CD_XA,           /**< CD-ROM XA form2 */
    CDIO_DISC_MODE_CD_MIXED,        /**< Some combo of above. */
    CDIO_DISC_MODE_DVD_ROM,         /**< DVD ROM (e.g. movies) */
    CDIO_DISC_MODE_DVD_RAM,         /**< DVD-RAM */
    CDIO_DISC_MODE_DVD_R,           /**< DVD-R */
    CDIO_DISC_MODE_DVD_RW,          /**< DVD-RW */
    CDIO_DISC_MODE_HD_DVD_ROM,      /**< HD DVD-ROM */
    CDIO_DISC_MODE_HD_DVD_RAM,      /**< HD DVD-RAM */
    CDIO_DISC_MODE_HD_DVD_R,        /**< HD DVD-R */
    CDIO_DISC_MODE_DVD_PR,          /**< DVD+R */
    CDIO_DISC_MODE_DVD_PRW,         /**< DVD+RW */
    CDIO_DISC_MODE_DVD_PRW_DL,      /**< DVD+RW DL */
    CDIO_DISC_MODE_DVD_PR_DL,       /**< DVD+R DL */
    CDIO_DISC_MODE_DVD_OTHER,       /**< Unknown/unclassified DVD type */
    CDIO_DISC_MODE_NO_INFO,
    CDIO_DISC_MODE_ERROR,
    CDIO_DISC_MODE_CD_I         /**< CD-i. */
  } discmode_t;

  extern const char *discmode2str[];

  /**
    Read cdtext information for a cdtext_t object.
    About format and usage of these data see the documentation of call
    mmc_read_cdtext() in include file <cdio/mmc.h>.


    @param p_cdio the CD object that may contain CD-Text information.
    @return malloc'd pointer to raw CD-Text data as replied by the drive
            or NULL if problems occur or CD-Text information does not exist.
            A non-NULL return value must be freed with cdio_free() when done.
  */
  uint8_t * cdio_get_cdtext_raw (CdIo_t *p_cdio);

  /**
    Return a pointer to the cdtext_t object which is attached to a CdIo_t
    object. If no such cdtext_t is attached yet, then try to read CD-TEXT
    information and use it to create and initialise the cdtext_t object.

    For usage of cdtext_t see include file <cdio/cdtext.h>.

    @param p_cdio the CD object that may contain CD-Text information.
    @return a pointer to the attached cdtext_t object or NULL if problems
            occur or if CD-Text information does not exist.
  */
  cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio);

  /**
    Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc.
    that we've got. The notion of "CD" is extended a little to include
    DVD's.
  */
  discmode_t cdio_get_discmode (CdIo_t *p_cdio);

  /**
    Get the lsn of the end of the CD

    @return the lsn. On error 0 or CDIO_INVALD_LSN.
  */
  lsn_t cdio_get_disc_last_lsn(const CdIo_t *p_cdio);

  /**
    Return the Joliet level recognized for p_cdio.
  */
  uint8_t cdio_get_joliet_level(const CdIo_t *p_cdio);

  /**
    Get the media catalog number (MCN) from the CD.

    @return the media catalog number or NULL if there is none or we
    don't have the ability to get it.

    Note: The caller must free the returned string with cdio_free()
    when done with it.

  */
  char * cdio_get_mcn (const CdIo_t *p_cdio);

  /**
    Get the number of tracks on the CD.

    @return the number of tracks, or CDIO_INVALID_TRACK if there is
    an error.
  */
  track_t cdio_get_num_tracks (const CdIo_t *p_cdio);

  /**
    Return true if discmode is some sort of CD.
  */
  bool cdio_is_discmode_cdrom (discmode_t discmode);

  /**
    Return true if discmode is some sort of DVD.
  */
  bool cdio_is_discmode_dvd (discmode_t discmode);

  /**
      cdio_stat_size is deprecated. @see cdio_get_disc_last_lsn
  */
#define cdio_stat_size cdio_get_disc_last_lsn

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* CDIO_DISC_H_ */