Main Page | Data Structures | Directories | File List | Data Fields | Globals

libburn.h File Reference

#include <stdint.h>

Go to the source code of this file.

Defines

#define BURN_CDROM   0
 Session format for normal audio or data discs.
#define BURN_CDI   0x10
 Session format for obsolete CD-I discs.
#define BURN_CDXA   0x20
 Session format for CDROM-XA discs.
#define BURN_POS_END   100
#define BURN_MODE_BITS   127
 Mask for mode bits.
#define BURN_MODE0   (1 << 0)
 Track mode - mode 0 data 0 bytes of user data.
#define BURN_MODE_RAW   (1 << 1)
 Track mode - mode "raw" - all 2352 bytes supplied by app FOR DATA TRACKS ONLY!
#define BURN_MODE1   (1 << 2)
 Track mode - mode 1 data 2048 bytes user data, and all the LEC money can buy.
#define BURN_MODE2   (1 << 3)
 Track mode - mode 2 data defaults to formless, 2336 bytes of user data, unprotected | with a data form if required.
#define BURN_FORM1   (1 << 4)
 Track mode modifier - Form 1, | with MODE2 for reasonable results 2048 bytes of user data, 4 bytes of subheader.
#define BURN_FORM2   (1 << 5)
 Track mode modifier - Form 2, | with MODE2 for reasonable results lots of user data.
#define BURN_AUDIO   (1 << 6)
 Track mode - audio 2352 bytes per sector.
#define BURN_4CH   (1 << 7)
 Track mode modifier - 4 channel audio.
#define BURN_COPY   (1 << 8)
 Track mode modifier - Digital copy permitted, can be set on any track.
#define BURN_PREEMPHASIS   (1 << 9)
 Track mode modifier - 50/15uS pre-emphasis.
#define BURN_SUBCODE_P16   (1 << 10)
 Input mode modifier - subcodes present packed 16.
#define BURN_SUBCODE_P96   (1 << 11)
 Input mode modifier - subcodes present packed 96.
#define BURN_SUBCODE_R96   (1 << 12)
 Input mode modifier - subcodes present raw 96.

Enumerations

enum  burn_write_types { BURN_WRITE_PACKET, BURN_WRITE_TAO, BURN_WRITE_SAO, BURN_WRITE_RAW }
 Possible disc writing style/modes. More...
enum  burn_block_types {
  BURN_BLOCK_RAW0 = 1, BURN_BLOCK_RAW16 = 2, BURN_BLOCK_RAW96P = 4, BURN_BLOCK_RAW96R = 8,
  BURN_BLOCK_MODE1 = 256, BURN_BLOCK_MODE2R = 512, BURN_BLOCK_MODE2_PATHETIC = 1024, BURN_BLOCK_MODE2_LAME = 2048,
  BURN_BLOCK_MODE2_OBSCURE = 4096, BURN_BLOCK_MODE2_OK = 8192, BURN_BLOCK_SAO = 16384
}
 Data format to send to the drive. More...
enum  burn_disc_status {
  BURN_DISC_UNREADY, BURN_DISC_BLANK, BURN_DISC_EMPTY, BURN_DISC_APPENDABLE,
  BURN_DISC_FULL
}
 Possible status' of the drive in regard to the disc in it. More...
enum  burn_message_type { BURN_MESSAGE_INFO, BURN_MESSAGE_WARNING, BURN_MESSAGE_ERROR }
 Possible types of messages form the library. More...
enum  burn_message_info { BURN_INFO_FOO }
 Possible information messages. More...
enum  burn_message_warning { BURN_WARNING_FOO }
 Possible warning messages. More...
enum  burn_message_error { BURN_ERROR_CANCELLED }
 Possible error messages. More...
enum  burn_source_status { BURN_SOURCE_OK, BURN_SOURCE_EOF, BURN_SOURCE_FAILED }
 Possible data source return values. More...
enum  burn_drive_status {
  BURN_DRIVE_IDLE, BURN_DRIVE_SPAWNING, BURN_DRIVE_READING, BURN_DRIVE_WRITING,
  BURN_DRIVE_WRITING_LEADIN, BURN_DRIVE_WRITING_LEADOUT, BURN_DRIVE_ERASING, BURN_DRIVE_GRABBING
}
 Possible busy states for a drive. More...

Functions

int burn_initialize (void)
 Initialize the library.
void burn_finish (void)
 Shutdown the library.
void burn_set_verbosity (int level)
 Set the verbosity level of the library.
burn_messageburn_get_message (void)
 Returns a newly allocated burn_message structure.
void burn_message_free (struct burn_message *msg)
 Frees a burn_message structure.
int burn_drive_scan (struct burn_drive_info *drives[], unsigned int *n_drives)
 Scans for drives.
void burn_drive_info_free (struct burn_drive_info *info)
 Frees a burn_drive_info array returned by burn_drive_scan.
int burn_drive_grab (struct burn_drive *drive, int load)
 Grab a drive.
void burn_drive_release (struct burn_drive *drive, int eject)
 Release a drive.
enum burn_disc_status burn_disc_get_status (struct burn_drive *drive)
 Returns what kind of disc a drive is holding.
