legacy/experimental/ecdb/trunk/src/ecdb_common.h

177 lines
3.8 KiB
C
Raw Normal View History

/* vim: set sw=3 ts=3 sts=3 expandtab: */
2008-05-15 00:14:33 +00:00
#ifndef ECDB_COMMON_H
#define ECDB_COMMON_H
#undef FREE
#define FREE(dat) \
{ \
if (dat) { free(dat); dat = NULL; } \
}
#undef __UNUSED__
#define __UNUSED__ __attribute__ ((unused))
#define IN 1
#define OUT 2
2008-05-15 00:14:33 +00:00
/* Typdefs */
typedef struct burn_source BurnSource;
typedef struct burn_disc BurnDisc;
typedef struct burn_session BurnSession;
typedef struct burn_write_opts BurnWriteOpts;
typedef struct burn_track BurnTrack;
typedef struct burn_progress BurnProgress;
typedef struct burn_drive_info BurnDriveInfo;
typedef enum burn_drive_status BurnDriveStatus;
2008-06-10 03:33:53 +00:00
typedef enum _Ecdb_Project_Type Ecdb_Project_Type;
enum _Ecdb_Project_Type
{
2008-12-09 05:47:59 +00:00
ECDB_BURN_PROJECT,
ECDB_AUDIO_PROJECT,
ECDB_ERASE_PROJECT,
ECDB_COPY_PROJECT,
ECDB_IMAGE_PROJECT
};
typedef enum _Ecdb_Burn_Result Ecdb_Burn_Result;
enum _Ecdb_Burn_Result
{
2008-12-09 05:47:59 +00:00
ECDB_ERROR_IMAGE_CREATE,
ECDB_ERROR_SOURCE_ATTACH,
ECDB_ERROR_WRITE_MODE,
ECDB_ERROR_NONE
2008-06-10 03:33:53 +00:00
};
2008-05-15 00:14:33 +00:00
typedef struct _Ecdb_Drive_Info Ecdb_Drive_Info;
struct _Ecdb_Drive_Info
{
2008-12-09 05:47:59 +00:00
/* Speeds */
int *read_speeds;
int *write_speeds;
/* Profiles */
const char *profile_name;
2008-12-09 05:47:59 +00:00
int profile_loaded;
/* Drive info */
const char *vendor;
const char *product;
const char *revision;
2008-12-09 05:47:59 +00:00
char *location;
unsigned char read_dvdram:1;
unsigned char read_dvdr:1;
unsigned char read_dvdrom:1;
unsigned char read_cdr:1;
unsigned char read_cdrw:1;
unsigned char write_dvdram:1;
unsigned char write_dvdr:1;
unsigned char write_cdr:1;
unsigned char write_simulate:1;
BurnDriveInfo *tangible;
2008-05-15 00:14:33 +00:00
};
typedef struct _Ecdb_Project_Info Ecdb_Project;
struct _Ecdb_Project_Info
{
2008-12-09 05:47:59 +00:00
/* The drive reference */
Ecdb_Drive_Info *drive;
Ecore_Event_Handler *ev_handler;
Ecore_Pipe *pipe;
unsigned int type;
2008-05-15 00:14:33 +00:00
};
2008-05-21 01:01:37 +00:00
/* Typecast a pointer to an Ecdb_Source */
#define ECDB_SOURCE(src) ((Ecdb_Source *) src)
typedef struct _Ecdb_Source Ecdb_Source;
struct _Ecdb_Source
{
2008-12-09 05:47:59 +00:00
const char *dst;
unsigned char dir:1;
unsigned int num_children;
Ecdb_Source **children;
Ecdb_Source *parent;
IsoNode *node;
2008-05-21 01:01:37 +00:00
};
2008-05-15 00:14:33 +00:00
/* Typecast a pointer to an Ecdb_Project */
#define ECDB_PROJECT(proj) ((Ecdb_Project *) proj)
typedef struct _Ecdb_Burn_Project Ecdb_Burn_Project;
struct _Ecdb_Burn_Project
{
2008-12-09 05:47:59 +00:00
/* Inherit from normal project */
Ecdb_Project proj;
/* Files are important here */
Ecdb_Source *files;
/* Ids */
char *volume_id;
char *publisher_id;
char *data_preparer_id;
char *system_id;
char *application_id;
char *copywrite_id;
char *abstract_id;
char *biblio_id;
/* iso options */
unsigned char iso_level:1;
unsigned char use_joliet:1;
unsigned char use_rockridge:1;
unsigned char follow_symlinks:1;
unsigned char ignore_hidden:1;
unsigned char ignore_special:1;
unsigned char iso1990:1;
/* burn options */
unsigned char opc:1;
unsigned char multi:1;
unsigned char simulate:1;
unsigned char underrun_proof:1;
int speed;
/* burn stuff */
int fifo_chunksize;
int fifo_chunks;
int burn_mode;
2008-05-15 00:14:33 +00:00
};
/* Typecast a pointer to an Ecdb_Burn_Project */
#define ECDB_BURN(proj) ((Ecdb_Burn_Project *) proj)
2008-06-04 00:24:13 +00:00
typedef struct _Ecdb_Audio_Project Ecdb_Audio_Project;
struct _Ecdb_Audio_Project
{
2008-12-09 05:47:59 +00:00
/* Inherit from normal project */
Ecdb_Project proj;
2008-06-04 00:24:13 +00:00
2008-12-09 05:47:59 +00:00
/* Audio tracks */
Ecdb_Source *tracks;
int num_tracks;
int num_transcode_complete;
2008-06-04 00:24:13 +00:00
};
/* Typecast a pointer to an Ecdb_Audio_Project */
#define ECDB_AUDIO(proj) ((Ecdb_Audio_Project *) proj)
2008-05-15 00:14:33 +00:00
typedef struct _Ecdb_Erase_Project Ecdb_Erase_Project;
struct _Ecdb_Erase_Project
{
2008-12-09 05:47:59 +00:00
/* Inherit from normal project */
Ecdb_Project proj;
2008-05-15 00:14:33 +00:00
2008-12-09 05:47:59 +00:00
/* Speed */
unsigned char quick:1;
unsigned char format:1;
2008-05-15 00:14:33 +00:00
};
/* Typecast a pointer to an Ecdb_Erase_Project */
#define ECDB_ERASE(proj) ((Ecdb_Erase_Project *) proj)
#endif