enzo1982 / freac

The fre:ac audio converter project
https://www.freac.org/
GNU General Public License v2.0
1.43k stars 76 forks source link

Include output file name in CLI output #474

Open ChrisOstler opened 1 year ago

ChrisOstler commented 1 year ago

Is your feature request related to a problem? Please describe. I use the CLI for automated disc ripping, including using CDDB information to generate output directory and file name. However, since I don't know where the ripped files were written I cannot perform any action on them after ripping completes.

Describe the solution you'd like CLI output currently shows the track being ripped:

Processing file: Audio CD 0 - Track 1...

This could be expanded to include the output file name:

Processing file: Audio CD 0 - Track 1 => {output file}...

Describe alternatives you've considered For an automation use case, it would be nice to have something similar to MakeMKV's "robot" mode that can also include progress updates, etc, but this is a much more significant change.

Additional context A patch like the following may work. I'm unable to test it, yet, as I haven't figured out how to get all the encoders, etc. set up to work with a local development version of Fre:AC.

diff --git a/src/startconsole.cpp b/src/startconsole.cpp
index 76c00f90..eb52493f 100755
--- a/src/startconsole.cpp
+++ b/src/startconsole.cpp
@@ -656,7 +656,14 @@ Void freac::freacCommandline::OnEncodeTrack(const Track &track, const String &de
                if (currentFile == previousFile) return;
                else                             previousFile = currentFile;

-               if (currentFile.StartsWith("device://cdda:")) currentFile = String("Audio CD ").Append(String::FromInt(config->GetIntValue(Config::CategoryRipperID, Config::RipperActiveDriveID, Config::RipperActiveDriveDefault))).Append(" - Track ").Append(currentFile.Tail(currentFile.Length() - 16));
+               if (currentFile.StartsWith("device://cdda:"))
+               {
+                       String          outputFile = Utilities::GetOutputFileName(config, track);
+                       currentFile = String("Audio CD ")
+                               .Append(String::FromInt(config->GetIntValue(Config::CategoryRipperID, Config::RipperActiveDriveID, Config::RipperActiveDriveDefault)))
+                               .Append(" - Track ").Append(currentFile.Tail(currentFile.Length() - 16))
+                               .Append(" => ").Append(outputFile);
+               }

                if (!firstFile) Console::OutputString("done.\n");
                else            firstFile = False;