mame icon indicating copy to clipboard operation
mame copied to clipboard

refactor chdman extractcd to allow split .bin/.cue output

Open landfillbaby opened this issue 1 year ago • 7 comments

My partial solution to #5867 (only partial because it doesn't fix round-trip support fully, such as #10308). Full list of things this does to chdman:

  • Adds a -os/--splitcue option to extractcd to force output to .cue mode and output individual .bins, naming them basename (Track n).bin if there is more than 1 track.
    • n will be 1 digit if there are less than 10 tracks in the CD, 2 digits otherwise.
    • .bin will be replaced by the file extension specified by -ob/--outputbin if applicable.
    • Its short name is -os in case the existing -s/--size option is used for extractcd in future.
  • This new method also applies to .gdi output. Should I change this?
    • Output filenames will be different: no longer outputs audio files as .raw, format is as above instead of just appending the track number as 2 digits.
    • Deletes all bin files on error instead of just the last one before the error.
    • The percentage of completion no longer resets to 0 for each track, so it will actually say near 100% at completion.
  • Checks output filename ends with .cue or .gdi, case insensitive, instead of just doing a case sensitive search for them anywhere in the filename.
  • Removes unused -ob/--outputbin option from extractdvd.
  • Updates its manpage, adding the missing createdvd and extractdvd documentation too.

Tell me if any changes should be made :)

landfillbaby avatar Nov 12 '23 14:11 landfillbaby

OK it's definitely ready for merge now! I fixed a regression I made in the 2nd commit!

landfillbaby avatar Nov 19 '23 18:11 landfillbaby

Would it be possible to squash all the commits so it's easier to review?

rb6502 avatar Nov 19 '23 18:11 rb6502

done. you might want to run CI again

landfillbaby avatar Nov 19 '23 18:11 landfillbaby

ok actually this doesn't work at all... i fix it tomorrow

landfillbaby avatar Nov 19 '23 22:11 landfillbaby

Yeah, as far as I know there's no such thing as split CDRDAO (bin/toc) format.

rb6502 avatar Nov 20 '23 00:11 rb6502

The option is now --splitcue and forces output to be in .bin/.cue mode, issuing a warning if -o doesn't end with .cue. Should it be an error instead?

I tested it, it works and is ready for merge other than that.

There is no split .toc mode. Maybe I'll look into it further later.

The old broken version is at 70e8418b4f91135f6295a46842376d41f1866eaa.

landfillbaby avatar Nov 20 '23 13:11 landfillbaby

re: .toc support I'm not sure if cdrdao supports extracting .tocs with each track as a new file, but the .toc format itself does support using multiple files. Here's an example from the official cdrdao website showing it off at the bottom: https://cdrdao.sourceforge.net/example.html#secret

987123879113 avatar Dec 09 '23 19:12 987123879113

closing in favour of #12191 :)

landfillbaby avatar Mar 29 '24 15:03 landfillbaby