Help - Search - Members - Calendar
Full Version: Mass-embedding CUE&LOGs to lossless files
Hydrogenaudio Forums > Lossless Audio Compression > Lossless / Other Codecs
djet
Those extra .cue files were cluttering my fb2k database so I decided to embed them to the lossless files and rename to .cuesheet — that way they won't be indexed.

I've written a script, but it has some limitations and the search algorythm is rather dumb. Here is the code:
CODE
@ECHO OFF

if "%~1"=="" (
echo Usage: Create a shortcut to this script and drop folders to it OR
echo Usage: use command line: embed-cues.cmd "Path to directory"
echo.
echo WARNING: it works recursively for all the subdirectories of the given path.
echo Note: Don't forget to download the TAG utility and edit the correspoding script line.
echo.
pause
goto :EOF
)
:: Written by djet [HQShare.net], 2005
  SET version=0.99
:: Last Modification: 16.12.2005

TITLE=djet's little CUE&LOG embedder, Version %version%

:: This scripts uses a modded version of Case's TAG utility. Download it here:
:: http://www.synthetic-soul.co.uk/tag/
:: Don't forget to write the correct path below:
SET Tag="s:\Multimedia\Soundz Good\Tag\Tag.exe"

CLS

setlocal ENABLEDELAYEDEXPANSION
pushd %1
for /r %%C in (*.cue) do (
    ::some unfinished ideas..
    FOR /F "usebackq TOKENS=*" %%f IN (`findstr /B "FILE " "%%C"`) DO SET cueline=%%f
    ::echo !cueline!
    ::set cuefile=!cueline:~6,-6!
    ::echo !cuefile!
    ::if exist "%%~dpC%cuefile%" echo "%%~dpC%cuefile%" exists.
    :: embedding the CUE(s)
    %Tag% -f "CUESHEET=%%C" "%%~dpnC*.*"
    ::embedding Log(s). not a good idea to search for ALL log files in folder.. don't have others though =/
    for  %%L in ("%%~pC*.log") do %Tag% -f "LOGFILE=%%~fL"  "%%~dpnC*.*"
 ::Log with a matching filename has higher priority
    %Tag% -f "LOGFILE=%%~nC.log"  "%%~dpnC*.*"
    ::Rename the .CUE file to .CUESHEET to avoid duplicate entries in the fb2k database
    ren "%%C" "%%~nC.cuesheet"
)
popd
endlocal
pause

(hehe, the forum engine stripped all the tabs.. In the editor it looks better =)

Maybe there is a better solution?
Cosmo
QUOTE (djet @ Dec 18 2005, 02:48 PM)
Those extra .cue files were cluttering my fb2k database so I decided to embed them to the lossless files and rename to .cuesheet — that way they won't be indexed.

Does adding *.CUE to the file type exclude list not work for you?
djet
QUOTE
Does adding *.CUE to the file type exclude list not work for you?

Unless all lossless files had CUEs embedded I won't exclude *.CUE. Some other points are: when I drop or enqueue a folder they are added too; also it's a question of consistency.
Synthetic Soul
I can't think of a better solution... that's why I had to mod Tag. I'm glad that someone else has found it useful.

NB: You may want to link to my new website (URL below) - although the address you use should redirect to the new site now/for the moment.
gmB
Thanks for this, exactly what I needed now.

There's one little drawback though. My logfiles contain the ";" character. At these position a new tag is created.
So instead of
LOGFILE=44.100 Hz; 16 Bit; Stereo
I get
LOGFILE=44.100 Hz
LOGFILE=16Bit
LOGFILE=Stereo
How can I fix this? Sorry, I'm not familiar with scripting.

Thanks in advance.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.