int burn_disc_erasable (struct burn_drive *d)
 Tells whether a disc can be erased or not.
enum burn_drive_status burn_drive_get_status (struct burn_drive *drive, struct burn_progress *p)
 Returns the progress and status of a drive.
burn_write_opts * burn_write_opts_new (struct burn_drive *drive)
 Creates a write_opts struct for burning to the specified drive must be freed with burn_write_opts_free.
void burn_write_opts_free (struct burn_write_opts *opts)
 Frees a write_opts struct created with burn_write_opts_new.
burn_read_opts * burn_read_opts_new (struct burn_drive *drive)
 Creates a write_opts struct for reading from the specified drive must be freed with burn_write_opts_free.
void burn_read_opts_free (struct burn_read_opts *opts)
 Frees a read_opts struct created with burn_read_opts_new.
void burn_disc_erase (struct burn_drive *drive, int fast)
 Erase a disc in the drive.
void burn_disc_read (struct burn_drive *drive, const struct burn_read_opts *o)
 Read a disc from the drive and write it to an fd pair.
void burn_disc_write (struct burn_write_opts *o, struct burn_disc *disc)
 Write a disc in the drive.
void burn_drive_cancel (struct burn_drive *drive)
 Cancel an operation on a drive.
int burn_msf_to_sectors (int m, int s, int f)
 Convert a minute-second-frame (MSF) value to sector count.
void burn_sectors_to_msf (int sectors, int *m, int *s, int *f)
 Convert a sector count to minute-second-frame (MSF).
int burn_msf_to_lba (int m, int s, int f)
 Convert a minute-second-frame (MSF) value to an lba.
void burn_lba_to_msf (int lba, int *m, int *s, int *f)
 Convert an lba to minute-second-frame (MSF).
burn_disc * burn_disc_create (void)
 Create a new disc (for DAO recording).
void burn_disc_free (struct burn_disc *d)
 Delete disc and decrease the reference count on all its sessions.
burn_session * burn_session_create (void)
 Create a new session (For SAO at once recording, or to be added to a disc for DAO).
void burn_session_free (struct burn_session *s)
 Free a session (and decrease reference count on all tracks inside).
int burn_disc_add_session (struct burn_disc *d, struct burn_session *s, unsigned int pos)
 Add a session to a disc at a specific position, increasing the sessions's reference count.
int burn_disc_remove_session (struct burn_disc *d, struct burn_session *s)
 Remove a session from a disc.
burn_track * burn_track_create (void)
 Create a track (for TAO recording, or to put in a session).
void burn_track_free (struct burn_track *t)
 Free a track.
int burn_session_add_track (struct burn_session *s, struct burn_track *t, unsigned int pos)
 Add a track to a session at specified position.
int burn_session_remove_track (struct burn_session *s, struct burn_track *t)
 Remove a track from a session.
void burn_track_define_data (struct burn_track *t, int offset, int tail, int pad, int mode)
 Define the data in a track.
void burn_track_set_isrc (struct burn_track *t, char *country, char *owner, unsigned char year, unsigned int serial)
 Set the ISRC details for a track.
void burn_track_clear_isrc (struct burn_track *t)
 Disable ISRC parameters for a track.
void burn_session_hide_first_track (struct burn_session *s, int onoff)
 Hide the first track in the "pre gap" of the disc.
burn_disc * burn_drive_get_disc (struct burn_drive *d)
 Get the drive's disc struct - free when done.
enum burn_source_status burn_track_set_source (struct burn_track *t, struct burn_source *s)
 Set the track's data source.
void burn_source_free (struct burn_source *s)
 Free a burn_source (decrease its refcount and maybe free it).
burn_sourceburn_file_source_new (const char *path, const char *subpath)
 Creates a data source for an image file (and maybe subcode file).
int burn_track_get_sectors (struct burn_track *)
 Tells how long a track will be on disc.
void burn_drive_set_speed (struct burn_drive *d, int read, int write)
 Sets drive read and write speed.
void burn_structure_print_disc (struct burn_disc *d)
void burn_structure_print_session (struct burn_session *s)
void burn_structure_print_track (struct burn_track *t)
int burn_write_opts_set_write_type (struct burn_write_opts *opts, enum burn_write_types write_type, int block_type)
 Sets the write type for the write_opts struct.
void burn_write_opts_set_toc_entries (struct burn_write_opts *opts, int count, struct burn_toc_entry *toc_entries)
 Supplies toc entries for writing - not normally required for cd mastering.
void burn_write_opts_set_format (struct burn_write_opts *opts, int format)
 Sets the session format for a disc.
int burn_write_opts_set_simulate (struct burn_write_opts *opts, int sim)
 Sets the simulate value for the write_opts struct.
int burn_write_opts_set_underrun_proof (struct burn_write_opts *opts, int underrun_proof)
 Controls buffer underrun prevention.
void burn_write_opts_set_perform_opc (struct burn_write_opts *opts, int opc)
 Sets whether to use opc or not with the write_opts struct.
