Changed layout of xorriso style write pacifier line

This commit is contained in:
Thomas Schmitt 2008-11-30 21:41:46 +00:00
parent 8a5540c974
commit dad02dc7ad
3 changed files with 44 additions and 25 deletions

View File

@ -14458,7 +14458,7 @@ bd_speed:;
is_cd= (ret==2);
if(is_cd)
goto cd_speed;
else if (profile_name[0]=='B' && profile_name[1]=='D')
else if (ret == 3)
goto bd_speed;
else
goto dvd_speed;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.11.30.123700"
#define Xorriso_timestamP "2008.11.30.214121"

View File

@ -1128,8 +1128,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2);
if(ret == 2)
pacifier_speed= 1;
else if(ret == 1 && (profile_number == 0x41 || profile_number == 0x42 ||
profile_number == 0x43))
else if(ret == 3)
pacifier_speed= 2;
ret= isoburn_igopt_new(&sopts, 0);
@ -1516,7 +1515,7 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
{
int ret, size, free_bytes, i, aborting= 0, emul, buffer_fill= 50, last_sector;
struct burn_progress progress;
char *status_text, date_text[80];
char *status_text, date_text[80], *speed_unit, mem_text[8];
enum burn_drive_status drive_status;
double start_time, current_time, last_time, base_time= 0.0, base_count= 0.0;
double next_base_time= 0.0, next_base_count= 0.0, first_base_time= 0.0;
@ -1532,10 +1531,14 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
fract_offset= 0.2 * (double) emul - ((int) (0.2 * (double) emul));
if(emul==0)
emul= xorriso->pacifier_style;
if(flag&16)
speed_unit= "D";
if(flag&16) {
speed_factor= 150.0*1024;
else if(flag & 32)
speed_unit= "C";
} else if(flag & 32) {
speed_factor= 4495625;
speed_unit= "B";
}
progress.sector= 0;
current_time= Sfile_microtime(0);
while(1) {
@ -1546,6 +1549,14 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
break;
current_time= Sfile_microtime(0);
if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) {
if(current_time-last_time>0.2)
measured_speed= (progress.sector - last_sector) * 2048.0 /
(current_time - last_time);
buffer_fill= 50;
if(progress.buffer_capacity>0)
buffer_fill= (double) (progress.buffer_capacity
- progress.buffer_available) * 100.0
/ (double) progress.buffer_capacity;
if(emul==2) {
if(progress.sector<=progress.sectors)
sprintf(xorriso->info_text, "%4d of %4d MB written",
@ -1564,20 +1575,12 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
" (fifo %2d%%)",
(int) (100.0-100.0*((double) free_bytes)/(double) size));
buffer_fill= 50;
if(progress.buffer_capacity>0)
buffer_fill= (double) (progress.buffer_capacity
- progress.buffer_available) * 100.0
/ (double) progress.buffer_capacity;
sprintf(xorriso->info_text+strlen(xorriso->info_text), " [buf %3d%%]",
buffer_fill);
if(current_time-last_time>0.2) {
measured_speed= (progress.sector - last_sector) * 2048.0 /
(current_time - last_time);
if(current_time-last_time>0.2)
sprintf(xorriso->info_text+strlen(xorriso->info_text), " %4.1fx.",
measured_speed/speed_factor);
}
} else if(emul == 1 &&
progress.sectors > 0 && progress.sector <= progress.sectors) {
@ -1626,16 +1629,29 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
}
}
} else {
if(progress.sector<=progress.sectors)
sprintf(xorriso->info_text, "Writing: sector %d of %d",
progress.sector, progress.sectors);
else
sprintf(xorriso->info_text, "Writing: sector %d", progress.sector);
if(progress.sector<=progress.sectors) {
if(progress.sectors <= 0)
strcpy(mem_text, "99.9");
else
sprintf(mem_text, "%4.1f",
100.0 * ((double) progress.sector) / ((double) progress.sectors));
mem_text[4]= 0;
sprintf(xorriso->info_text, "Writing: %10ds %s%% ",
progress.sector, mem_text);
} else {
Sfile_scale(2048.0 * (double) progress.sector, mem_text, 5, 1e4, 1);
sprintf(xorriso->info_text, "Writing: %10ds %s ",
progress.sector, mem_text);
}
ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text);
if(ret>0 )
sprintf(xorriso->info_text+strlen(xorriso->info_text),
" [fifo %s, %2d%% fill]", status_text,
(int) (100.0-100.0*((double) free_bytes)/(double) size));
" fifo %3d%% buf %3d%%",
(int) (100.0-100.0*((double) free_bytes)/(double) size),
buffer_fill);
if(current_time-last_time>0.2)
sprintf(xorriso->info_text+strlen(xorriso->info_text), " %5.1fx%s ",
measured_speed/speed_factor, speed_unit);
}
} else if(drive_status == BURN_DRIVE_CLOSING_SESSION ||
drive_status == BURN_DRIVE_CLOSING_TRACK)
@ -7248,8 +7264,7 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
ret= Xorriso_get_profile(xorriso, &profile_number, profile_name, 2);
is_cd= (ret==2);
is_bd= (profile_number == 0x41 || profile_number == 0x42 ||
profile_number == 0x43);
is_bd= (ret == 3);
if(isoburn_needs_emulation(drive)) {
if(flag&1) {
@ -7329,6 +7344,7 @@ ex:;
/* @param flag bit1= outdev rather than indev
@return <0 error, 0 = no profile to see , 1= ok , 2= ok, is CD profile
3= ok, is BD profile
*/
int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number,
char profile_name[80], int flag)
@ -7351,6 +7367,9 @@ int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number,
return(ret);
if(*profile_number==0x08 || *profile_number==0x09 || *profile_number==0x0a)
return(2);
if(*profile_number == 0x40 || *profile_number == 0x41 ||
*profile_number == 0x42 || *profile_number == 0x43)
return(3);
return(0);
}