diff --git a/libburn/trunk/test/telltoc.c b/libburn/trunk/test/telltoc.c index 0dd4233b..483e6228 100644 --- a/libburn/trunk/test/telltoc.c +++ b/libburn/trunk/test/telltoc.c @@ -321,7 +321,7 @@ int telltoc_speedlist(struct burn_drive *drive) continue; printf("Speed descr. : %d kB/s", sd->write_speed); if (sd->end_lba >= 0) - printf(", %.f MiB", ((double) sd->end_lba) / 512.0); + printf(", %.1f MiB", ((double) sd->end_lba) / 512.0); if (sd->profile_name[0]) printf(", %s", sd->profile_name); printf("\n"); @@ -331,6 +331,48 @@ int telltoc_speedlist(struct burn_drive *drive) } +int telltoc_formatlist(struct burn_drive *drive) +{ + int ret, i, status, num_formats, profile_no, type; + off_t size; + unsigned dummy; + char status_text[80], profile_name[90]; + + ret = burn_disc_get_formats(drive, &status, &size, &dummy, + &num_formats); + if (ret <= 0) { + fprintf(stderr, "SORRY: Cannot obtain format list info\n"); + return 2; + } + if (status == BURN_FORMAT_IS_UNFORMATTED) + sprintf(status_text, "unformatted, up to %.1f MiB", + ((double) size) / 1024.0 / 1024.0); + else if(status == BURN_FORMAT_IS_FORMATTED) + sprintf(status_text, "formatted, with %.1f MiB", + ((double) size) / 1024.0 / 1024.0); + else if(status == BURN_FORMAT_IS_UNKNOWN) { + burn_disc_get_profile(drive, &profile_no, profile_name); + if (profile_no > 0) + sprintf(status_text, "intermediate or unknown"); + else + sprintf(status_text, "no media or unknown media"); + } else + sprintf(status_text, "illegal status according to MMC-5"); + printf("Format status: %s\n", status_text); + + for (i = 0; i < num_formats; i++) { + ret = burn_disc_get_format_descr(drive, i, + &type, &size, &dummy); + if (ret <= 0) + continue; + printf("Format descr.: %2.2Xh , %.1f MiB (%.fs)\n", + type, ((double) size) / 1024.0 / 1024.0, + ((double) size) / 2048.0); + } + return 1; +} + + int telltoc_toc(struct burn_drive *drive) { int num_sessions = 0 , num_tracks = 0 , lba = 0; @@ -475,7 +517,7 @@ static int do_media = 0; static int do_toc = 0; static int do_msinfo = 0; static int print_help = 0; -static int do_speedlist = 0; +static int do_capacities = 0; /** Converts command line arguments into above setup parameters. @@ -512,8 +554,8 @@ int telltoc_setup(int argc, char **argv) } else if (!strcmp(argv[i], "--msinfo")) { do_msinfo = 1; - } else if (!strcmp(argv[i], "--speedlist")) { - do_speedlist = 1; + } else if (!strcmp(argv[i], "--capacities")) { + do_capacities = 1; } else if (!strcmp(argv[i], "--toc")) { do_toc = 1; @@ -531,7 +573,7 @@ int telltoc_setup(int argc, char **argv) if (print_help) { printf("Usage: %s\n", argv[0]); printf(" [--drive
|