void burn_read_opts_set_raw (struct burn_read_opts *opts, int raw_mode)
 Sets whether to read in raw mode or not.
void burn_read_opts_set_c2errors (struct burn_read_opts *opts, int c2errors)
 Sets whether to report c2 errors or not.
void burn_read_opts_read_subcodes_audio (struct burn_read_opts *opts, int subcodes_audio)
 Sets whether to read subcodes from audio tracks or not.
void burn_read_opts_read_subcodes_data (struct burn_read_opts *opts, int subcodes_data)
 Sets whether to read subcodes from data tracks or not.
void burn_read_opts_set_hardware_error_recovery (struct burn_read_opts *opts, int hardware_error_recovery)
 Sets whether to recover errors if possible.
void burn_read_opts_report_recovered_errors (struct burn_read_opts *opts, int report_recovered_errors)
 Sets whether to report recovered errors or not.
void burn_read_opts_transfer_damaged_blocks (struct burn_read_opts *opts, int transfer_damaged_blocks)
 Sets whether blocks with unrecoverable errors should be read or not.
void burn_read_opts_set_hardware_error_retries (struct burn_read_opts *opts, unsigned char hardware_error_retries)
 Sets the number of retries to attempt when trying to correct an error.
int burn_drive_get_write_speed (struct burn_drive *d)
 Gets the maximum write speed for a drive.
int burn_drive_get_read_speed (struct burn_drive *d)
 Gets the maximum read speed for a drive.
void burn_track_get_entry (struct burn_track *t, struct burn_toc_entry *entry)
 Gets a copy of the toc_entry structure associated with a track.
void burn_session_get_leadout_entry (struct burn_session *s, struct burn_toc_entry *entry)
 Gets a copy of the toc_entry structure associated with a session's lead out.
burn_session ** burn_disc_get_sessions (struct burn_disc *d, int *num)
 Gets an array of all the sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION.
burn_track ** burn_session_get_tracks (struct burn_session *s, int *num)
 Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK.
int burn_track_get_mode (struct burn_track *track)
 Gets the mode of a track.
int burn_session_get_hidefirst (struct burn_session *session)
 Returns whether the first track of a session is hidden in the pregap.
void burn_version (int *major, int *minor, int *micro)
 Returns the library's version in its parts.


Define Documentation

#define BURN_4CH   (1 << 7)
 

Track mode modifier - 4 channel audio.

Definition at line 81 of file libburn.h.

#define BURN_AUDIO   (1 << 6)
 

Track mode - audio 2352 bytes per sector.

may be | with 4ch or preemphasis. NOT TO BE CONFUSED WITH BURN_MODE_RAW

Definition at line 79 of file libburn.h.

#define BURN_CDI   0x10
 

Session format for obsolete CD-I discs.

Definition at line 41 of file libburn.h.

#define BURN_CDROM   0
 

Session format for normal audio or data discs.

Definition at line 39 of file libburn.h.

#define BURN_CDXA   0x20
 

Session format for CDROM-XA discs.

Definition at line 43 of file libburn.h.

#define BURN_COPY   (1 << 8)
 

Track mode modifier - Digital copy permitted, can be set on any track.

Definition at line 83 of file libburn.h.

#define BURN_FORM1   (1 << 4)
 

Track mode modifier - Form 1, | with MODE2 for reasonable results 2048 bytes of user data, 4 bytes of subheader.

Definition at line 70 of file libburn.h.

#define BURN_FORM2   (1 << 5)
 

Track mode modifier - Form 2, | with MODE2 for reasonable results lots of user data.

not much LEC.

Definition at line 74 of file libburn.h.

#define BURN_MODE0   (1 << 0)
 

Track mode - mode 0 data 0 bytes of user data.

it's all 0s. mode 0. get it? HAH

Definition at line 53 of file libburn.h.

#define BURN_MODE1   (1 << 2)
 

Track mode - mode 1 data 2048 bytes user data, and all the LEC money can buy.

Definition at line 61 of file libburn.h.

#define BURN_MODE2   (1 << 3)
 

Track mode - mode 2 data defaults to formless, 2336 bytes of user data, unprotected | with a data form if required.

Definition at line 66 of file libburn.h.

#define BURN_MODE_BITS   127
 

Mask for mode bits.

Definition at line 48 of file libburn.h.

#define BURN_MODE_RAW   (1 << 1)
 

Track mode - mode "raw" - all 2352 bytes supplied by app FOR DATA TRACKS ONLY!

Definition at line 57 of file libburn.h.

#define BURN_POS_END   100
 

Definition at line 45 of file libburn.h.

#define BURN_PREEMPHASIS   (1 << 9)
 

Track mode modifier - 50/15uS pre-emphasis.

Definition at line 85 of file libburn.h.

#define BURN_SUBCODE_P16   (1 << 10)
 

Input mode modifier - subcodes present packed 16.

Definition at line 87 of file libburn.h.

#define BURN_SUBCODE_P96   (1 << 11)
 

Input mode modifier - subcodes present packed 96.

Definition at line 89 of file libburn.h.

#define BURN_SUBCODE_R96   (1 << 12)
 

Input mode modifier - subcodes present raw 96.

