Debian Codegraph @

swig/track.swg

raw
1 /* -*- c -*-
2 Copyright (C) 2006, 2008, 2011 Rocky Bernstein <[email protected]>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 /* See <cdio/track.h> For more extensive documentation */
19 %constant long int TRACK_FORMAT_AUDIO = TRACK_FORMAT_AUDIO;
20 %constant long int TRACK_FORMAT_CDI = TRACK_FORMAT_CDI;
21 %constant long int TRACK_FORMAT_XA = TRACK_FORMAT_XA;
22 %constant long int TRACK_FORMAT_DATA = TRACK_FORMAT_DATA;
23 %constant long int TRACK_FORMAT_PSX = TRACK_FORMAT_PSX;
24
25 %constant long int CDIO_TRACK_FLAG_FALSE = CDIO_TRACK_FLAG_FALSE;
26 %constant long int CDIO_TRACK_FLAG_TRUE = CDIO_TRACK_FLAG_TRUE;
27 %constant long int CDIO_TRACK_FLAG_ERROR = CDIO_TRACK_FLAG_ERROR;
28 %constant long int CDIO_TRACK_FLAG_UNKNOWN = CDIO_TRACK_FLAG_UNKNOWN;
29
30 %constant long int CDIO_CDROM_LBA = CDIO_CDROM_LBA;
31 %constant long int CDIO_CDROM_MSF = CDIO_CDROM_MSF;
32 %constant long int CDIO_CDROM_DATA_TRACK = CDIO_CDROM_DATA_TRACK;
33 %constant long int CDIO_CDROM_CDI_TRACK = CDIO_CDROM_CDI_TRACK;
34 %constant long int CDIO_CDROM_XA_TRACK = CDIO_CDROM_XA_TRACK;
35
36 %constant long int AUDIO = AUDIO;
37 %constant long int MODE1 = MODE1;
38 %constant long int MODE1_RAW = MODE1_RAW;
39 %constant long int MODE2 = MODE2;
40 %constant long int MODE2_FORM1 = MODE2_FORM1;
41 %constant long int MODE2_FORM2 = MODE2_FORM2;
42 %constant long int MODE2_FORM_MIX = MODE2_FORM_MIX;
43 %constant long int MODE2_RAW = MODE2_RAW;
44
45 %constant long int INVALID_TRACK = CDIO_INVALID_TRACK;
46 %constant long int CDROM_LEADOUT_TRACK = 0xAA;
47
48 typedef int track_flag_t;
49
50 %rename cdio_get_first_track_num get_first_track_num;
51 %feature("autodoc",
52 "get_first_track_num(p_cdio) -> int
53 Get the number of the first track.
54
55 return the track number or $perlcdio.INVALID_TRACK if there was
56 a problem.");
57 track_t cdio_get_first_track_num(const CdIo_t *p_cdio);
58
59 %rename cdio_get_last_track_num get_last_track_num ;
60 %feature("autodoc",
61 "get_last_track_num
62 Return the last track number.
63 $perlcdio.INVALID_TRACK is if there was a problem.");
64 track_t cdio_get_last_track_num (const CdIo_t *p_cdio);
65
66 %rename cdio_get_track get_track;
67 %feature("autodoc",
68 "cdio_get_track(lsn)->int
69
70 Find the track which contains lsn.
71 $perlcdio.INVALID_TRACK is returned if the lsn outside of the CD or
72 if there was some error.
73
74 If the lsn is before the pregap of the first track, 0 is returned.
75 Otherwise we return the track that spans the lsn.");
76 track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn);
77
78 %rename cdio_get_track_channels get_track_channels;
79 %feature("autodoc",
80 "get_track_channels(cdio, track)->int
81
82 Return number of channels in track: 2 or 4; -2 if implemented or -1
83 for error. Not meaningful if track is not an audio track.");
84 int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track);
85
86 %rename cdio_get_track_copy_permit get_track_copy_permit;
87 %feature("autodoc",
88 "get_copy_permit(cdio, track)->int
89
90 Return copy protection status on a track. Is this meaningful
91 not an audio track?
92 ");
93 track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio,
94 track_t i_track);
95
96 %feature("autodoc",
97 "get_track_format(cdio, track)->format
98
99 Get the format (audio, mode2, mode1) of track. ");
100 const char *get_track_format(const CdIo_t *p_cdio, track_t i_track);
101
102 %rename cdio_get_track_green is_track_green;
103 %feature("autodoc",
104 "is_track_green(cdio, track) -> bool
105
106 Return True if we have XA data (green, mode2 form1) or
107 XA data (green, mode2 form2). That is track begins:
108 sync - header - subheader
109 12 4 - 8
110
111 FIXME: there's gotta be a better design for this and get_track_format?");
112 bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track);
113
114 %rename cdio_get_track_last_lsn get_track_last_lsn;
115 %feature("autodoc",
116 "cdio_get_track_last_lsn(cdio, track)->lsn
117
118 Return the ending LSN for track number
119 track in cdio. CDIO_INVALID_LSN is returned on error.");
120 lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t i_track);
121
122 %rename cdio_get_track_lba get_track_lba;
123 %feature("autodoc",
124 "cdio_get_track_lba
125 Get the starting LBA for track number
126 i_track in p_cdio. Track numbers usually start at something
127 greater than 0, usually 1.
128
129 The 'leadout' track is specified either by setting i_track
130 to $perl::CDIO_CDROM_LEADOUT_TRACK or one more than the
131 number of tracks.
132
133 @param p_cdio object to get information from
134 @param i_track the track number we want the LSN for
135 @return the starting LBA or CDIO_INVALID_LBA on error.");
136 lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track);
137
138 %rename cdio_get_track_lsn get_track_lsn;
139 %feature("autodoc",
140 "cdio_get_track_lsn (cdio, track)->int
141
142 Return the starting LSN for track number.
143 Track numbers usually start at something greater than 0, usually 1.
144
145 The 'leadout' track is specified either by
146 using i_track CDROM_LEADOUT_TRACK or the total tracks+1.
147
148 $perlcdio::INVALID_LSN is returned on error.");
149 lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track);
150
151 %feature("autodoc",
152 "get_track_msf(cdio,track)->string
153
154 Return the starting MSF (minutes/secs/frames) for track number
155 track. Track numbers usually start at something
156 greater than 0, usually 1.
157
158 The 'leadout' track is specified either by
159 using i_track $perlcdio::CDROM_LEADOUT_TRACK or the total tracks+1.
160
161 @return string mm:ss:ff if all good, or string 'error' on error.");
162 const char *get_track_msf(const CdIo_t *p_cdio, track_t i_track);
163 %inline %{
164 const char *get_track_msf(const CdIo_t *p_cdio, track_t i_track)
165 {
166 msf_t msf;
167 char *psz_msf;
168
169 if (!cdio_get_track_msf( p_cdio, i_track, &msf )) {
170 return "error";
171 }
172 psz_msf = cdio_msf_to_str( &msf );
173 return psz_msf;
174 }
175 %}
176
177 %rename cdio_get_track_preemphasis get_track_preemphasis;
178 %feature("autodoc",
179 "cdio_get_track_preemphasis(cdio, track)
180
181 Get linear preemphasis status on an audio track.
182 This is not meaningful if not an audio track?
183 ");
184 track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio, track_t i_track);
185
186 %rename cdio_get_track_sec_count get_track_sec_count;
187 %feature("autodoc",
188 "get_track_sec_count(cdio, track)->int
189
190 Get the number of sectors between this track an the next. This
191 includes any pregap sectors before the start of the next track.
192 Track numbers usually start at something
193 greater than 0, usually 1.
194
195 0 is returned if there is an error.");
196 unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track);
197
198 %inline %{
199 const char
200 *get_track_format(const CdIo_t *p_cdio, track_t i_track)
201 {
202 track_format_t track_format = cdio_get_track_format(p_cdio, i_track);
203 return track_format2str[track_format];
204 }
205 %}
206
207 char * cdio_get_track_isrc(const CdIo_t *p_cdio, track_t i_track);
208