Clearer status messages after reading new volume and after burning

This commit is contained in:
Thomas Schmitt 2007-11-02 14:36:26 +00:00
parent 11d712622e
commit 3beb3de00c
3 changed files with 55 additions and 12 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.11.01.191106"
#define Xorriso_timestamP "2007.11.02.143549"

View File

@ -187,6 +187,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
ret= 0; goto ex;
}
xorriso->in_volset_handle= volset;
Xorriso_process_msg_queues(xorriso,0);
Xorriso_toc(xorriso, 1);
ret= 1;
ex:
if(ret<0) {
@ -275,6 +277,11 @@ int Xorriso_write_growing(struct XorrisO *xorriso, int flag)
struct burn_drive *drive;
struct burn_disc *disc= NULL;
struct burn_write_opts *burn_options;
off_t readcounter= 0,writecounter= 0;
int num_sessions= 0, num_tracks= 0;
struct burn_session **sessions;
struct burn_track **tracks;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to write", 2);
@ -339,6 +346,17 @@ int Xorriso_write_growing(struct XorrisO *xorriso, int flag)
ret= 0; goto ex;
}
sessions= burn_disc_get_sessions(disc, &num_sessions);
if(num_sessions>0) {
tracks= burn_session_get_tracks(sessions[0], &num_tracks);
if(tracks!=NULL && num_tracks>0) {
burn_track_get_counters(tracks[0],&readcounter,&writecounter);
sprintf(xorriso->info_text, "Read: %d sectors , Written: %d sectors\n",
(int) readcounter/2048, (int) writecounter/2048);
Xorriso_info(xorriso, 0);
}
}
ret= isoburn_activate_session(drive);
Xorriso_process_msg_queues(xorriso,0);
if(ret<=0) {
@ -347,7 +365,9 @@ int Xorriso_write_growing(struct XorrisO *xorriso, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
goto ex;
}
sprintf(xorriso->info_text, "Writing completed sucessfully.\n\n");
Xorriso_info(xorriso, 0);
ret= 1;
ex:;
if(disc!=NULL)
@ -741,11 +761,13 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
}
/* @param flag bit0=short report form
*/
int Xorriso_toc(struct XorrisO *xorriso, int flag)
{
int num_sessions= 0, num_tracks= 0, lba= 0, nwa= 0, pmin, psec, pframe, ret;
int num_sessions= 0, num_tracks= 0, lba= 0, nwa= -1, pmin, psec, pframe, ret;
int track_count= 0, session_no, track_no, profile_no= -1;
int last_track_start= 0, last_track_size= -1;
int last_track_start= 0, last_track_size= -1, num_data= 0, is_data;
char profile_name[80],*respt;
struct burn_disc *disc= NULL;
struct burn_session **sessions;
@ -766,7 +788,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_result(xorriso,0);
sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n",
dinfo[0].vendor, dinfo[0].product, dinfo[0].revision);
Xorriso_result(xorriso,0);
if(!(flag&1))
Xorriso_result(xorriso,0);
sprintf(respt, "Media current: ");
ret= burn_disc_get_profile(drive, &profile_no, profile_name);
@ -811,6 +834,9 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
#endif
if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0);
if(flag&1)
return(0);
sprintf(xorriso->info_text, "Cannot obtain Table Of Content");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
@ -818,12 +844,15 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
/* fabricate TOC */
sprintf(respt, "Media content: session %2d ", 1);
sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n", 1, "data ", 0);
Xorriso_result(xorriso,0);
if(!(flag&1))
Xorriso_result(xorriso,0);
last_track_start= lba;
sprintf(respt, "Media content: session %2d ", 1);
sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
Xorriso_result(xorriso,0);
last_track_size= nwa;
if(!(flag&1))
Xorriso_result(xorriso,0);
num_data= last_track_size= nwa;
num_sessions= 1;
} else {
sessions= burn_disc_get_sessions(disc, &num_sessions);
for (session_no= 0; session_no<num_sessions; session_no++) {
@ -832,6 +861,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
continue;
for(track_no= 0; track_no<num_tracks; track_no++) {
track_count++;
is_data= 0;
burn_track_get_entry(tracks[track_no], &toc_entry);
if (toc_entry.extensions_valid & 1) {
/* DVD extension valid */
@ -842,8 +872,11 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
sprintf(respt, "Media content: session %2d ", session_no+1);
sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n",
track_count, ((toc_entry.control&7)<4?"audio":"data "), lba);
Xorriso_result(xorriso,0);
if(!(flag&1))
Xorriso_result(xorriso,0);
last_track_start= lba;
if((toc_entry.control&7)>=4) /* data track */
is_data= 1;
}
burn_session_get_leadout_entry(sessions[session_no], &toc_entry);
if (toc_entry.extensions_valid & 1) {
@ -855,16 +888,23 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
}
sprintf(respt, "Media content: session %2d ", session_no+1);
sprintf(respt+strlen(respt), "leadout lba: %9d\n", lba);
Xorriso_result(xorriso,0);
if(!(flag&1))
Xorriso_result(xorriso,0);
last_track_size= lba - last_track_start;
if(is_data)
num_data+= last_track_size;
}
}
sprintf(respt, "Media summary: %d session%s, %d data blocks\n",
num_sessions, (num_sessions==1 ? "" : "s"), num_data);
Xorriso_result(xorriso,0);
if (s == BURN_DISC_APPENDABLE && nwa>0) {
if (s == BURN_DISC_APPENDABLE && nwa!=0) {
ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa);
if(ret>0) {
sprintf(respt, "Media nwa : %ds\n", nwa);
Xorriso_result(xorriso,0);
if(!(flag&1))
Xorriso_result(xorriso,0);
}
}
@ -2093,3 +2133,4 @@ ex:;
return(ret);
}

View File

@ -36,6 +36,8 @@ int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
int Xorriso__text_to_sev(char *severity_name, int *severity_number,int flag);
/* @param flag bit0=short report form
*/
int Xorriso_toc(struct XorrisO *xorriso, int flag);
int Xorriso_show_devices(struct XorrisO *xorriso, int flag);