Definition at line 91 of file libburn.h.


Enumeration Type Documentation

enum burn_block_types
 

Data format to send to the drive.

Enumeration values:
BURN_BLOCK_RAW0  sync, headers, edc/ecc provided by lib/user
BURN_BLOCK_RAW16  sync, headers, edc/ecc and p/q subs provided by lib/user
BURN_BLOCK_RAW96P  sync, headers, edc/ecc and packed p-w subs provided by lib/user
BURN_BLOCK_RAW96R  sync, headers, edc/ecc and raw p-w subs provided by lib/user
BURN_BLOCK_MODE1  only 2048 bytes of user data provided by lib/user
BURN_BLOCK_MODE2R  2336 bytes of user data provided by lib/user
BURN_BLOCK_MODE2_PATHETIC  2048 bytes of user data provided by lib/user subheader provided in write parameters are we ever going to support this shit? I vote no.

(supposed to be supported on all drives...)

BURN_BLOCK_MODE2_LAME  2048 bytes of data + 8 byte subheader provided by lib/user hey, this is also dumb
BURN_BLOCK_MODE2_OBSCURE  2324 bytes of data provided by lib/user subheader provided in write parameters no sir, I don't like it.
BURN_BLOCK_MODE2_OK  2332 bytes of data supplied by lib/user 8 bytes sub header provided in write parameters this is the second least suck mode2, and is mandatory for all drives to support.
BURN_BLOCK_SAO  SAO block sizes are based on cue sheet, so use this.

Definition at line 116 of file libburn.h.

00117 {
00118     /** sync, headers, edc/ecc provided by lib/user */
00119     BURN_BLOCK_RAW0 = 1,
00120     /** sync, headers, edc/ecc and p/q subs provided by lib/user */
00121     BURN_BLOCK_RAW16 = 2,
00122     /** sync, headers, edc/ecc and packed p-w subs provided by lib/user */
00123     BURN_BLOCK_RAW96P = 4,
00124     /** sync, headers, edc/ecc and raw p-w subs provided by lib/user */
00125     BURN_BLOCK_RAW96R = 8,
00126     /** only 2048 bytes of user data provided by lib/user */
00127     BURN_BLOCK_MODE1 = 256,
00128     /** 2336 bytes of user data provided by lib/user */
00129     BURN_BLOCK_MODE2R = 512,
00130     /** 2048 bytes of user data provided by lib/user
00131         subheader provided in write parameters
00132         are we ever going to support this shit?  I vote no.
00133         (supposed to be supported on all drives...)
00134     */
00135     BURN_BLOCK_MODE2_PATHETIC = 1024,
00136     /** 2048 bytes of data + 8 byte subheader provided by lib/user
00137         hey, this is also dumb
00138     */
00139     BURN_BLOCK_MODE2_LAME = 2048,
00140     /** 2324 bytes of data provided by lib/user
00141         subheader provided in write parameters
00142         no sir, I don't like it.
00143     */
00144     BURN_BLOCK_MODE2_OBSCURE = 4096,
00145     /** 2332 bytes of data supplied by lib/user
00146         8 bytes sub header provided in write parameters
00147         this is the second least suck mode2, and is mandatory for
00148         all drives to support.
00149     */
00150     BURN_BLOCK_MODE2_OK = 8192,
00151     /** SAO block sizes are based on cue sheet, so use this. */
00152     BURN_BLOCK_SAO = 16384
00153 };

enum burn_disc_status
 

Possible status' of the drive in regard to the disc in it.

Enumeration values:
BURN_DISC_UNREADY  The current status is not yet known.
BURN_DISC_BLANK  The drive holds a blank disc.
BURN_DISC_EMPTY  There is no disc at all in the drive.
BURN_DISC_APPENDABLE  There is an incomplete disc in the drive.
BURN_DISC_FULL  There is a disc with data on it in the drive.

Definition at line 156 of file libburn.h.

00157 {
00158     /** The current status is not yet known */
00159     BURN_DISC_UNREADY,
00160     /** The drive holds a blank disc */
00161     BURN_DISC_BLANK,
00162     /** There is no disc at all in the drive */
00163     BURN_DISC_EMPTY,
00164     /** There is an incomplete disc in the drive */
00165     BURN_DISC_APPENDABLE,
00166     /** There is a disc with data on it in the drive */
00167     BURN_DISC_FULL
00168 };

enum burn_drive_status
 

Possible busy states for a drive.

