2008-04-01 21:30:41 +00:00
|
|
|
#include "ecdb.h"
|
|
|
|
|
2008-04-07 01:04:15 +00:00
|
|
|
/* Global Variables */
|
|
|
|
int ECDB_DRIVE_ACTION_FINISHED = 0;
|
|
|
|
int ECDB_DRIVE_ACTION_BEGUN = 0;
|
|
|
|
int ECDB_DRIVE_ACTION_UPDATE = 0;
|
|
|
|
|
2008-04-01 21:30:41 +00:00
|
|
|
Ecdb_Main *em;
|
|
|
|
int ecdb_setup();
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
2008-04-07 20:40:30 +00:00
|
|
|
int ret = 0;
|
2008-04-01 21:30:41 +00:00
|
|
|
|
2008-08-06 02:21:20 +00:00
|
|
|
/* Do I really need all of these? */
|
2008-04-07 01:04:15 +00:00
|
|
|
if (!ecore_init())
|
|
|
|
{
|
|
|
|
printf("Cannot initialize Ecore!\n");
|
|
|
|
return 1;
|
|
|
|
}
|
2008-08-04 22:18:34 +00:00
|
|
|
|
|
|
|
if (!ecore_string_init())
|
|
|
|
{
|
|
|
|
printf("Cannot initialize Ecore_String!\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
2008-04-07 01:04:15 +00:00
|
|
|
|
|
|
|
if (!ecore_file_init())
|
|
|
|
{
|
|
|
|
printf("Cannot initialize Ecore_File!\n");
|
2008-04-07 20:40:30 +00:00
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
2008-04-07 01:04:15 +00:00
|
|
|
}
|
|
|
|
|
2008-08-04 22:18:34 +00:00
|
|
|
if (!ecore_evas_init())
|
2008-06-06 03:02:27 +00:00
|
|
|
{
|
2008-08-04 22:18:34 +00:00
|
|
|
printf("Cannot initialize Ecore_Evas!\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
|
|
|
|
2008-08-04 23:28:43 +00:00
|
|
|
if (!edje_init())
|
|
|
|
{
|
|
|
|
printf("Cannot initialize Edje!\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
|
|
|
|
2008-08-06 02:21:20 +00:00
|
|
|
if (!ewl_init(&argc, argv))
|
|
|
|
{
|
|
|
|
printf("Connot initialize Ewl!\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
|
|
|
|
2008-08-04 22:18:34 +00:00
|
|
|
if (!ecdb_image_init())
|
|
|
|
{
|
|
|
|
printf("Cannot initialize libisofs!\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ecdb_burn_init())
|
|
|
|
{
|
|
|
|
printf("Cannot initialize libburn!\n");
|
2008-06-06 03:02:27 +00:00
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
|
|
|
|
2008-04-01 21:30:41 +00:00
|
|
|
if (!ecdb_setup())
|
|
|
|
{
|
|
|
|
printf("Setup failed\n");
|
2008-04-07 20:40:30 +00:00
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
2008-04-01 21:30:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ecdb_print_drive_info();
|
2008-08-04 23:28:43 +00:00
|
|
|
|
|
|
|
if (!ecdb_create_main_gui())
|
|
|
|
{
|
|
|
|
printf("Cannot create main window\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
2008-06-06 03:02:27 +00:00
|
|
|
|
|
|
|
/*
|
2008-04-01 21:30:41 +00:00
|
|
|
|
2008-06-04 01:12:34 +00:00
|
|
|
Ecdb_Audio_Project *proj;
|
2008-05-21 03:08:27 +00:00
|
|
|
Ecdb_Source *src;
|
2008-06-04 01:12:34 +00:00
|
|
|
proj = ecdb_audio_project_new();
|
2008-04-01 21:30:41 +00:00
|
|
|
|
|
|
|
i = 1;
|
|
|
|
while ((i < argc) && (argv))
|
|
|
|
{
|
2008-05-21 01:01:37 +00:00
|
|
|
if (ecore_file_exists(argv[i]))
|
|
|
|
{
|
2008-06-04 01:12:34 +00:00
|
|
|
if (!ecore_file_is_dir(argv[i]))
|
|
|
|
{
|
|
|
|
src = ecdb_source_new();
|
|
|
|
ecdb_source_data_set(src, argv[i], 0);
|
|
|
|
ecdb_source_child_append(proj->tracks, src);
|
|
|
|
}
|
2008-05-21 01:01:37 +00:00
|
|
|
}
|
2008-04-01 21:30:41 +00:00
|
|
|
i++;
|
|
|
|
}
|
2008-05-21 03:08:27 +00:00
|
|
|
|
2008-06-04 01:12:34 +00:00
|
|
|
ecdb_audio_project_start(proj);
|
|
|
|
|
2008-05-15 00:14:33 +00:00
|
|
|
proj->publisher_id = proj->data_preparer_id = proj->system_id =
|
|
|
|
proj->application_id = proj->copywrite_id =
|
2008-06-04 01:12:34 +00:00
|
|
|
proj->abstract_id = proj->biblio_id = strdup("ecdb");
|
2008-04-07 20:40:30 +00:00
|
|
|
|
2008-05-15 00:14:33 +00:00
|
|
|
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), 0))
|
2008-04-07 20:40:30 +00:00
|
|
|
{
|
|
|
|
printf("Couldn't grab drive!\n");
|
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
|
|
|
}
|
2008-04-07 01:04:15 +00:00
|
|
|
|
2008-05-15 00:14:33 +00:00
|
|
|
if (!ecdb_burn_project(proj))
|
2008-04-07 01:04:15 +00:00
|
|
|
{
|
|
|
|
printf("Burn was unsuccessful\n");
|
2008-04-07 20:40:30 +00:00
|
|
|
ret = 1;
|
|
|
|
goto SHUTDOWN;
|
2008-04-07 01:04:15 +00:00
|
|
|
}
|
|
|
|
|
2008-06-04 01:12:34 +00:00
|
|
|
*/
|
|
|
|
|
2008-08-06 02:21:20 +00:00
|
|
|
ewl_main();
|
2008-04-01 21:30:41 +00:00
|
|
|
|
|
|
|
/* End testing */
|
2008-04-07 20:40:30 +00:00
|
|
|
|
|
|
|
SHUTDOWN:
|
2008-04-01 21:30:41 +00:00
|
|
|
burn_finish();
|
2008-05-19 05:04:00 +00:00
|
|
|
iso_finish();
|
2008-04-07 01:04:15 +00:00
|
|
|
ecore_file_shutdown();
|
2008-08-04 22:18:34 +00:00
|
|
|
ecore_string_shutdown();
|
|
|
|
ecore_evas_shutdown();
|
2008-05-21 01:38:44 +00:00
|
|
|
ecore_shutdown();
|
2008-08-04 23:28:43 +00:00
|
|
|
edje_shutdown();
|
2008-08-04 22:18:34 +00:00
|
|
|
|
2008-04-07 01:04:15 +00:00
|
|
|
printf("Program Done\n");
|
2008-04-07 20:40:30 +00:00
|
|
|
return ret;
|
2008-04-01 21:30:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
ecdb_setup(void)
|
|
|
|
{
|
|
|
|
em = NULL;
|
|
|
|
em = calloc(1, sizeof(Ecdb_Main));
|
|
|
|
em->drives = NULL;
|
|
|
|
|
2008-06-04 01:12:34 +00:00
|
|
|
if (!ecore_file_mkdir("/tmp/ecdb"))
|
|
|
|
printf("Creation of temporary directory failed!\n");
|
|
|
|
|
2008-04-07 01:04:15 +00:00
|
|
|
ECDB_DRIVE_ACTION_FINISHED = ecore_event_type_new();
|
|
|
|
ECDB_DRIVE_ACTION_BEGUN = ecore_event_type_new();
|
|
|
|
ECDB_DRIVE_ACTION_UPDATE = ecore_event_type_new();
|
|
|
|
|
|
|
|
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, ecdb_shutdown,
|
|
|
|
NULL);
|
|
|
|
|
2008-04-01 21:30:41 +00:00
|
|
|
if (!ecdb_aquire_drive_info())
|
|
|
|
{
|
|
|
|
printf("Aquiring drives failed!\n");
|
2008-05-19 05:00:55 +00:00
|
|
|
return FALSE;
|
2008-04-01 21:30:41 +00:00
|
|
|
}
|
|
|
|
|
2008-05-19 05:00:55 +00:00
|
|
|
return TRUE;
|
2008-04-01 21:30:41 +00:00
|
|
|
}
|
|
|
|
|