Quote:
Originally Posted by jolson
What one with all his CD's ripped to a music server would need is a "HDCD Check Spider" that gets a top folder as input and outputs a nice list of all HDCD tracks in the subfolders in a log file.
|
Just read this and was intrigued, so I knocked up a batch script. I was pleasantly surprised to find out I had two HDCDs I never knew I had! Beck and the Beach Boys. So thanks very much to Chris and Madshi for their work on this.
Anyway, in the off-chance that anyone else finds it useful the script is below. It uses Madshi's all-conquering eac3to tool so you'll need that too. The script is not very smart. It assumes that eac3to will output a line to it's log that looks like
FLAC, something, something, something <HDCD>, something...
If this changes it won't work.
Save the text with notepad to a .cmd file (say hdcd.cmd) to the desktop or wherever, changing the set eac3to= line to your eac3to path, and the set type= line to wav if your music isn't flac. Then drag your top music folder onto the script icon and wait... Or test on a small folder of flac files first of course.
It will output two text files - one (probably very big) with non-HDCD filenames and one (probably very small) with the HDCD filenames.
NB. This works for me on WinXP. I don't know enough about batch scripts to know whether this works on Vista or not.
Code:
::-------------------------------------------------------------------------------------------------
:: Check files for HDCD encoding
:: Writes two text files to source directory - hdcd files.txt and non hdcd files.txt
::-------------------------------------------------------------------------------------------------
@echo off
:: change these two
set eac3to=D:\Vtemp\programs\eac3to\eac3to.exe
set type=flac
:: set other variables and create new files
set sourcedir=%1
set sourcedir=%sourcedir:"= %
if "%sourcedir:~0,1%"==" " set sourcedir=%sourcedir:~1,-1%
echo HDCD files>"%sourcedir%\hdcd files.txt"
echo non HDCD files>"%sourcedir%\non hdcd files.txt"
if exist "%sourcedir%\eac3to.log" del "%sourcedir%\eac3to.log"
for /f "usebackq tokens=1 delims=" %%A in (`dir "%sourcedir%\*.%type%" /b /s /on`) do (
call :sub1 "%%A"
)
pause
exit /b 0
::-------------------------------------------------------------------------------------------------
:sub1
set inflac=%1
"%eac3to%" %inflac% -log="%sourcedir%\eac3to.log"
for /f "usebackq tokens=1-6 delims=," %%A in ("%sourcedir%\eac3to.log") do (
if "%%A"=="FLAC" set hdcdcheck="%%D"
)
if "%hdcdcheck:~-6,-2%"=="HDCD" (
echo %inflac%>>"%sourcedir%\hdcd files.txt"
) else (
echo %inflac%>>"%sourcedir%\non hdcd files.txt"
)
del "%sourcedir%\eac3to.log"
exit /b 0