Enumeration values:
BURN_DRIVE_IDLE  The drive is not in an operation.
BURN_DRIVE_SPAWNING  The library is spawning the processes to handle a pending operation (A read/write/etc is about to start but hasn't quite yet).
BURN_DRIVE_READING  The drive is reading data from a disc.
BURN_DRIVE_WRITING  The drive is writing data to a disc.
BURN_DRIVE_WRITING_LEADIN  The drive is writing Lead-In.
BURN_DRIVE_WRITING_LEADOUT  The drive is writing Lead-Out.
BURN_DRIVE_ERASING  The drive is erasing a disc.
BURN_DRIVE_GRABBING  The drive is being grabbed.

Definition at line 214 of file libburn.h.

00215 {
00216     /** The drive is not in an operation */
00217     BURN_DRIVE_IDLE,
00218     /** The library is spawning the processes to handle a pending
00219         operation (A read/write/etc is about to start but hasn't quite
00220         yet) */
00221     BURN_DRIVE_SPAWNING,
00222     /** The drive is reading data from a disc */
00223     BURN_DRIVE_READING,
00224     /** The drive is writing data to a disc */
00225     BURN_DRIVE_WRITING,
00226     /** The drive is writing Lead-In */
00227     BURN_DRIVE_WRITING_LEADIN,
00228     /** The drive is writing Lead-Out */
00229     BURN_DRIVE_WRITING_LEADOUT,
00230     /** The drive is erasing a disc */
00231     BURN_DRIVE_ERASING,
00232     /** The drive is being grabbed */
00233     BURN_DRIVE_GRABBING
00234 };

enum burn_message_error
 

Possible error messages.

Enumeration values:
BURN_ERROR_CANCELLED 

Definition at line 196 of file libburn.h.

00197 {
00198     BURN_ERROR_CANCELLED
00199 };

enum burn_message_info
 

Possible information messages.

Enumeration values:
BURN_INFO_FOO 

Definition at line 184 of file libburn.h.

00185 {
00186     BURN_INFO_FOO
00187 };

enum burn_message_type
 

Possible types of messages form the library.

Enumeration values:
BURN_MESSAGE_INFO  Diagnostic/Process information.

For the curious user.

BURN_MESSAGE_WARNING  A warning regarding a possible problem.

The user should probably be notified, but its not fatal.

BURN_MESSAGE_ERROR  An error message.

This usually means the current process will be aborted, and the user should definately see these.

Definition at line 171 of file libburn.h.

00172 {
00173     /** Diagnostic/Process information. For the curious user. */
00174     BURN_MESSAGE_INFO,
00175     /** A warning regarding a possible problem. The user should probably
00176         be notified, but its not fatal. */
00177     BURN_MESSAGE_WARNING,
00178     /** An error message. This usually means the current process will be
00179         aborted, and the user should definately see these. */
00180     BURN_MESSAGE_ERROR
00181 };

enum burn_message_warning
 

Possible warning messages.

Enumeration values:
BURN_WARNING_FOO 

Definition at line 190 of file libburn.h.

00191 {
00192     BURN_WARNING_FOO
00193 };

enum burn_source_status
 

Possible data source return values.

Enumeration values:
BURN_SOURCE_OK  The source is ok.
BURN_SOURCE_EOF  The source is at end of file.
BURN_SOURCE_FAILED  The source is unusable.

Definition at line 202 of file libburn.h.

00203 {
00204     /** The source is ok */
00205     BURN_SOURCE_OK,
00206     /** The source is at end of file */
00207     BURN_SOURCE_EOF,
00208     /** The source is unusable */
00209     BURN_SOURCE_FAILED
00210 };

enum burn_write_types
 

Possible disc writing style/modes.

Enumeration values:
BURN_WRITE_PACKET  Packet writing.

currently unsupported

BURN_WRITE_TAO  Track At Once recording.

2s gaps between tracks, no fonky lead-ins

BURN_WRITE_SAO  Session At Once.

block type MUST be BURN_BLOCK_SAO

BURN_WRITE_RAW  Raw disc at once recording.

all subcodes must be provided by lib or user only raw block types are supported

Definition at line 94 of file libburn.h.

00095 {
00096     /** Packet writing.
00097         currently unsupported
00098     */
00099     BURN_WRITE_PACKET,
00100     /** Track At Once recording.
00101         2s gaps between tracks, no fonky lead-ins
00102     */
00103     BURN_WRITE_TAO,
00104     /** Session At Once.
00105         block type MUST be BURN_BLOCK_SAO
00106     */
00107     BURN_WRITE_SAO,
00108     /** Raw disc at once recording.
00109         all subcodes must be provided by lib or user
00110         only raw block types are supported
00111     */
00112     BURN_WRITE_RAW
00113 };


Function Documentation

int burn_disc_add_session struct burn_disc *  d,
struct burn_session *  s,
unsigned int  pos
 

Add a session to a disc at a specific position, increasing the sessions's reference count.

Parameters:
d Disc to add the session to
s Session to add to the disc
pos position to add at (BURN_POS_END is "at the end")
Returns:
0 for failure, 1 for success

struct burn_disc* burn_disc_create void   ) 
 

Create a new disc (for DAO recording).

int burn_disc_erasable struct burn_drive *  d  ) 
 

Tells whether a disc can be erased or not.

Returns:
Non-zero means erasable

void burn_disc_erase struct burn_drive *  drive,
int  fast
 

Erase a disc in the drive.

The drive must be grabbed successfully BEFORE calling this functions. Always ensure that the drive reports a status of BURN_DISC_FULL before calling this function. An erase operation is not cancellable, as control of the operation is passed wholly to the drive and there is no way to interrupt it safely.

Parameters:
drive The drive with which to erase a disc.
fast Nonzero to do a fast erase, where only the disc's headers are erased; zero to erase the entire disc.

