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

235 lines
5.1 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_Disc_Status Ecdb_Disc_Status;
enum _Ecdb_Disc_Status
{
ECDB_DISC_BLANK = 0x1,
ECDB_DISC_REWRITABLE = 0x2,
ECDB_DISC_APPENDABLE = 0x4
};
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,
ECDB_DATA_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 *write_speeds;
/* Drive info */
char *vendor;
char *product;
char *revision;
char *location;
char *udi;
unsigned char write_cdr:1;
unsigned char write_cdrw:1;
unsigned char write_dvdr:1;
unsigned char write_dvdrw:1;
unsigned char write_dvdram:1;
unsigned char write_dvdplusr:1;
unsigned char write_dvdplusrw:1;
unsigned char write_dvdplusrwdl:1;
unsigned char write_dvdplusrdl:1;
unsigned char write_bdr:1;
unsigned char write_bdre:1;
unsigned char write_hddvdr:1;
unsigned char write_hddvdrw:1;
unsigned char support_multisession:1;
unsigned char fresh_info:1;
/* Disc info */
char *type;
char *disc_udi;
unsigned int status;
unsigned 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;
Ecdb_Project_Type type;
/* Every project has these */
Evas_Object *ret;
Evas_Object *begin;
Evas_Object *drive_combo;
};
/* Typecast a pointer to an Ecdb_Project */
#define ECDB_PROJECT(proj) ((Ecdb_Project *) proj)
/* 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;
};
typedef struct _Ecdb_Burn_Project Ecdb_Burn_Project;
struct _Ecdb_Burn_Project
{
/* Inherit from normal project */
Ecdb_Project proj;
/* The file source */
Ecdb_Source *files;
Evas_Object *speed_combo;
/* 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_Image_Project Ecdb_Image_Project;
struct _Ecdb_Image_Project
{
/* Inherit from a burn project */
Ecdb_Burn_Project proj;
Evas_Object *entry;
};
/* Typecast a pointer to an Ecdb_Image_Project */
#define ECDB_IMAGE(proj) ((Ecdb_Image_Project *) proj)
typedef struct _Ecdb_Data_Project Ecdb_Data_Project;
struct _Ecdb_Data_Project
{
/* Inherit from a burn project */
Ecdb_Burn_Project proj;
/* Files are important here */
Evas_Object *capacity;
Evas_Object *settings;
Evas_Object *filelist_swallow;
Ewl_Widget *filelist;
/* 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;
/* 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;
};
/* Typecast a pointer to an Ecdb_Image_Project */
#define ECDB_DATA(proj) ((Ecdb_Data_Project *) proj)
typedef struct _Ecdb_Audio_Project Ecdb_Audio_Project;
struct _Ecdb_Audio_Project
{
/* Inherit from normal project */
Ecdb_Burn_Project proj;
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;
/* Add a check widget */
Evas_Object *speed;
/* 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