Use eina error logging, instead of plain printfs.
This commit is contained in:
@@ -34,7 +34,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj, Ecdb_Page *page)
|
||||
data = calloc(1, sizeof(Burn_Data));
|
||||
if (!data)
|
||||
{
|
||||
printf("Error: Cannot create burn data structure!\n");
|
||||
EINA_ERROR_PWARN("Error: Cannot create burn data structure!\n");
|
||||
return FALSE;
|
||||
}
|
||||
data->proj = ECDB_PROJECT(proj);
|
||||
@@ -53,7 +53,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj, Ecdb_Page *page)
|
||||
source = ecdb_image_project(proj);
|
||||
if (!source)
|
||||
{
|
||||
printf("Failed to add any files to burn disc!\n");
|
||||
EINA_ERROR_PWARN("Failed to add any files to burn disc!\n");
|
||||
burn_session_free(data->session);
|
||||
burn_disc_free(data->disc);
|
||||
ecdb_sources_list_free(data->sources);
|
||||
@@ -64,7 +64,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj, Ecdb_Page *page)
|
||||
|
||||
if (burn_track_set_source(track, source) != BURN_SOURCE_OK)
|
||||
{
|
||||
printf("Error: Cannot attach source object to track object!\n");
|
||||
EINA_ERROR_PWARN("Error: Cannot attach source object to track object!\n");
|
||||
burn_session_free(data->session);
|
||||
burn_disc_free(data->disc);
|
||||
ecdb_sources_list_free(data->sources);
|
||||
@@ -82,18 +82,19 @@ ecdb_burn_project(Ecdb_Burn_Project *proj, Ecdb_Page *page)
|
||||
burn_write_opts_set_multi(opts, proj->multi);
|
||||
if (proj->simulate)
|
||||
{
|
||||
printf("Simulating Burn!\n");
|
||||
EINA_ERROR_PINFO("Simulating Burn!\n");
|
||||
}
|
||||
burn_write_opts_set_simulate(opts, proj->simulate);
|
||||
burn_drive_set_speed(ECDB_PROJECT(proj)->drive->tangible->drive, 0,
|
||||
proj->speed);
|
||||
burn_write_opts_set_underrun_proof(opts, proj->underrun_proof);
|
||||
|
||||
printf("Searching for burn mode\n");
|
||||
EINA_ERROR_PDBG("Searching for burn mode\n");
|
||||
if (burn_write_opts_auto_write_type(opts, data->disc, reasons, 0)
|
||||
== BURN_WRITE_NONE)
|
||||
{
|
||||
printf("Error: Failed to find a suitable write mode for disc!\n");
|
||||
EINA_ERROR_PWARN("Error: Failed to find a suitable write mode"
|
||||
" for disc!\n");
|
||||
burn_session_free(data->session);
|
||||
burn_disc_free(data->disc);
|
||||
burn_write_opts_free(opts);
|
||||
@@ -106,7 +107,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj, Ecdb_Page *page)
|
||||
burn_disc_write(opts, data->disc);
|
||||
burn_write_opts_free(opts);
|
||||
|
||||
printf("Disc now burning\n");
|
||||
EINA_ERROR_PINFO("Disc now burning\n");
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add(ecdb_burn_progress_handler, data);
|
||||
pthread_create(&progress_update, NULL, ecdb_drive_progress_update, proj);
|
||||
pthread_detach(progress_update);
|
||||
@@ -128,13 +129,13 @@ ecdb_drive_progress_update(void *data)
|
||||
|
||||
if (!proj->drive->tangible)
|
||||
{
|
||||
printf("No tangible drive!\n");
|
||||
EINA_ERROR_PWARN("No tangible drive!\n");
|
||||
ecore_pipe_del(proj->pipe);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
drive = proj->drive->tangible[0].drive;
|
||||
|
||||
printf("Progress update active\n");
|
||||
EINA_ERROR_PDBG("Progress update active\n");
|
||||
while (burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
|
||||
{
|
||||
usleep(100000);
|
||||
@@ -149,7 +150,7 @@ ecdb_drive_progress_update(void *data)
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
printf("Closing pipe\n");
|
||||
EINA_ERROR_PDBG("Closing pipe\n");
|
||||
ecore_pipe_write(proj->pipe, proj->pipe, sizeof(Ecore_Pipe));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
@@ -168,7 +169,7 @@ ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
if (nbyte != sizeof(BurnProgress))
|
||||
{
|
||||
ecore_event_add(ECDB_DRIVE_ACTION_FINISHED, NULL, NULL, NULL);
|
||||
printf("Adding event to queue.\n");
|
||||
EINA_ERROR_PDBG("Adding event to queue.\n");
|
||||
last_sector = 0;
|
||||
return;
|
||||
}
|
||||
@@ -194,13 +195,13 @@ ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
bdata = data;
|
||||
if (!bdata)
|
||||
{
|
||||
printf("ecdb_burn_progress_handler: NULL bdata!\n");
|
||||
EINA_ERROR_PWARN("ecdb_burn_progress_handler: NULL bdata!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!bdata->page) || (!bdata->proj))
|
||||
{
|
||||
printf("ecdb_burn_progress_handler: NULL page or proj!\n");
|
||||
EINA_ERROR_PWARN("ecdb_burn_progress_handler: NULL page or proj!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -219,7 +220,8 @@ ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("ecdb_burn_progress_handler: Unrecognized project type!\n");
|
||||
EINA_ERROR_PWARN("ecdb_burn_progress_handler: Unrecognized "
|
||||
"project type!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -249,18 +251,18 @@ ecdb_burn_finished(void *data, int type, void *event)
|
||||
|
||||
proj = data;
|
||||
|
||||
printf("Freeing source and tracks\n");
|
||||
EINA_ERROR_PDBG("Freeing source and tracks\n");
|
||||
ecdb_sources_list_free(proj->sources);
|
||||
ecdb_tracks_list_free(proj->tracks);
|
||||
|
||||
printf("Freeing session and disc\n");
|
||||
EINA_ERROR_PDBG("Freeing session and disc\n");
|
||||
burn_session_free(proj->session);
|
||||
burn_disc_free(proj->disc);
|
||||
|
||||
printf("Releasing drive\n");
|
||||
EINA_ERROR_PDBG("Releasing drive\n");
|
||||
burn_drive_release(proj->proj->drive->tangible[0].drive, 1);
|
||||
burn_drive_info_free(proj->proj->drive->tangible);
|
||||
printf("Burn Complete\n");
|
||||
EINA_ERROR_PINFO("Burn Complete\n");
|
||||
|
||||
ecore_event_handler_del(proj->proj->ev_handler);
|
||||
proj->proj->ev_handler = NULL;
|
||||
@@ -270,7 +272,7 @@ ecdb_burn_finished(void *data, int type, void *event)
|
||||
switch (proj->proj->type)
|
||||
{
|
||||
case ECDB_AUDIO_PROJECT:
|
||||
printf("How in the world did you get here?\n");
|
||||
EINA_ERROR_PWARN("How in the world did you get here?\n");
|
||||
//ecdb_burn_audio_cleanup(proj->page);
|
||||
break;
|
||||
|
||||
@@ -283,7 +285,7 @@ ecdb_burn_finished(void *data, int type, void *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("ecdb_burn_finished: unknown project type!\n");
|
||||
EINA_ERROR_PWARN("ecdb_burn_finished: unknown project type!\n");
|
||||
}
|
||||
FREE(proj);
|
||||
|
||||
|
Reference in New Issue
Block a user