void burn_disc_free struct burn_disc *  d  ) 
 

Delete disc and decrease the reference count on all its sessions.

Parameters:
d The disc to be freed

struct burn_session** burn_disc_get_sessions struct burn_disc *  d,
int *  num
 

Gets an array of all the sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION.

Parameters:
d Disc to get session array for
num Returns the number of sessions in the array
Returns:
array of sessions

enum burn_disc_status burn_disc_get_status struct burn_drive *  drive  ) 
 

Returns what kind of disc a drive is holding.

This function may need to be called more than once to get a proper status from it. See burn_status for details.

Parameters:
drive The drive to query for a disc.
Returns:
The status of the drive, or what kind of disc is in it.

void burn_disc_read struct burn_drive *  drive,
const struct burn_read_opts *  o
 

Read a disc from the drive and write it to an fd pair.

The drive must be grabbed successfully BEFORE calling this function. Always ensure that the drive reports a status of BURN_DISC_FULL before calling this function.

Parameters:
drive The drive from which to read a disc.
o The options for the read operation.

int burn_disc_remove_session struct burn_disc *  d,
struct burn_session *  s
 

Remove a session from a disc.

Parameters:
d Disc to remove session from
s Session pointer to find and remove

void burn_disc_write struct burn_write_opts *  o,
struct burn_disc *  disc
 

Write a disc in the drive.

The drive must be grabbed successfully BEFORE calling this function. Always ensure that the drive reports a status of BURN_DISC_BLANK or BURN_STATUS_FULL (to append a new session to the disc) before calling this function.

Parameters:
o The options for the writing operation.
disc The struct burn_disc * that described the disc to be created

void burn_drive_cancel struct burn_drive *  drive  ) 
 

Cancel an operation on a drive.

This will only work when the drive's busy state is BURN_DRIVE_READING or BURN_DRIVE_WRITING.

Parameters:
drive The drive on which to cancel the current operation.

struct burn_disc* burn_drive_get_disc struct burn_drive *  d  ) 
 

Get the drive's disc struct - free when done.

Parameters:
d drive to query
Returns:
the disc struct

int burn_drive_get_read_speed struct burn_drive *  d  ) 
 

Gets the maximum read speed for a drive.

Parameters:
d Drive to query
Returns:
Maximum read speed in K/s

enum burn_drive_status burn_drive_get_status struct burn_drive *  drive,
struct burn_progress p
 

Returns the progress and status of a drive.

Parameters:
drive The drive to query busy state for.
p Returns the progress of the operation, NULL if you don't care
Returns:
the current status of the drive. See also burn_drive_status.

int burn_drive_get_write_speed struct burn_drive *  d  ) 
 

Gets the maximum write speed for a drive.

Parameters:
d Drive to query
Returns:
Maximum write speed in K/s

int burn_drive_grab struct burn_drive *  drive,
int  load
 

Grab a drive.

This must be done before the drive can be used (for reading, writing, etc). It may be neccesary to call this function more than once to grab a drive. See burn_grab for details.

Parameters:
drive The drive to grab. This is found in a returned burn_drive_info struct.
load Nonzero to make the drive attempt to load a disc (close its tray door, etc).
Returns:
1 if the drive has been grabbed, else 0

void burn_drive_info_free struct burn_drive_info info  ) 
 

Frees a burn_drive_info array returned by burn_drive_scan.

Parameters:
info The array to free

void burn_drive_release struct burn_drive *  drive,
int  eject
 

Release a drive.

This should not be done until the drive is no longer busy (see burn_drive_get_status).

Parameters:
drive The drive to release.
eject Nonzero to make the drive eject the disc in it.

int burn_drive_scan struct burn_drive_info drives[],
unsigned int *  n_drives
 

Scans for drives.

This function MUST be called until it returns nonzero. No drives can be in use when this is called or it will assert. All drive pointers are invalidated by using this function. Do NOT store drive pointers across calls to this function or death AND pain will ensue. When the app is done with the burn_drive_info array, it must be freed with burn_drive_info_free()

Parameters:
drives Returns an array of drives (cdroms/burners). The returned array should be freed when it is no longer needed, and before calling this function again to rescan.
n_drives Returns the number of hardware drives in drives.
Returns:
Zero while scanning is not complete; non-zero when it is finished.

void burn_drive_set_speed struct burn_drive *  d,
int  read,
int  write
 

Sets drive read and write speed.

Parameters:
d The drive to set speed for
read Read speed in k/s (0 is max)
write Write speed in k/s (0 is max)

struct burn_source* burn_file_source_new const char *  path,
const char *  subpath
 

Creates a data source for an image file (and maybe subcode file).

void burn_finish void   ) 
 

Shutdown the library.

This should be called before exiting your application. Make sure that all drives you have grabbed are released before calling this.

struct burn_message* burn_get_message void   ) 
 

Returns a newly allocated burn_message structure.

This message should be freed with burn_message_free() when you are finished with it.

Returns:
A message or NULL when there are no more messages to retrieve.

int burn_initialize void   ) 
 

