Clean up headers a bit, and begin to add the improved image creation
This commit is contained in:
parent
0c369c5033
commit
fe6613d7b9
@ -97,9 +97,9 @@ ecdb_setup(void)
|
|||||||
if (!ecdb_aquire_drive_info())
|
if (!ecdb_aquire_drive_info())
|
||||||
{
|
{
|
||||||
printf("Aquiring drives failed!\n");
|
printf("Aquiring drives failed!\n");
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,5 +315,5 @@ ecdb_burn_finished(void *data, int type, void *event)
|
|||||||
FREE(t);
|
FREE(t);
|
||||||
FREE(proj);
|
FREE(proj);
|
||||||
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL);
|
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, NULL, NULL, NULL);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
#ifndef ECDB_BURN_H
|
#ifndef ECDB_BURN_H
|
||||||
#define ECDB_BURN_H
|
#define ECDB_BURN_H
|
||||||
|
|
||||||
int ecdb_burn_project(Ecdb_Burn_Project *proj);
|
int ecdb_burn_project(Ecdb_Burn_Project *proj);
|
||||||
int ecdb_erase_disc(Ecdb_Erase_Project *proj);
|
int ecdb_erase_disc(Ecdb_Erase_Project *proj);
|
||||||
|
Ecdb_Burn_Project *ecdb_burn_project_new(void);
|
||||||
Ecdb_Burn_Project *ecdb_burn_project_new(void);
|
Ecdb_Erase_Project *ecdb_erase_project_new(void);
|
||||||
Ecdb_Erase_Project *ecdb_erase_project_new(void);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -111,4 +111,17 @@ struct _Ecdb_Erase_Project
|
|||||||
/* Typecast a pointer to an Ecdb_Erase_Project */
|
/* Typecast a pointer to an Ecdb_Erase_Project */
|
||||||
#define ECDB_ERASE(proj) ((Ecdb_Erase_Project *) proj)
|
#define ECDB_ERASE(proj) ((Ecdb_Erase_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 rec:1;
|
||||||
|
unsigned char num_children;
|
||||||
|
Ecdb_Source **children;
|
||||||
|
IsoNode *node;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,6 +28,9 @@ ecdb_aquire_drive_info(void)
|
|||||||
|
|
||||||
drive = calloc(1, sizeof(Ecdb_Drive_Info));
|
drive = calloc(1, sizeof(Ecdb_Drive_Info));
|
||||||
|
|
||||||
|
if (!drive)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* It would be nice if there was an easier way to do this */
|
/* It would be nice if there was an easier way to do this */
|
||||||
drive->product = strdup(drives_current[i].product);
|
drive->product = strdup(drives_current[i].product);
|
||||||
drive->vendor = strdup(drives_current[i].vendor);
|
drive->vendor = strdup(drives_current[i].vendor);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef ECDB_DRIVES_H
|
#ifndef ECDB_DRIVES_H
|
||||||
#define ECDB_DRIVES_H
|
#define ECDB_DRIVES_H
|
||||||
|
|
||||||
int ecdb_aquire_drive_info(void);
|
int ecdb_aquire_drive_info(void);
|
||||||
void ecdb_print_drive_info(void);
|
void ecdb_print_drive_info(void);
|
||||||
int ecdb_aquire_drive(Ecdb_Project *proj, unsigned int idx);
|
int ecdb_aquire_drive(Ecdb_Project *proj, unsigned int idx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,96 @@
|
|||||||
#include "ecdb.h"
|
#include "ecdb.h"
|
||||||
|
|
||||||
|
int ecdb_source_init(Ecdb_Source *src);
|
||||||
|
|
||||||
|
Ecdb_Source *
|
||||||
|
ecdb_source_new(void)
|
||||||
|
{
|
||||||
|
Ecdb_Source *src;
|
||||||
|
|
||||||
|
src = calloc(1, sizeof(Ecdb_Source));
|
||||||
|
if (!src)
|
||||||
|
return NULL;
|
||||||
|
if (!ecdb_source_init(src))
|
||||||
|
{
|
||||||
|
FREE(src);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return src;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ecdb_source_init(Ecdb_Source *src)
|
||||||
|
{
|
||||||
|
src->rec = FALSE;
|
||||||
|
src->num_children = 0;
|
||||||
|
src->children = calloc(1, sizeof(Ecdb_Source));
|
||||||
|
if (!src->children)
|
||||||
|
return FALSE;
|
||||||
|
src->children[src->num_children] = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecdb_source_data_set(Ecdb_Source *src, const char *dst, unsigned char rec)
|
||||||
|
{
|
||||||
|
if (!src)
|
||||||
|
return;
|
||||||
|
|
||||||
|
src->dst = dst;
|
||||||
|
src->rec = rec;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecdb_source_child_append(Ecdb_Source *src, Ecdb_Source *child)
|
||||||
|
{
|
||||||
|
src->num_children++;
|
||||||
|
src->children = realloc(src->children, sizeof(Ecdb_Source) *
|
||||||
|
(src->num_children + 1));
|
||||||
|
src->children[src->num_children] = child;
|
||||||
|
src->children[src->num_children + 1] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecdb_source_add_children_rec(Ecdb_Source *parent, IsoImage *image)
|
||||||
|
{
|
||||||
|
IsoDir *cd;
|
||||||
|
IsoNode *cn;
|
||||||
|
Ecdb_Source *cs;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if ((!parent) || (!image))
|
||||||
|
return;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while ((cs = parent->children[i]))
|
||||||
|
{
|
||||||
|
if (cs->rec)
|
||||||
|
iso_tree_add_dir_rec(image, ISO_DIR(parent->node),
|
||||||
|
cs->dst);
|
||||||
|
if (cs->num_children)
|
||||||
|
{
|
||||||
|
/* If not created above, make one here */
|
||||||
|
if (!iso_tree_path_to_node(image, cs->dst, &cn))
|
||||||
|
{
|
||||||
|
iso_tree_add_new_dir(ISO_DIR(parent->node),
|
||||||
|
cs->dst, &cd);
|
||||||
|
cs->node = ISO_NODE(cd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cs->node = cn;
|
||||||
|
ecdb_source_add_children_rec(cs, image);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* file */
|
||||||
|
if ((!cs->rec) && (!cs->num_children))
|
||||||
|
iso_tree_add_node(image, ISO_DIR(parent->node),
|
||||||
|
cs->dst, NULL);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Deprecated code */
|
||||||
|
|
||||||
/* Some limitations here need to be worked out
|
/* Some limitations here need to be worked out
|
||||||
* Handle: audio, etc */
|
* Handle: audio, etc */
|
||||||
BurnSource *
|
BurnSource *
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#ifndef ECDB_IMAGE_H
|
#ifndef ECDB_IMAGE_H
|
||||||
#define ECDB_IMAGE_H
|
#define ECDB_IMAGE_H
|
||||||
|
|
||||||
BurnSource *ecdb_image_project(Ecdb_Burn_Project *proj);
|
Ecdb_Source *ecdb_source_new(void);
|
||||||
|
void ecdb_source_data_set(Ecdb_Source *src, const char *dst,
|
||||||
|
unsigned char rec);
|
||||||
|
void ecdb_source_child_append(Ecdb_Source *src, Ecdb_Source *child);
|
||||||
|
BurnSource *ecdb_image_project(Ecdb_Burn_Project *proj);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef ECDB_MISC_H
|
#ifndef ECDB_MISC_H
|
||||||
#define ECDB_MISC_H
|
#define ECDB_MISC_H
|
||||||
|
|
||||||
Ecdb_Project *ecdb_project_new(void);
|
Ecdb_Project *ecdb_project_new(void);
|
||||||
int ecdb_project_init(Ecdb_Project *proj);
|
int ecdb_project_init(Ecdb_Project *proj);
|
||||||
int ecdb_shutdown(void *data, int type, void *event);
|
int ecdb_shutdown(void *data, int type, void *event);
|
||||||
void ecdb_burn_init(void);
|
void ecdb_burn_init(void);
|
||||||
void ecdb_image_init(void);
|
void ecdb_image_init(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user