legacy/experimental/ecdb/trunk/src/ecdb_common.h
2009-01-11 22:13:44 +00:00

185 lines
4.0 KiB
C

/* vim: set sw=3 ts=3 sts=3 expandtab: */
#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
/* 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;
typedef enum _Ecdb_Project_Type Ecdb_Project_Type;
enum _Ecdb_Project_Type
{
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
{
ECDB_ERROR_IMAGE_CREATE,
ECDB_ERROR_SOURCE_ATTACH,
ECDB_ERROR_WRITE_MODE,
ECDB_ERROR_NONE
};
typedef struct _Ecdb_Drive_Info Ecdb_Drive_Info;
struct _Ecdb_Drive_Info
{
/* Speeds */
int *read_speeds;
int *write_speeds;
/* Profiles */
const char *profile_name;
int profile_loaded;
/* Drive info */
const char *vendor;
const char *product;
const char *revision;
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;
/* Capacity */
long long capacity;
BurnDriveInfo *tangible;
};
typedef struct _Ecdb_Project_Info Ecdb_Project;
struct _Ecdb_Project_Info
{
/* The drive reference */
Ecdb_Drive_Info *drive;
Ecore_Event_Handler *ev_handler;
Ecore_Pipe *pipe;
unsigned int type;
};
/* Typecast a pointer to an Ecdb_Source */
#define ECDB_SOURCE(src) ((Ecdb_Source *) src)
typedef struct _Ecdb_Source Ecdb_Source;
struct _Ecdb_Source
{
const char *dst;
unsigned char dir:1;
unsigned int num_children;
long long size; //Sizeof itself and children
Ecdb_Source **children;
Ecdb_Source *parent;
IsoNode *node;
};
/* 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
{
/* Inherit from normal project */
Ecdb_Project proj;
/* Files are important here */
Ecdb_Source *files;
Evas_Object *capacity;
Evas_Object *speed_combo;
Evas_Object *drive_combo;
Evas_Object *parent;
/* 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 */
int iso_level;
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;
};
/* Typecast a pointer to an Ecdb_Burn_Project */
#define ECDB_BURN(proj) ((Ecdb_Burn_Project *) proj)
typedef struct _Ecdb_Audio_Project Ecdb_Audio_Project;
struct _Ecdb_Audio_Project
{
/* Inherit from normal project */
Ecdb_Project proj;
/* Audio tracks */
Ecdb_Source *tracks;
int num_tracks;
int num_transcode_complete;
};
/* Typecast a pointer to an Ecdb_Audio_Project */
#define ECDB_AUDIO(proj) ((Ecdb_Audio_Project *) proj)
typedef struct _Ecdb_Erase_Project Ecdb_Erase_Project;
struct _Ecdb_Erase_Project
{
/* Inherit from normal project */
Ecdb_Project proj;
/* Speed */
unsigned char quick:1;
unsigned char format:1;
};
/* Typecast a pointer to an Ecdb_Erase_Project */
#define ECDB_ERASE(proj) ((Ecdb_Erase_Project *) proj)
#endif