Initialize the library.

This must be called before using any other functions in the library. It may be called more than once with no effect. If is possible to 'restart' the library by shutting it down and re-initializing it, though there is no good reason to do that.

Returns:
Nonzero if the library was able to initialize; zero if initialization failed.

void burn_lba_to_msf int  lba,
int *  m,
int *  s,
int *  f
 

Convert an lba to minute-second-frame (MSF).

Parameters:
lba The lba
m Returns the minute component
s Returns the second component
f Returns the frame component

void burn_message_free struct burn_message msg  ) 
 

Frees a burn_message structure.

int burn_msf_to_lba int  m,
int  s,
int  f
 

Convert a minute-second-frame (MSF) value to an lba.

Parameters:
m Minute component
s Second component
f Frame component
Returns:
The lba

int burn_msf_to_sectors int  m,
int  s,
int  f
 

Convert a minute-second-frame (MSF) value to sector count.

Parameters:
m Minute component
s Second component
f Frame component
Returns:
The sector count

void burn_read_opts_free struct burn_read_opts *  opts  ) 
 

Frees a read_opts struct created with burn_read_opts_new.

Parameters:
opts write_opts to free

struct burn_read_opts* burn_read_opts_new struct burn_drive *  drive  ) 
 

Creates a write_opts struct for reading from the specified drive must be freed with burn_write_opts_free.

Parameters:
drive The drive to read from
Returns:
The read_opts

void burn_read_opts_read_subcodes_audio struct burn_read_opts *  opts,
int  subcodes_audio
 

Sets whether to read subcodes from audio tracks or not.

Parameters:
opts The read opts to change
subcodes_audio If non-zero, read subcodes from audio tracks on the disc.

void burn_read_opts_read_subcodes_data struct burn_read_opts *  opts,
int  subcodes_data
 

Sets whether to read subcodes from data tracks or not.

Parameters:
opts The read opts to change
subcodes_data If non-zero, read subcodes from data tracks on the disc.

void burn_read_opts_report_recovered_errors struct burn_read_opts *  opts,
int  report_recovered_errors
 

Sets whether to report recovered errors or not.

Parameters:
opts The read opts to change
report_recovered_errors If non-zero, recovered errors will be reported.

void burn_read_opts_set_c2errors struct burn_read_opts *  opts,
int  c2errors
 

Sets whether to report c2 errors or not.

Parameters:
opts The read opts to change
c2errors If non-zero, report c2 errors.

void burn_read_opts_set_hardware_error_recovery struct burn_read_opts *  opts,
int  hardware_error_recovery
 

Sets whether to recover errors if possible.

Parameters:
opts The read opts to change
hardware_error_recovery If non-zero, attempt to recover errors if possible.

void burn_read_opts_set_hardware_error_retries struct burn_read_opts *  opts,
unsigned char  hardware_error_retries
 

Sets the number of retries to attempt when trying to correct an error.

Parameters:
opts The read opts to change
hardware_error_retries The number of retries to attempt when correcting an error.

void burn_read_opts_set_raw struct burn_read_opts *  opts,
int  raw_mode
 

Sets whether to read in raw mode or not.

Parameters:
opts The read opts to change
raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the disc is read, including headers.

void burn_read_opts_transfer_damaged_blocks struct burn_read_opts *  opts,
int  transfer_damaged_blocks
 

Sets whether blocks with unrecoverable errors should be read or not.

Parameters:
opts The read opts to change
transfer_damaged_blocks If non-zero, blocks with unrecoverable errors will still be read.

void burn_sectors_to_msf int  sectors,
int *  m,
int *  s,
int *  f
 

Convert a sector count to minute-second-frame (MSF).

Parameters:
sectors The sector count
m Returns the minute component
s Returns the second component
f Returns the frame component

int burn_session_add_track struct burn_session *  s,
struct burn_track *  t,
unsigned int  pos
 

Add a track to a session at specified position.

Parameters:
s Session to add to
t Track to insert in session
pos position to add at (BURN_POS_END is "at the end")
Returns:
0 for failure, 1 for success

struct burn_session* burn_session_create void   ) 
 

Create a new session (For SAO at once recording, or to be added to a disc for DAO).

void burn_session_free struct burn_session *  s  ) 
 

Free a session (and decrease reference count on all tracks inside).

Parameters:
s Session to be freed

int burn_session_get_hidefirst struct burn_session *  session  ) 
 

Returns whether the first track of a session is hidden in the pregap.

Parameters:
session the session to query
Returns:
non-zero means the first track is hidden

void burn_session_get_leadout_entry struct burn_session *  s,
struct burn_toc_entry entry
 

Gets a copy of the toc_entry structure associated with a session's lead out.

Parameters:
s Session to get the entry from
entry Struct for the library to fill out

struct burn_track** burn_session_get_tracks struct burn_session *  s,
int *  num
 

Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK.

Parameters:
s session to get track array for
num Returns the number of tracks in the array
Returns:
array of tracks

void burn_session_hide_first_track struct burn_session *  s,
int  onoff
 

Hide the first track in the "pre gap" of the disc.

