Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 554 lines (438 sloc) 22.107 kb
b570d3f Start MMC interface.
rocky authored
1 /* -*- c -*-
e4b2894 Use Jerry G Geiger's Build.PL patch to get close to having this work …
R. Bernstein authored
2 Copyright (C) 2006, 2008, 2011 Rocky Bernstein <rocky@cpan.org>
b3760ac gplv3+
karl authored
3 See end for license.
b570d3f Start MMC interface.
rocky authored
4 */
5 %define DOCSTRING
6 "A Perl wrapper for The CD Input and Control library's ISO-9660 library's
7 MultiMedia Commands (MMC)."
8 %enddef
9 %module(docstring=DOCSTRING) perlmmc
10
11 /* See <cdio/mmc.h> for more extensive documentation. */
12
13 %{
14 /* Includes the header in the wrapper code */
15 #include <cdio/cdio.h>
16 #include <cdio/mmc.h>
17 %}
18
19 #include <cdio/cdio.h>
20 #include <cdio/mmc.h>
21
22 %include "types.swg"
23
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
24 typedef long int cdio_mmc_level_t;
25
b570d3f Start MMC interface.
rocky authored
26 %constant long int GPCMD_INQUIRY = CDIO_MMC_GPCMD_INQUIRY;
27 %constant long int GPCMD_MODE_SELECT_6 = CDIO_MMC_GPCMD_MODE_SELECT_6;
28 %constant long int GPCMD_MODE_SENSE_6 = CDIO_MMC_GPCMD_MODE_SENSE_6;
29 %constant long int GPCMD_START_STOP = CDIO_MMC_GPCMD_START_STOP;
30 %constant long int GPCMD_ALLOW_MEDIUM_REMOVAL =
31 CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL;
32
33 /** Group 2 Commands (CDB's here are 10-bytes) */
34
35 %constant long int CDIO_MMC_GPCMD_READ_10 = CDIO_MMC_GPCMD_READ_10;
36 %constant long int GPCMD_READ_SUBCHANNEL = CDIO_MMC_GPCMD_READ_SUBCHANNEL;
37 %constant long int GPCMD_READ_HEADER = CDIO_MMC_GPCMD_READ_HEADER;
38 %constant long int GPCMD_PLAY_AUDIO_10 = CDIO_MMC_GPCMD_PLAY_AUDIO_10;
39 %constant long int GPCMD_GET_CONFIGURATION = CDIO_MMC_GPCMD_GET_CONFIGURATION;
40 %constant long int GPCMD_PLAY_AUDIO_MSF = CDIO_MMC_GPCMD_PLAY_AUDIO_MSF;
41 %constant long int GPCMD_PLAY_AUDIO_TI = CDIO_MMC_GPCMD_PLAY_AUDIO_TI;
42 %constant long int GPCMD_PLAY_TRACK_REL_10 = CDIO_MMC_GPCMD_PLAY_TRACK_REL_10;
43 %constant long int GPCMD_GET_EVENT_STATUS = CDIO_MMC_GPCMD_GET_EVENT_STATUS;
44 %constant long int GPCMD_PAUSE_RESUME = CDIO_MMC_GPCMD_PAUSE_RESUME;
45 %constant long int GPCMD_READ_DISC_INFO = CDIO_MMC_GPCMD_READ_DISC_INFO;
46 %constant long int GPCMD_MODE_SELECT_10 = CDIO_MMC_GPCMD_MODE_SELECT_10;
47 %constant long int GPCMD_MODE_SENSE_10 = CDIO_MMC_GPCMD_MODE_SENSE_10;
48 %constant long int GPCMD_PLAY_AUDIO_12 = CDIO_MMC_GPCMD_PLAY_AUDIO_12;
49 %constant long int GPCMD_LOAD_UNLOAD = CDIO_MMC_GPCMD_LOAD_UNLOAD;
50 %constant long int GPCMD_READ_12 = CDIO_MMC_GPCMD_READ_12;
51 %constant long int GPCMD_PLAY_TRACK_REL_12 = CDIO_MMC_GPCMD_PLAY_TRACK_REL_12;
52 %constant long int GPCMD_READ_DVD_STRUCTURE= CDIO_MMC_GPCMD_READ_DVD_STRUCTURE;
53 %constant long int GPCMD_READ_MSF = CDIO_MMC_GPCMD_READ_MSF;
54 %constant long int GPCMD_SET_SPEED = CDIO_MMC_GPCMD_SET_SPEED;
55 %constant long int GPCMD_READ_CD = CDIO_MMC_GPCMD_READ_CD;
56
57 /** Vendor-unique Commands */
58 %constant long int GPCMD_CD_PLAYBACK_STATUS= CDIO_MMC_GPCMD_CD_PLAYBACK_STATUS;
59 %constant long int GPCMD_PLAYBACK_CONTROL = CDIO_MMC_GPCMD_PLAYBACK_CONTROL;
60 %constant long int GPCMD_READ_CDDA = CDIO_MMC_GPCMD_READ_CDDA;
61 %constant long int GPCMD_READ_CDXA = CDIO_MMC_GPCMD_READ_CDXA;
62 %constant long int GPCMD_READ_ALL_SUBCODES = CDIO_MMC_GPCMD_READ_ALL_SUBCODES;
63
64 /** Read Subchannel states */
65 %constant long int READ_SUB_ST_INVALID = CDIO_MMC_READ_SUB_ST_INVALID;
66 %constant long int READ_SUB_ST_PLAY = CDIO_MMC_READ_SUB_ST_PLAY;
67 %constant long int READ_SUB_ST_PAUSED = CDIO_MMC_READ_SUB_ST_PAUSED;
68 %constant long int READ_SUB_ST_COMPLETED = CDIO_MMC_READ_SUB_ST_COMPLETED;
69 %constant long int READ_SUB_ST_ERROR = CDIO_MMC_READ_SUB_ST_ERROR;
70 %constant long int READ_SUB_ST_NO_STATUS = CDIO_MMC_READ_SUB_ST_NO_STATUS;
71
72 %constant long int READ_TYPE_ANY = CDIO_MMC_READ_TYPE_ANY;
73 %constant long int READ_TYPE_CDDA = CDIO_MMC_READ_TYPE_CDDA;
74 %constant long int READ_TYPE_MODE1 = CDIO_MMC_READ_TYPE_MODE1;
75 %constant long int READ_TYPE_MODE2 = CDIO_MMC_READ_TYPE_MODE2;
76 %constant long int READ_TYPE_M2F1 = CDIO_MMC_READ_TYPE_M2F1;
77 %constant long int READ_TYPE_M2F2 = CDIO_MMC_READ_TYPE_M2F2;
78
79 /*! Format values for READ_TOC */
80 %constant long int READTOC_FMT_TOC = CDIO_MMC_READTOC_FMT_TOC;
81 %constant long int READTOC_FMT_SESSION = CDIO_MMC_READTOC_FMT_SESSION;
82 %constant long int READTOC_FMT_FULTOC = CDIO_MMC_READTOC_FMT_FULTOC;
83
84 %constant long int CDIO_MMC_READTOC_FMT_PMA= CDIO_MMC_READTOC_FMT_PMA;
85 %constant long int READTOC_FMT_PMA = CDIO_MMC_READTOC_FMT_PMA;
86 %constant long int READTOC_FMT_ATIP = CDIO_MMC_READTOC_FMT_ATIP;
87 %constant long int READTOC_FMT_CDTEXT = CDIO_MMC_READTOC_FMT_CDTEXT;
88
89 /* Page codes for MODE SENSE and MODE SET. */
90 %constant long int R_W_ERROR_PAGE = CDIO_MMC_R_W_ERROR_PAGE;
91 %constant long int WRITE_PARMS_PAGE = CDIO_MMC_WRITE_PARMS_PAGE;
92 %constant long int CDR_PARMS_PAGE = CDIO_MMC_CDR_PARMS_PAGE;
93 %constant long int AUDIO_CTL_PAGE = CDIO_MMC_AUDIO_CTL_PAGE;
94 %constant long int POWER_PAGE = CDIO_MMC_POWER_PAGE;
95 %constant long int FAULT_FAIL_PAGE = CDIO_MMC_FAULT_FAIL_PAGE;
96 %constant long int TO_PROTECT_PAGE = CDIO_MMC_TO_PROTECT_PAGE;
97 %constant long int CAPABILITIES_PAGE = CDIO_MMC_CAPABILITIES_PAGE;
98 %constant long int ALL_PAGES = CDIO_MMC_ALL_PAGES;
99
100 /* Return type codes for GET_CONFIGURATION. */
101 %constant long int GET_CONF_ALL_FEATURES = CDIO_MMC_GET_CONF_ALL_FEATURES;
102 %constant long int GET_CONF_CURRENT_FEATURES= CDIO_MMC_GET_CONF_CURRENT_FEATURES;
103 %constant long int GET_CONF_NAMED_FEATURE = CDIO_MMC_GET_CONF_NAMED_FEATURE;
104
105 /* FEATURE codes used in GET CONFIGURATION. */
106 %constant long int FEATURE_PROFILE_LIST = CDIO_MMC_FEATURE_PROFILE_LIST;
107 %constant long int FEATURE_CORE = CDIO_MMC_FEATURE_CORE;
108 %constant long int FEATURE_MORPHING = CDIO_MMC_FEATURE_MORPHING;
109 %constant long int FEATURE_REMOVABLE_MEDIUM= CDIO_MMC_FEATURE_REMOVABLE_MEDIUM;
110 %constant long int FEATURE_WRITE_PROTECT = CDIO_MMC_FEATURE_WRITE_PROTECT;
111 %constant long int FEATURE_RANDOM_READABLE = CDIO_MMC_FEATURE_RANDOM_READABLE;
112 %constant long int FEATURE_MULTI_READ = CDIO_MMC_FEATURE_MULTI_READ;
113 %constant long int FEATURE_CD_READ = CDIO_MMC_FEATURE_CD_READ;
114 %constant long int FEATURE_DVD_READ = CDIO_MMC_FEATURE_DVD_READ;
115 %constant long int FEATURE_RANDOM_WRITABLE = CDIO_MMC_FEATURE_RANDOM_WRITABLE;
116 %constant long int FEATURE_INCR_WRITE = CDIO_MMC_FEATURE_INCR_WRITE;
117 %constant long int FEATURE_SECTOR_ERASE = CDIO_MMC_FEATURE_SECTOR_ERASE;
118 %constant long int FEATURE_FORMATABLE = CDIO_MMC_FEATURE_FORMATABLE;
119 %constant long int FEATURE_DEFECT_MGMT = CDIO_MMC_FEATURE_DEFECT_MGMT;
120 %constant long int FEATURE_WRITE_ONCE = CDIO_MMC_FEATURE_WRITE_ONCE;
121 %constant long int FEATURE_RESTRICT_OVERW = CDIO_MMC_FEATURE_RESTRICT_OVERW;
122 %constant long int FEATURE_CD_RW_CAV = CDIO_MMC_FEATURE_CD_RW_CAV;
123 %constant long int FEATURE_MRW = CDIO_MMC_FEATURE_MRW;
124 %constant long int FEATURE_ENHANCED_DEFECT = CDIO_MMC_FEATURE_ENHANCED_DEFECT;
125 %constant long int FEATURE_DVD_PRW = CDIO_MMC_FEATURE_DVD_PRW;
126 %constant long int FEATURE_DVD_PR = CDIO_MMC_FEATURE_DVD_PR;
127 %constant long int FEATURE_RIGID_RES_OVERW = CDIO_MMC_FEATURE_RIGID_RES_OVERW;
128 %constant long int FEATURE_CD_TAO = CDIO_MMC_FEATURE_CD_TAO;
129 %constant long int FEATURE_CD_SAO = CDIO_MMC_FEATURE_CD_SAO;
130 %constant long int FEATURE_DVD_R_RW_WRITE = CDIO_MMC_FEATURE_DVD_R_RW_WRITE;
131 %constant long int FEATURE_CD_RW_MEDIA_WRITE= CDIO_MMC_FEATURE_CD_RW_MEDIA_WRITE;
132 %constant long int FEATURE_DVD_PR_2_LAYER = CDIO_MMC_FEATURE_DVD_PR_2_LAYER;
133 %constant long int FEATURE_POWER_MGMT = CDIO_MMC_FEATURE_POWER_MGMT;
134 %constant long int FEATURE_CDDA_EXT_PLAY = CDIO_MMC_FEATURE_CDDA_EXT_PLAY;
135 %constant long int FEATURE_MCODE_UPGRADE = CDIO_MMC_FEATURE_MCODE_UPGRADE;
136 %constant long int FEATURE_TIME_OUT = CDIO_MMC_FEATURE_TIME_OUT;
137 %constant long int FEATURE_DVD_CSS = CDIO_MMC_FEATURE_DVD_CSS;
138 %constant long int FEATURE_RT_STREAMING = CDIO_MMC_FEATURE_RT_STREAMING;
139 %constant long int FEATURE_LU_SN = CDIO_MMC_FEATURE_LU_SN;
140 %constant long int FEATURE_FIRMWARE_DATE = CDIO_MMC_FEATURE_FIRMWARE_DATE;
141 /* Profile profile codes used in GET_CONFIGURATION - PROFILE LIST. */
142
143 %constant long int FEATURE_PROF_NON_REMOVABLE = CDIO_MMC_FEATURE_PROF_NON_REMOVABLE;
144 %constant long int FEATURE_PROF_REMOVABLE = CDIO_MMC_FEATURE_PROF_REMOVABLE;
145 %constant long int FEATURE_PROF_MO_ERASABLE= CDIO_MMC_FEATURE_PROF_MO_ERASABLE;
146 %constant long int FEATURE_PROF_MO_WRITE_ONCE= CDIO_MMC_FEATURE_PROF_MO_WRITE_ONCE;
147
148 %constant long int FEATURE_PROF_AS_MO = CDIO_MMC_FEATURE_PROF_AS_MO;
149 %constant long int FEATURE_PROF_CD_ROM = CDIO_MMC_FEATURE_PROF_CD_ROM;
150 %constant long int FEATURE_PROF_CD_R = CDIO_MMC_FEATURE_PROF_CD_R;
151 %constant long int FEATURE_PROF_CD_RW = CDIO_MMC_FEATURE_PROF_CD_RW;
152 %constant long int FEATURE_PROF_DVD_ROM = CDIO_MMC_FEATURE_PROF_DVD_ROM;
153 %constant long int FEATURE_PROF_DVD_R_SEQ = CDIO_MMC_FEATURE_PROF_DVD_R_SEQ;
154 %constant long int FEATURE_PROF_DVD_RAM = CDIO_MMC_FEATURE_PROF_DVD_RAM;
155 %constant long int FEATURE_PROF_DVD_RW_RO = CDIO_MMC_FEATURE_PROF_DVD_RW_RO;
156 %constant long int FEATURE_PROF_DVD_RW_SEQ = CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ;
157 %constant long int FEATURE_PROF_DVD_PRW = CDIO_MMC_FEATURE_PROF_DVD_PRW;
158 %constant long int FEATURE_PROF_DVD_PR = CDIO_MMC_FEATURE_PROF_DVD_PR;
159 %constant long int FEATURE_PROF_DDCD_ROM = CDIO_MMC_FEATURE_PROF_DDCD_ROM;
160 %constant long int FEATURE_PROF_DDCD_R = CDIO_MMC_FEATURE_PROF_DDCD_R;
161 %constant long int FEATURE_PROF_DDCD_RW = CDIO_MMC_FEATURE_PROF_DDCD_RW;
e7eebf9 More fixes and completion of code from Jerry G Geiger.
R. Bernstein authored
162 %constant long int FEATURE_PROF_DVD_PR = CDIO_MMC_FEATURE_PROF_DVD_PR;
b570d3f Start MMC interface.
rocky authored
163 %constant long int FEATURE_PROF_NON_CONFORM= CDIO_MMC_FEATURE_PROF_NON_CONFORM;
164 %constant long int FEATURE_INTERFACE_UNSPECIFIED = CDIO_MMC_FEATURE_INTERFACE_UNSPECIFIED;
165 %constant long int FEATURE_INTERFACE_SCSI = CDIO_MMC_FEATURE_INTERFACE_SCSI;
166 %constant long int FEATURE_INTERFACE_ATAPI = CDIO_MMC_FEATURE_INTERFACE_ATAPI;
167 %constant long int FEATURE_INTERFACE_IEEE_1394= CDIO_MMC_FEATURE_INTERFACE_IEEE_1394;
168 %constant long int FEATURE_INTERFACE_IEEE_1394A= CDIO_MMC_FEATURE_INTERFACE_IEEE_1394A;
169 %constant long int FEATURE_INTERFACE_FIBRE_CH= CDIO_MMC_FEATURE_INTERFACE_FIBRE_CH;
170
171
172 %feature("autodoc",
173 "Read Audio Subchannel information
174
175 param p_cdio the CD object to be acted upon.
176 param p_subchannel place for returned subchannel information
177 .");
178 %rename mmc_audio_read_subchannel audio_read_subchannel;
179
180 %feature("autodoc",
181 "Return a string containing the name of the audio state as returned from
182 the Q_SUBCHANNEL.
183 ");
184 %rename mmc_audio_state2str audio_state2str;
185
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
186 /*!
187 Eject using MMC commands. If CD-ROM is "locked" we'll unlock it.
188 Command is not "immediate" -- we'll wait for the command to complete.
189 For a more general (and lower-level) routine, @see mmc_start_stop_media.
190 */
e7eebf9 More fixes and completion of code from Jerry G Geiger.
R. Bernstein authored
191 //%rename mmc_eject_media eject_media;
192 int mmc_eject_media(const CdIo_t *p_cdio);
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
193 /*!
194 Return a string containing the name of the given feature
195 */
b570d3f Start MMC interface.
rocky authored
196 %rename mmc_feature2str feature2str;
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
197
198 /*!
199 Return a string containing the name of the given feature
200 */
201 %rename mmc_feature_profile2str feature_profile2str;
202
203 /*!
204 Return the length in bytes of the Command Descriptor
205 Buffer (CDB) for a given MMC command. The length will be
206 either 6, 10, or 12.
207 */
b570d3f Start MMC interface.
rocky authored
208 %rename mmc_get_cmd_len get_cmd_len;
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
209
210 /*!
211 Get the block size used in read requests, via MMC.
212 @return the blocksize if > 0; error if <= 0
213 */
b570d3f Start MMC interface.
rocky authored
214 %rename mmc_get_blocksize get_blocksize;
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
215
216 /*!
217 Get the lsn of the end of the CD
218
219 @return the lsn. On error return CDIO_INVALID_LSN.
220 */
b570d3f Start MMC interface.
rocky authored
221 %rename mmc_get_disc_last_lsn get_lsn;
222
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
223 /*!
224 Return the discmode as reported by the MMC Read (FULL) TOC
225 command.
226
227 Information was obtained from Section 5.1.13 (Read TOC/PMA/ATIP)
228 pages 56-62 from the MMC draft specification, revision 10a
229 at http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf See
230 especially tables 72, 73 and 75.
231 */
232 %rename mmc_get_discmode get_discmode;
233
234 /*!
235 Get drive capabilities for a device.
236 @return the drive capabilities.
237 */
238 %rename mmc_get_drive_cap get_drive_cap;
239
240 /*!
241 Get the MMC level supported by the device.
242 */
243 %rename mmc_get_drive_mmc_cap get_drive_mmc_cap;
244
245 /*!
246 Get the DVD type associated with cd object.
247
248 @return the DVD discmode.
249 */
250 %rename mmc_get_dvd_struct_physical get_dvd_struct_physical;
251
252 /*!
253 Get the CD-ROM hardware info via an MMC INQUIRY command.
254
255 @return true if we were able to get hardware info, false if we had
256 an error.
257 */
258 %rename mmc_get_hwinfo get_hwinfo;
259
260 /*!
261 Find out if media has changed since the last call.
262 @param p_cdio the CD object to be acted upon.
263 @return 1 if media has changed since last call, 0 if not. Error
264 return codes are the same as driver_return_code_t
265 */
266 %rename mmc_get_media_changed get_media_changed;
267
268 /*!
269 Get the media catalog number (MCN) from the CD via MMC.
270
271 @return the media catalog number r NULL if there is none or we
272 don't have the ability to get it.
273
274 Note: string is malloc'd so caller has to free() the returned
275 string when done with it.
276
277 */
278 %rename mmc_get_mcn get_mcn;
279
280 /** Get the output port volumes and port selections used on AUDIO PLAY
281 commands via a MMC MODE SENSE command using the CD Audio Control
282 Page.
283 */
284 %rename mmc_audio_get_volume audio_get_volume;
285
286 /*!
287 Report if CD-ROM has a praticular kind of interface (ATAPI, SCSCI, ...)
288 Is it possible for an interface to have serveral? If not this
289 routine could probably return the single mmc_feature_interface_t.
290 @return true if we have the interface and false if not.
291 */
292 %rename mmc_have_interface have_interface;
293
294 /*! Run a MODE_SENSE command (6- or 10-byte version)
295 and put the results in p_buf
296 @return DRIVER_OP_SUCCESS if we ran the command ok.
297 */
298 %rename mmc_mode_sense mode_sense;
299
300 /*! Run a MODE_SENSE command (10-byte version)
301 and put the results in p_buf
302 @return DRIVER_OP_SUCCESS if we ran the command ok.
303 */
304 %rename mmc_mode_sense_10 mode_sense_10;
305
306 /*! Run a MODE_SENSE command (6-byte version)
307 and put the results in p_buf
308 @return DRIVER_OP_SUCCESS if we ran the command ok.
309 */
310 %rename mmc_mode_sense_6 mode_sense_6;
311
312 /*! Issue a MMC READ_CD command.
313
314 @param p_cdio object to read from
315
316 @param p_buf Place to store data. The caller should ensure that
317 p_buf can hold at least i_blocksize * i_blocks bytes.
318
319 @param i_lsn sector to read
320
321 @param expected_sector_type restricts reading to a specific CD
322 sector type. Only 3 bits with values 1-5 are used:
323 0 all sector types
324 1 CD-DA sectors only
325 2 Mode 1 sectors only
326 3 Mode 2 formless sectors only. Note in contrast to all other
327 values an MMC CD-ROM is not required to support this mode.
328 4 Mode 2 Form 1 sectors only
329 5 Mode 2 Form 2 sectors only
330
331 @param b_digital_audio_play Control error concealment when the
332 data being read is CD-DA. If the data being read is not CD-DA,
333 this parameter is ignored. If the data being read is CD-DA and
334 DAP is false zero, then the user data returned should not be
335 modified by flaw obscuring mechanisms such as audio data mute and
336 interpolate. If the data being read is CD-DA and DAP is true,
337 then the user data returned should be modified by flaw obscuring
338 mechanisms such as audio data mute and interpolate.
339
340 b_sync_header return the sync header (which will probably have
341 the same value as CDIO_SECTOR_SYNC_HEADER of size
342 CDIO_CD_SYNC_SIZE).
343
344 @param header_codes Header Codes refer to the sector header and
345 the sub-header that is present in mode 2 formed sectors:
346
347 0 No header information is returned.
348 1 The 4-byte sector header of data sectors is be returned,
349 2 The 8-byte sector sub-header of mode 2 formed sectors is
350 returned.
351 3 Both sector header and sub-header (12 bytes) is returned.
352 The Header preceeds the rest of the bytes (e.g. user-data bytes)
353 that might get returned.
354
355 @param b_user_data Return user data if true.
356
357 For CD-DA, the User Data is CDIO_CD_FRAMESIZE_RAW bytes.
358
359 For Mode 1, The User Data is ISO_BLOCKSIZE bytes beginning at
360 offset CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE.
361
362 For Mode 2 formless, The User Data is M2RAW_SECTOR_SIZE bytes
363 beginning at offset CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE.
364
365 For data Mode 2, form 1, User Data is ISO_BLOCKSIZE bytes beginning at
366 offset CDIO_CD_XA_SYNC_HEADER.
367
368 For data Mode 2, form 2, User Data is 2 324 bytes beginning at
369 offset CDIO_CD_XA_SYNC_HEADER.
370
371 @param b_sync
372
373 @param b_edc_ecc true if we return EDC/ECC error detection/correction bits.
374
375 The presence and size of EDC redundancy or ECC parity is defined
376 according to sector type:
377
378 CD-DA sectors have neither EDC redundancy nor ECC parity.
379
380 Data Mode 1 sectors have 288 bytes of EDC redundancy, Pad, and
381 ECC parity beginning at offset 2064.
382
383 Data Mode 2 formless sectors have neither EDC redundancy nor ECC
384 parity
385
386 Data Mode 2 form 1 sectors have 280 bytes of EDC redundancy and
387 ECC parity beginning at offset 2072
388
389 Data Mode 2 form 2 sectors optionally have 4 bytes of EDC
390 redundancy beginning at offset 2348.
391
392
393 @param c2_error_information If true associate a bit with each
394 sector for C2 error The resulting bit field is ordered exactly as
395 the main channel bytes. Each 8-bit boundary defines a byte of
396 flag bits.
397
398 @param subchannel_selection subchannel-selection bits
399
400 0 No Sub-channel data shall be returned. (0 bytes)
401 1 RAW P-W Sub-channel data shall be returned. (96 byte)
402 2 Formatted Q sub-channel data shall be transferred (16 bytes)
403 3 Reserved
404 4 Corrected and de-interleaved R-W sub-channel (96 bytes)
405 5-7 Reserved
406
407 @param i_blocksize size of the a block expected to be returned
408
409 @param i_blocks number of blocks expected to be returned.
410
411 */
412 %rename mmc_read_cd read_cd;
413
414 /*! Read just the user data part of some sort of data sector (via
415 mmc_read_cd).
416
417 @param p_cdio object to read from
418
419 @param p_buf place to read data into. The caller should make sure
420 this location can store at least CDIO_CD_FRAMESIZE,
421 M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending on
422 the kind of sector getting read. If you don't know
423 whether you have a Mode 1/2, Form 1/ Form 2/Formless
424 sector best to reserve space for the maximum,
425 M2RAW_SECTOR_SIZE.
426
427 @param i_lsn sector to read
428 @param i_blocksize size of each block
429 @param i_blocks number of blocks to read
430
431 */
432 %rename mmc_read_data_sectors read_data_sectors;
433
434 /*! Read sectors using SCSI-MMC GPCMD_READ_CD.
435 Can read only up to 25 blocks.
436 */
437 %rename mmc_read_sectors read_sectors;
438
439 /*!
440 Run a Multimedia command (MMC).
441
442 @param p_cdio CD structure set by cdio_open().
443 @param i_timeout_ms time in milliseconds we will wait for the command
444 to complete.
445 @param p_cdb CDB bytes. All values that are needed should be set
446 on input. We'll figure out what the right CDB length
447 should be.
448 @param e_direction direction the transfer is to go.
449 @param i_buf Size of buffer
450 @param p_buf Buffer for data, both sending and receiving.
451
452 @return 0 if command completed successfully.
453 */
454 %rename mmc_run_cmd run_cmd;
455
456 /*!
457 Set the block size for subsequest read requests, via MMC.
458 */
459 %rename mmc_set_blocksize set_blocksize;
460
461 /*!
462 Set the drive speed.
463 */
464 %rename mmc_set_speed set_speed;
465
466 /*!
467 Load or Unload media using a MMC START STOP command.
468
469 @param p_cdio the CD object to be acted upon.
470 @param b_eject eject if true and close tray if false
471 @param b_immediate wait or don't wait for operation to complete
472 @param power_condition Set CD-ROM to idle/standby/sleep. If nonzero
473 eject/load is ignored, so set to 0 if you want to eject or load.
474
475 @see mmc_eject_media or mmc_close_tray
476 */
e7eebf9 More fixes and completion of code from Jerry G Geiger.
R. Bernstein authored
477 %rename mmc_start_stop_unit stop_media;
478 int mmc_start_stop_unit (const CdIo_t *p_cdio);
479 %feature("autodoc",
480 "mmc_start_stop_unit cmd, a more general (and lower-level) routine
481 to eject media / open tray. mmc_eject_media sometimes does not work.");
482 int mmc_close_tray(CdIo_t *p_cdio);
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
483
66b12c8 Add $track->get_track_isrc. Commit changes to return array ref or arr…
R. Bernstein authored
484
e499275 Get ready for release 0.3.0. Mostly administrivia. perlmmc.swg: match…
R. Bernstein authored
485 char * mmc_get_isrc(CdIo_t *p_cdio, track_t track);
66b12c8 Add $track->get_track_isrc. Commit changes to return array ref or arr…
R. Bernstein authored
486 %inline %{
e499275 Get ready for release 0.3.0. Mostly administrivia. perlmmc.swg: match…
R. Bernstein authored
487 char * mmc_get_isrc(CdIo_t *p_cdio, track_t track) {
66b12c8 Add $track->get_track_isrc. Commit changes to return array ref or arr…
R. Bernstein authored
488 static cdio_isrc_t isrc;
489 bzero(isrc, sizeof(isrc));
490 int status;
491
492 status = mmc_isrc_track_read_subchannel (p_cdio, track, isrc);
493 if(status != DRIVER_OP_SUCCESS)
494 *isrc = '\0';
495 return isrc;
496 }
497 %}
498
b570d3f Start MMC interface.
rocky authored
499 %perlcode %{
500
501 import Device::Cdio::VERSION;
502 $VERSION = $Device::Cdio::VERSION;
d3c0f36 Add "use strict".
rocky authored
503 use strict;
b570d3f Start MMC interface.
rocky authored
504
505 =pod
506
507 =head1 NAME
508
509 perlmmc - lower-level wrapper to MMC from libcdio, the ISO 9660 library of the CD Input and Control package
510
511 =head1 SYNOPSIS
512
513 This is fairly straight-forward wrapper around the MultiMedia commands from
514 the C library libcdio. Although this is perfectly usable on its own, it is expected that the interfaces L<Device::Cdio::MMC> or L<Device::Cdio::Device::MMC>
515 is what most people will want to use.
516
517 There are various constants that are defined here.
518
59d64d4 Finish first pass of SWIGifying mmc.h. Nothing has been tested yet, and
rocky authored
519 =head1 METHODS
520
521 =head2 this
522
523 This seems to be an artifact of SWIG.
524
b570d3f Start MMC interface.
rocky authored
525 =head1 SEE ALSO
526
527 L<http://www.gnu.org/software/libcdio> has documentation on
528 libcdio including the a manual and the API via doxygen.
529
530 =head1 AUTHORS
531
532 Rocky Bernstein C<< <rocky at cpan.org> >>.
533
534 =head1 COPYRIGHT
535
e4b2894 Use Jerry G Geiger's Build.PL patch to get close to having this work …
R. Bernstein authored
536 Copyright (C) 2006, 2008, 2011 Rocky Bernstein <rocky@cpan.org>
b570d3f Start MMC interface.
rocky authored
537
b3760ac gplv3+
karl authored
538 This program is free software: you can redistribute it and/or modify
b570d3f Start MMC interface.
rocky authored
539 it under the terms of the GNU General Public License as published by
b3760ac gplv3+
karl authored
540 the Free Software Foundation, either version 3 of the License, or
b570d3f Start MMC interface.
rocky authored
541 (at your option) any later version.
542
543 This program is distributed in the hope that it will be useful,
544 but WITHOUT ANY WARRANTY; without even the implied warranty of
545 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
546 GNU General Public License for more details.
547
548 You should have received a copy of the GNU General Public License
b3760ac gplv3+
karl authored
549 along with this program. If not, see <http://www.gnu.org/licenses/>.
b570d3f Start MMC interface.
rocky authored
550
551 =cut
552
553 %}
Something went wrong with that request. Please try again.