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

217 lines
4.7 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,
ECDB_DATA_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;
2008-12-26 19:03:11 +00:00
/* Capacity */
long long capacity;
2008-12-09 05:47:59 +00:00
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;
2009-02-17 22:48:11 +00:00
Ecdb_Project_Type type;
/* Every project has these */
Evas_Object *ret;
Evas_Object *begin;
2009-02-05 04:11:22 +00:00
Evas_Object *drive_combo;
2008-05-15 00:14:33 +00:00
};
2009-02-05 04:11:22 +00:00
/* Typecast a pointer to an Ecdb_Project */
#define ECDB_PROJECT(proj) ((Ecdb_Project *) proj)
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;
long long size; //Sizeof itself and children
2008-12-09 05:47:59 +00:00
Ecdb_Source **children;
Ecdb_Source *parent;
IsoNode *node;
2008-05-21 01:01:37 +00:00
};
2008-05-15 00:14:33 +00:00
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;
/* The file source */
2008-12-09 05:47:59 +00:00
Ecdb_Source *files;
2009-01-11 22:13:44 +00:00
Evas_Object *speed_combo;
2008-12-09 05:47:59 +00:00
/* 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)
typedef struct _Ecdb_Image_Project Ecdb_Image_Project;
struct _Ecdb_Image_Project
{
/* Inherit from a burn project */
Ecdb_Burn_Project proj;
Evas_Object *entry;
2009-02-05 04:11:22 +00:00
};
/* 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;
2009-02-05 04:11:22 +00:00
};
/* Typecast a pointer to an Ecdb_Image_Project */
#define ECDB_DATA(proj) ((Ecdb_Data_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_Burn_Project proj;
2008-06-04 00:24:13 +00:00
2008-12-09 05:47:59 +00:00
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
/* Add a check widget */
Evas_Object *speed;
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