Parameters:
s session to change
onoff 1 to enable hiding, 0 to disable

int burn_session_remove_track struct burn_session *  s,
struct burn_track *  t
 

Remove a track from a session.

Parameters:
s Session to remove track from
t Track pointer to find and remove
Returns:
0 for failure, 1 for success

void burn_set_verbosity int  level  ) 
 

Set the verbosity level of the library.

The default value is 0, which means that nothing is output on stderr. The more you increase this, the more debug output should be displayed on stderr for you.

Parameters:
level The verbosity level desired. 0 for nothing, higher positive values for more information output.

void burn_source_free struct burn_source s  ) 
 

Free a burn_source (decrease its refcount and maybe free it).

Parameters:
s Source to free

void burn_structure_print_disc struct burn_disc *  d  ) 
 

void burn_structure_print_session struct burn_session *  s  ) 
 

void burn_structure_print_track struct burn_track *  t  ) 
 

void burn_track_clear_isrc struct burn_track *  t  ) 
 

Disable ISRC parameters for a track.

Parameters:
t The track to change

struct burn_track* burn_track_create void   ) 
 

Create a track (for TAO recording, or to put in a session).

void burn_track_define_data struct burn_track *  t,
int  offset,
int  tail,
int  pad,
int  mode
 

Define the data in a track.

Parameters:
t the track to define
offset The lib will write this many 0s before start of data
tail The number of extra 0s to write after data
pad 1 means the lib should pad the last sector with 0s if the track isn't exactly sector sized. (otherwise the lib will begin reading from the next track)
mode data format (bitfield)

void burn_track_free struct burn_track *  t  ) 
 

Free a track.

Parameters:
t Track to free

void burn_track_get_entry struct burn_track *  t,
struct burn_toc_entry entry
 

Gets a copy of the toc_entry structure associated with a track.

Parameters:
t Track to get the entry from
entry Struct for the library to fill out

int burn_track_get_mode struct burn_track *  track  ) 
 

Gets the mode of a track.

Parameters:
track the track to query
Returns:
the track's mode

int burn_track_get_sectors struct burn_track *   ) 
 

Tells how long a track will be on disc.

void burn_track_set_isrc struct burn_track *  t,
char *  country,
char *  owner,
unsigned char  year,
unsigned int  serial
 

Set the ISRC details for a track.

Parameters:
t The track to change
country the 2 char country code. Each character must be only numbers or letters.
owner 3 char owner code. Each character must be only numbers or letters.
year 2 digit year. A number in 0-99 (Yep, not Y2K friendly).
serial 5 digit serial number. A number in 0-99999.

enum burn_source_status burn_track_set_source struct burn_track *  t,
struct burn_source s
 

Set the track's data source.

Parameters:
t The track to set the data source for
s The data source to use for the contents of the track
Returns:
An error code stating if the source is ready for use for writing the track, or if an error occured

void burn_version int *  major,
int *  minor,
int *  micro
 

Returns the library's version in its parts.

Parameters:
major The major version number
minor The minor version number
micro The micro version number

void burn_write_opts_free struct burn_write_opts *  opts  ) 
 

Frees a write_opts struct created with burn_write_opts_new.

Parameters:
opts write_opts to free

struct burn_write_opts* burn_write_opts_new struct burn_drive *  drive  ) 
 

Creates a write_opts struct for burning to the specified drive must be freed with burn_write_opts_free.

Parameters:
drive The drive to write with
Returns:
The write_opts

void burn_write_opts_set_format struct burn_write_opts *  opts,
int  format
 

Sets the session format for a disc.

Parameters:
opts The write opts to change
format The session format to set

void burn_write_opts_set_perform_opc struct burn_write_opts *  opts,
int  opc
 

Sets whether to use opc or not with the write_opts struct.

Parameters:
opts The write opts to change
opc If non-zero, optical power calibration will be performed at start of burn

int burn_write_opts_set_simulate struct burn_write_opts *  opts,
int  sim
 

Sets the simulate value for the write_opts struct.

Parameters:
opts The write opts to change
sim If non-zero, the drive will perform a simulation instead of a burn
Returns:
Returns 1 on success and 0 on failure.

void burn_write_opts_set_toc_entries struct burn_write_opts *  opts,
int  count,
struct burn_toc_entry toc_entries
 

Supplies toc entries for writing - not normally required for cd mastering.

Parameters:
opts The write opts to change
count The number of entries
toc_entries 

int burn_write_opts_set_underrun_proof struct burn_write_opts *  opts,
int  underrun_proof
 

Controls buffer underrun prevention.

Parameters:
opts The write opts to change
underrun_proof if non-zero, buffer underrun protection is enabled
Returns:
Returns 1 on success and 0 on failure.

int burn_write_opts_set_write_type struct burn_write_opts *  opts,
enum burn_write_types  write_type,
int  block_type
 

Sets the write type for the write_opts struct.

Parameters:
opts The write opts to change
write_type The write type to use
block_type The block type to use
Returns:
Returns 1 on success and 0 on failure.


Generated on Mon Feb 13 18:31:19 2006 for libburn by  doxygen 1.4.2