Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: REACT 2 Released (Read 1280259 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

REACT 2 Released

Reply #1225
I only use replaygain/apply gain in track(radio) mode, not album(audiophile) mode as I shuffle rather than listen to albums completely.  I wanted to use wavegain to get the scale so that could be applied by lame rather than using the less accurate (and admittedly probably not noticeable) mp3gain or oggenc way to apply radio gain.  So I changed track.cfg to do the following:
...
Does that explain what and why better for you?

Yeah, now when you revealed more details. Thanks for sharing.

P.S. You can use CODEBOX tags to wrap long code listings.. or CODE tags for short listings.

REACT 2 Released

Reply #1226
eeyore_pooh, hope the code below is of help to you.  Note that I use track.cfg and a custom batch file name.  I've altered all my cue sheets to point to .flac (as opposed to .wav).

Thanks for trying but (the dreaded but) the problem is with this code:

Code: [Select]
ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.flac" -o %trackCueFile%>>update-cueslogs.bat

There's no way we can use the @basename@ variable in image configs to define the track filenames in the cuefile. It doesn't work, remember that the actual flac track files are being made by ACDIR (and flac of course) by taking the track info from the cuefile.. EAC doesn't create the track wav files (but it creates the cuefiles). I hope you understood (This is the second explanation version and I'm not so fluent in English).

By the way, have you tested that the code you listed actually works in your setup? I quickly found couple of problems in it.

1. You should append the ECHO CHCP 1252... code to update-cueslogs.bat first before anything else
2. You can't copy the EAC logfile until EAC has finished ripping, so, the copy eaclog should be in the post-processing section
3. Other strange logfile problems

Also I've a better solution for the eaclog amends (it's included in the corrected code below); you don't have to change the temp directory references (C::\Working\...) by hand anymore. My code escapes the colon ( : ) character. Also, it removes the Filename string in the beginning.

Here's my corrected/enhanced suggestion to you:
Code: [Select]
SET trackCueFile="$cdartist$ - $album$.cue"
SET eacLogFile="$cdartist$ - $album$.log"

IF NOT EXIST %trackCueFile% (
    COPY "@albumfile@.[mg].cue" %trackCueFile%
    ECHO CHCP 1252 ^| PROMPT>>update-cueslogs.bat
)

ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.flac" -o %trackCueFile%>>update-cueslogs.bat

REM ** Escape : chars and save all GSAR commands to amend the EAC log file.
SET EscapedSourcedir=@sourcedir@
SET EscapedSourcedir=%EscapedSourcedir::=::%
ECHO @tools@\GSAR.EXE "-sFilename %EscapedSourcedir%\@basename@.wav" "-r%TrackName%.flac" -o %eacLogFile%>>update-cueslogs.bat

And the following should be in your post-processing section:
Code: [Select]
REM ** Copy log to destination folder.
COPY /Y "@eaclog@" %eacLogFile%

REM ** Escape % chars and run all GSAR commands to amend cuesheet and EAC log files.
@tools@\GSAR.EXE -s%% -r%%%% -o update-cueslogs.bat
CALL update-cueslogs.bat
DEL update-cueslogs.bat

That's it. It should work ok now.

REACT 2 Released

Reply #1227
Akkurat, the code I posted yesterday is working in my "track" setup.  I don't create image files, I just thought it could be useful, maybe not, and I apologize if I complicated things for eeyore_pooh.

As for your suggestions, perhaps I have something defined elsewhere that is making it functional.  I'm all for taking on your enhancements, but I'm afraid that I may create a problem where I currently don't have one.  I am successfully editing both the cuesheet and eac log file with minimal exception.

The only glitch I have is when certain characters in a song title (like "&") will break the edit inside the cuecheet or log file.  I'll end up with the original text.  Here is an example of a broken one inside an amended eac log.

It currently says:
Code: [Select]
Filename C:\Working\Beastie Boys - Licensed To Ill - 01 - Rhymin & Stealin.wav


I want it to say:
Code: [Select]
Filename "Rhymin & Stealin.flac"


I guess I'd be willing to make your changes if I could somehow resolve that minor (but somewhat annoying) issue. 



Thanks for trying but (the dreaded but) the problem is with this code:

Code: [Select]
ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.flac" -o %trackCueFile%>>update-cueslogs.bat

There's no way we can use the @basename@ variable in image configs to define the track filenames in the cuefile. It doesn't work, remember that the actual flac track files are being made by ACDIR (and flac of course) by taking the track info from the cuefile.. EAC doesn't create the track wav files (but it creates the cuefiles). I hope you understood (This is the second explanation version and I'm not so fluent in English).

By the way, have you tested that the code you listed actually works in your setup? I quickly found couple of problems in it.

1. You should append the ECHO CHCP 1252... code to update-cueslogs.bat first before anything else
2. You can't copy the EAC logfile until EAC has finished ripping, so, the copy eaclog should be in the post-processing section
3. Other strange logfile problems

Also I've a better solution for the eaclog amends (it's included in the corrected code below); you don't have to change the temp directory references (C::\Working\...) by hand anymore. My code escapes the colon ( : ) character. Also, it removes the Filename string in the beginning.

Here's my corrected/enhanced suggestion to you:
Code: [Select]
SET trackCueFile="$cdartist$ - $album$.cue"
SET eacLogFile="$cdartist$ - $album$.log"

IF NOT EXIST %trackCueFile% (
    COPY "@albumfile@.[mg].cue" %trackCueFile%
    ECHO CHCP 1252 ^| PROMPT>>update-cueslogs.bat
)

ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.flac" -o %trackCueFile%>>update-cueslogs.bat

REM ** Escape : chars and save all GSAR commands to amend the EAC log file.
SET EscapedSourcedir=@sourcedir@
SET EscapedSourcedir=%EscapedSourcedir::=::%
ECHO @tools@\GSAR.EXE "-sFilename %EscapedSourcedir%\@basename@.wav" "-r%TrackName%.flac" -o %eacLogFile%>>update-cueslogs.bat

And the following should be in your post-processing section:
Code: [Select]
REM ** Copy log to destination folder.
COPY /Y "@eaclog@" %eacLogFile%

REM ** Escape % chars and run all GSAR commands to amend cuesheet and EAC log files.
@tools@\GSAR.EXE -s%% -r%%%% -o update-cueslogs.bat
CALL update-cueslogs.bat
DEL update-cueslogs.bat

That's it. It should work ok now.

REACT 2 Released

Reply #1228
Akkurat, I wanted to formally thank you for picking up the REACT project.  I've been using your mod for about a month.  I'd have to say it's worked very well.  Love being able to grab the artwork before waiting for cuesheet creation!

The feedback I wanted to share is in regards to the focus of the window at two different times.  I read yesterday in one of the threads that someone has already mentioned the lack of focus when you launch REACT/EAC.  I wanted to second that request.  It would be helpful for the times when no freedb edits are necessary.

The second focus item (which I'm not sure if it's been mentioned) is that the eac window loses focus after editing a field like cd title.  After I make my edit, I'll hit the Tab key to change fields and the window loses focus.  I've noticed it also does this if I hit Enter to "save" a field I just modified.  Another example is if I update the CD artist field and just try to click to a new field.  In all these cases the focus of the window is lost.  Just looking to save mouse and keyboard actions where I can.  I still have 2/3 my collection to go!

REACT 2 Released

Reply #1229
As for your suggestions, perhaps I have something defined elsewhere that is making it functional.  I'm all for taking on your enhancements, but I'm afraid that I may create a problem where I currently don't have one.  I am successfully editing both the cuesheet and eac log file with minimal exception.

The only glitch I have is when certain characters in a song title (like "&") will break the edit inside the cuecheet or log file.  I'll end up with the original text.  Here is an example of a broken one inside an amended eac log.

It currently says:
Code: [Select]
Filename C:\Working\Beastie Boys - Licensed To Ill - 01 - Rhymin & Stealin.wav


I want it to say:
Code: [Select]
Filename "Rhymin & Stealin.flac"


I guess I'd be willing to make your changes if I could somehow resolve that minor (but somewhat annoying) issue. 

Well, how I see it? It's not working if you have issues.  Let me guess, is this happening always with the first track only? Try my code, please, you might be surprised, it could fix your problems (I'm promising 99,99% certaintity ). What can you lose? Backup your old file. Make those small changes I posted, and test. Should take only little time and you could gain a working solution.

Also the excessive quotes in the one command you have might have something to do with it (although I have to admit that it seems to be correctly escaped as instructed in the guide.. but still.. I'd use the decimal or hex escape method, I don't trust that "replace one instance with three" thing.. plus it's more difficult to read and one can make mistakes more easily because of that).

Also note that the %TrackName% variable is taken from the INI and its default setting is (for "single" artist) $track$ - $title$. So, if you want to change the EAC log to only show the track title, you can't use %TrackName% (I bet that you have track numbers in your filenames, right?). Here's the corrected code for that part in my code example I posted earlier (I also removed the Filename string removal):
Code: [Select]
ECHO @tools@\GSAR.EXE "-s%EscapedSourcedir%\@basename@.wav" "-r:034$title$.flac:034" -o %eacLogFile%>>update-cueslogs.bat

Note the :034 strings, those should wrap your track name in quotes. Now the output should be like you wanted: Filename "<track title>".

REACT 2 Released

Reply #1230
Akkurat, I wanted to formally thank you for picking up the REACT project.  I've been using your mod for about a month.  I'd have to say it's worked very well.  Love being able to grab the artwork before waiting for cuesheet creation!

The feedback I wanted to share is in regards to the focus of the window at two different times.  I read yesterday in one of the threads that someone has already mentioned the lack of focus when you launch REACT/EAC.  I wanted to second that request.  It would be helpful for the times when no freedb edits are necessary.

The second focus item (which I'm not sure if it's been mentioned) is that the eac window loses focus after editing a field like cd title.  After I make my edit, I'll hit the Tab key to change fields and the window loses focus.  I've noticed it also does this if I hit Enter to "save" a field I just modified.  Another example is if I update the CD artist field and just try to click to a new field.  In all these cases the focus of the window is lost.  Just looking to save mouse and keyboard actions where I can.  I still have 2/3 my collection to go!

I have noticed this before and it's bugging me also. It's happening when editing the CD Artist OR CD Title fields. Also there's an other problem (from my bug list): Sometimes the EAC window title doesn't show REACT information unless you change focus to other program and back. Happens also when focusing on the CD Artist OR CD Title field and then de-focusing WITHOUT changing the contents of that field.

All these three issues are connected, I haven't had the time to dig deeper yet but I know where to start (main program loop). Without knowing better, currently I'm thinking that it's a 50/50 chance that this could be fixed.

About the "no freedb edits are necessary" thing; I recently, by accident, noticed that one freedb query brought one track title with an extra space at the end of it! It's impossible to see this unless you at least select the track names (there's a certain length that the selection color exceeds the track title when selected). Or if you want to be sure, you have to "open the edit field" for every track. A BIG PITA!  Do NOT trust the freedb data, I've noticed that there's so much splelling erors that I go thru every track name for every new CD with a toothcomb. Takes more time but at least I can get results that will fulfill my insane drive for perfection.  Seriously though, if music is your hobby, you should put some time to it..

Thanks for reporting and seconding the first one.  And thanks for the thanks. I appreciate it much.

REACT 2 Released

Reply #1231
Akkurat, thanks for the new code.  I've put it in and as you predicted it is working perfectly.  It now does not break when an "&" is in the song title.  Thanks so much!

ps- may not matter now, but for filenames, I use "song title.flac."  With various artists, I use "track artist - song title.flac"

Well, how I see it? It's not working if you have issues.  Let me guess, is this happening always with the first track only? Try my code, please, you might be surprised, it could fix your problems (I'm promising 99,99% certaintity ). What can you lose? Backup your old file. Make those small changes I posted, and test. Should take only little time and you could gain a working solution.

Also the excessive quotes in the one command you have might have something to do with it (although I have to admit that it seems to be correctly escaped as instructed in the guide.. but still.. I'd use the decimal or hex escape method, I don't trust that "replace one instance with three" thing.. plus it's more difficult to read and one can make mistakes more easily because of that).

Also note that the %TrackName% variable is taken from the INI and its default setting is (for "single" artist) $track$ - $title$. So, if you want to change the EAC log to only show the track title, you can't use %TrackName% (I bet that you have track numbers in your filenames, right?). Here's the corrected code for that part in my code example I posted earlier (I also removed the Filename string removal):
Code: [Select]
ECHO @tools@\GSAR.EXE "-s%EscapedSourcedir%\@basename@.wav" "-r:034$title$.flac:034" -o %eacLogFile%>>update-cueslogs.bat

Note the :034 strings, those should wrap your track name in quotes. Now the output should be like you wanted: Filename "<track title>".

REACT 2 Released

Reply #1232
Akkurat, thanks for the new code.  I've put it in and as you predicted it is working perfectly.  It now does not break when an "&" is in the song title.  Thanks so much!

ps- may not matter now, but for filenames, I use "song title.flac."  With various artists, I use "track artist - song title.flac"

Fantastic! Working perfectly? Fingers crossed.  I'm happy that this was so easily solved.. now to tackle your RG problem in the other thread.

You don't have track numbers in filenames? Ok. In that case, you can then use the %TrackName% in the code if you like (that way you get the various artists filename scheme to show up in your logs).

REACT 2 Released

Reply #1233
I'm experiencing some weirdness with Various Artist albums.  I ran in debug mode and what I've found is that even though EAC shows the Various Artists check box checked, the @various@ variable is passed as 0.

The files end up being stored in a folder named with the first track artist instead of Various or Various Artists.

How do I fix this?

REACT 2 Released

Reply #1234
I'm experiencing some weirdness with Various Artist albums.  I ran in debug mode and what I've found is that even though EAC shows the Various Artists check box checked, the @various@ variable is passed as 0.

The files end up being stored in a folder named with the first track artist instead of Various or Various Artists.

How do I fix this?
Short answer: If the checkbox is checked, uncheck and re-check it to ensure that the artist name will be "Various".

Long answer: How to fix it? First, it's not REACT's fault. It's related to how EAC functions AND freedb sending artist strings that are NOT "Various" or "Various Artists" (freedb suggested values). The greyed out "CD Artist" field with "Various" value is NOT a guarantee of the CD being recognized as "Various". I'm sorry but that's how it is. Check Synthetic Soul's REACT: Notes for developers, or anyone writing an interim application post.

Last I have talked about this was in March with nago (publicly & privately), he had some users with this problem (and fixing this absolutely requires test user(s) with this problem.. I can't test this because if I change the artist field myself, the test situation is dramatically changed.. I need to have a "crap" freedb query result to test this.. and I haven't found a various artists CD which could be used to do this) but the conversation kind of died (nago, if you're reading, maybe we should pick up the pieces and see what could be done?). I actually did one test version, which I still have, but I never got any results back. I remember that the test version was based on the "If the checkbox is checked, uncheck and re-check it to ensure that the artist name will be "Various"." suggestion by Synthetic Soul. But it was not so good solution because, IIRC, it didn't work consistently (EAC's fault, read the "publicly" link above). I also could try to fix it with "Check whether track names are using the "<artist> / <title>" format." suggestion. This may be a better approach since we don't have to rely on the IMHO poorly executed EAC "VA"/artist functionality.

Anyways, this is in my now quite long TODO list (I'm working on it right now.. and I've already fixed couple of things), but it's in the back of the list as MAYBE.. like I stated back then in February: "... it could be counted to be more as an EAC problem than an REACT problem and fixing this in REACT could be hard.. or even impossible".

Maybe you could act as a test user for this? PM me your email so I can send you the test version and instructions. EDIT: (not "absolutely" needed anymore but if you want to.. I'll test this myself first so it could take some time before I'd contact you)  One question: you wrote the album in plural, does this really happen with only one CD or with many.. or ALL?

REACT 2 Released

Reply #1235
I can't test this because if I change the artist field myself, the test situation is dramatically changed.. I need to have a "crap" freedb query result to test this..
This post may be of use.

I  exported my EAC database to a local freedb database*, which meant that  I could edit my test CD entry and reload it for testing.
  ...
* To create a local freedb database of your EAC database:
  • "EAC" > "freedb / Database Options..." > "Local freedb" tab to set the location
  • "Database" > "Export CD Information To" > "Local freedb"
To reload data after changing the text file: "Database" > "Get CD Information From" > "Local freedb"[/size]
I'm on a horse.


REACT 2 Released

Reply #1237
@Akkurat: I'm not sure if this has been reported earlier. I've been experiencing problems with the image name not being properly set in the EAC file dialog. The problems went away when adding a pause (inspired by Synthetic Soul's version), changing

Code: [Select]
; Makes sure that the correct image filename is set to the EAC input window.
    Local $loopcnt = 0
    Do
        ControlSetText($g_saveWaveformStr, "", "Edit1", $name)
        
        If $loopcnt > 0 Then fDebugPrint("Retrying... setting image filename")
        $loopcnt += 1
        
    Until $name = ControlGetText($g_saveWaveformStr, "", "Edit1")

to

Code: [Select]
; Makes sure that the correct image filename is set to the EAC input window.
    Local $loopcnt = 0
    Do
        ControlSetText($g_saveWaveformStr, "", "Edit1", $name)
        
        If $loopcnt > 0 Then fDebugPrint("Retrying... setting image filename")
        $loopcnt += 1
        Sleep(250)
        
    Until $name = ControlGetText($g_saveWaveformStr, "", "Edit1")

It must have been a timing issue of the dialog closing too soon and reverting to EAC's default naming scheme, or something. I hope this helps in some way and would love to see it get added to the next version.

REACT 2 Released

Reply #1238
@Akkurat: I'm not sure if this has been reported earlier. I've been experiencing problems with the image name not being properly set in the EAC file dialog. The problems went away when adding a pause (inspired by Synthetic Soul's version)

It must have been a timing issue of the dialog closing too soon and reverting to EAC's default naming scheme, or something. I hope this helps in some way and would love to see it get added to the next version.

Yes you're the 3rd one to report this kind of behaviour. Are you using Vista by any chance? Thanks for the suggestion, I'll definitely test it with the other user (Realityfreak) who's having this problem.

Still, I'm little bit baffled by this because my code (do...until) is a infinitive loop unless the correct image name is set to the save dialog (and correctly read by the ControlGetText). Does your save dialog close itself with wrong image names?

I have had "enhance image name save loop" in my TODO for a while.. the basic idea was to remove the infinitive nature of the code.. because that's poor coding.  I also have added couple of new ideas to enhance this section.. are you interested to test these with me? (PM me your email) I really would like to understand why these problems/"anomalies" happen than "blindly" apply a patch.

P.S. Does anyone understand why the code continues to move beyond the until... line if the correct image name is NOT in the save dialog?

REACT 2 Released

Reply #1239
@Akkurat: I'm not sure if this has been reported earlier. I've been experiencing problems with the image name not being properly set in the EAC file dialog. The problems went away when adding a pause (inspired by Synthetic Soul's version)

Yes you're the 3rd one to report this kind of behaviour. Are you using Vista by any chance? Thanks for the suggestion, I'll definitely test it with the other user (Realityfreak) who's having this problem.

Yes, I'm on vista.

Still, I'm little bit baffled by this because my code (do...until) is a infinitive loop unless the correct image name is set to the save dialog (and correctly read by the ControlGetText). Does your save dialog close itself with wrong image names?

Yes, it does. I too am a little baffled as your code looks like it should do what you intended. However, there's got to be some inconsistency there as far as Vista is concerned for some reason.

REACT 2 Released

Reply #1240
Hi
I have just upgraded to Lame 3.98 and went to copy both lame.exe and lame_enc.dll into the REACT2 Tools folder, when I noticed that previously only lame.exe was in there.

Can you confirm whether both files should be in this folder please. If so I'm not sure how it was working previously. Also I notice there is a file call lame.css as well, should that be in there as well.

Thanks

REACT 2 Released

Reply #1241
Yes, I'm on vista.

Yes, it does. I too am a little baffled as your code looks like it should do what you intended. However, there's got to be some inconsistency there as far as Vista is concerned for some reason.

Yesterday I "acquired" Vista Ultimate which I'm currently running in VPC and what I have tested so far, the problem is related to the dropdown feature of the field in the save dialog window (there's no dropdown feature in XP). For some reason AutoIt has problems reading the value from it (sometimes the GET method returns values from the dropdown menu history).. and incidentally increasing the time between the SET and GET seems to help a bit.. and what's funny, it seems to be a matter of fractions of a second if it's going to work or not.. very interesting to test since adding even simple debug points increase the time enough for the whole thing to act differently. Oh well, at least I'm on the right track.

I have just upgraded to Lame 3.98 and went to copy both lame.exe and lame_enc.dll into the REACT2 Tools folder, when I noticed that previously only lame.exe was in there.

Can you confirm whether both files should be in this folder please. If so I'm not sure how it was working previously. Also I notice there is a file call lame.css as well, should that be in there as well.

To be frank, I don't know for sure but I reckon that the lame.exe should be enough. That's what the original tools folder has. I don't have a clue what the css file is for (cascading style sheets in Mp3's?  ), I haven't seen it in tools folder before. See what it contains.

REACT 2 Released

Reply #1242
I’m using REACT2 [akku.b02] with EAC for ripping my CD collection. Hard disk space is not an issue for me at the moment and I store wav images and separate flac tracks with F10 command for each CD. I’m also using the Akkurat Backup Data Track Method which requires “CreateAllCuesheets” in the REACT.ini set to 1.
Is it possible to implement the gsar.exe tool to modify the [mg].cue (or all of them) from “.wav” WAVE to “.flac” WAVE for the separate flac tracks in the image.cfg. If at some point in the future I decide to keep only the flac tracks I’d like to have a proper corresponding cue file.
I’ve tried to add the track.cfg settings from the wiki article but obviously it’s far from the truth.

Hmm, well, the problem is that in image rips, the info for individual track filenames are pulled from the cuefile by ACDIR. So, there's no way of us using that information in the image config file like we can in track config. Also changing only the .wav" WAVE to .flac" WAVE most probably wouldn't work as expected because of the filename scheme & special character differences between EAC and REACT (and special char difference in ACDIR). I'm not so familiar with ACDIR but I can see that one can execute several commands in the --pipe switch... but this doesn't help us because we have no information of the filenames in the cuefile.

One possible method (very pseudocode example):
1. After the ACDIR has created all the flac files, traverse all those files with FOR (dos command).
2. Your goal is to match a flac filename & cuefile text string (basically you need to match the track number found in the flac file to a line in cuefile where there's the same track number, AND that line has also .wav" string).
3. Use GSAR in the same manner as in track config to change the file references with the info you just gathered from the flac files and from the cuefile.

Hard? Yes. I'm sorry.. I don't know a better way to solve this. If you manage to pull it off, please share your masterpiece.

Akkurat,
Many thanks for your assistance. I've tried different things but obviously because of ACDIR, bullet-proof workaround is difficult to find. Just a thought: you've pointed out that one of the problems is the different naming schemes in EAC & REACT, but what could be the negative consequences if I change the naming scheme in EAC/EAC Options/Filename to equal my trackname output scheme in REACT, which is "$n. $~t" for single artist and "$n. $~a -- $~t" for Varios Artists, and replace this command line in your code
Code: [Select]
ECHO @tools@\GSAR.EXE "-s@basename@.wav" "-r%TrackName%.flac" -o %trackCueFile%>>update-cueslogs.bat

with this
Code: [Select]
ECHO @tools@\GSAR.EXE -s.@imageext@ -r.flac -o %TrackCueFile%>>update-cueslogs.bat


When I modify the EAC single artist scheme its ok, probably, but when I change the Various Artist naming scheme, REACT gives me warning during startup, that it must start with %D and etc. Can I change this in the au3 file or things will be messed up.

And one other question.
I know that wavegain processes files irreversibly. Is this also the case in REACT if I use wavegain for ripping separate flac tracks with F10 command.

REACT 2 Released

Reply #1243
I've tried different things but obviously because of ACDIR, bullet-proof workaround is difficult to find.

I wrote my suggestion for the bullet-proof solve in the last post.. pseudo code, but still valid method to solve this problem. Unfortunately I'm really busy with different other problems with REACT (+Real Life™) and I can't start to code my pseudo example, though I'm tempted. If there's no willing fellow HA members who would like to take this challenge, I suggest that you find an other forum which is dedicated to helping out people with batch programming. Or maybe somebody could use AutoIt to code a program for this? This could be a better solution since coding the batch solve would be problematic due to the special characters... damn, now I'm really tempted. (maybe later if I find time.. in the next century or so )

Just a thought: you've pointed out that one of the problems is the different naming schemes in EAC & REACT, but what could be the negative consequences if I change the naming scheme in EAC/EAC Options/Filename to equal my trackname output scheme in REACT, which is "$n. $~t" for single artist and "$n. $~a -- $~t" for Varios Artists, and replace this command line in your code...
...
When I modify the EAC single artist scheme its ok, probably, but when I change the Various Artist naming scheme, REACT gives me warning during startup, that it must start with %D and etc. Can I change this in the au3 file or things will be messed up.

Well if there's a warning message, maybe it would not be a good thing to ignore that? The starting %D is absolutely required if you want that Various Artists discs are detected in the processing part of REACT.

It won't work perfectly otherwise either, the possible special characters would make your cues invalid.

You're trying to solve this from the wrong end.

I know that wavegain processes files irreversibly. Is this also the case in REACT if I use wavegain for ripping separate flac tracks with F10 command.

Gains are not applied to lossless formats, so no.

REACT 2 Released

Reply #1244
The code below uses SED to implement Akkurat's suggestion:

The code iterates through each FLAC file in the folder, and extracts the track number from the file name (expecting it to begin with two digits).  It then generates a SED command for this track, and writes it to the temporary file "sedlist.txt".  Once all tracks have been processed the SED command list is passed to SED (which should be placed in your @tools@ directory), and the replacements are made.

The SED command matches by looking for " - NN - " in the FILE command, where NN is the tracknumber.  This may cause problems if a track, band or album name happen to match that mask, but, meh, it's unlikely.

Put the following code in the FLAC tracks section (after the call to ACDIR):

Code: [Select]
FOR %%G IN (*.flac) DO CALL :ReplaceCuesheetFileReference "%%G"
@tools@\SED -f sedlist.txt <"@albumfile@.[mg].cue" >"$cdartist$ - $album$.cue"
DEL sedlist.txt

... and the following right at the very end of the config file:

Code: [Select]
:ReplaceCuesheetFileReference
SET trackno=%1
SET trackno=%trackno:~1,2%
ECHO s/FILE ".* - %trackno% - .*\.wav" WAVE/FILE %1 WAVE/>>sedlist.txt
GOTO :EOF


Edit: BTW, if anyone feels the need to pin down the track number discovery a little, I did begin using SED, and this could perhaps be expanded to ensure that a decent match is made (perhaps by only adding the command to sedlist.txt if the match was successful?).  Original code:

Code: [Select]
:ReplaceCuesheetFileReference
ECHO %1 | @tools@\SED 's/"\([0-9][0-9]\)\..*\.flac"/\1/'>%TMP%\trackno.txt
SET /P trackno=<%TMP%\trackno.txt
ECHO s/FILE ".* - %trackno%- .*\.wav" WAVE/FILE %1 WAVE/>>sedlist.txt
GOTO :EOF
I'm on a horse.

REACT 2 Released

Reply #1245
The code below uses SED to implement Akkurat's suggestion:

I take it that GSAR was too limited to use in this case since you chose SED. For what I remember, SED was not a reliable tool (if there were some special chars)... so, I had a new idea: what if this could be solved by just reading the .flac's (or whatever) in AutoIt and sort them by the tracknumber (detecting these could be easier if we put the "TrackName_XX_acdir" var used by ACDIR as parameter for AutoIt? And there's always the tracknumber tags in files..?) and then going over the cuefile "FILE ..." lines one by one and replacing every track reference from the read files array? Wouldn't this be simpler and safer (not using SED)? I take it that the "FILE ..." lines are always in correct order in cuefiles. Right? This also would work for files not starting with tracknumber. I guess I'm trying to imagine a general solve for all (so that this could be even imported to default REACT someday*).. I'm happy that you took the challenge and I'm not trying to shoot your efforts down. Just thinking out loud again.  Maybe I try it myself one day if you're not keen on using AutoIt for this. Actually, this could even be used to replace GSAR for the amending cue file references...?

* I find it stupid that default REACT enables users to create cuefiles for their rips but not correcting the file references.. more features for REACT I guess.. at least the most requested and talked about in HA.. just wait, I'm not promising but who knows.

REACT 2 Released

Reply #1246
AFAIK, GSAR can't use regular expressions, which are required to match the FILE reference text.

As far as a solution using AutoIt: as you say, not something I'm willing to pursue.  I agree that it would be nice for REACT to provide methods for users to update their cuesheets - or not update their cuesheets: IIRC REACT updates the image cuesheet by default, and I'm not actually sure I want it to.

More for your to-do list! 

Edit: After searching this thread I think your main issue was the use of certain characters needing escaping inthe RHS of a SED command (ampersand being one).  As I am only using the static value "FILE \1 WAVE" this is not an issue in this instance.
I'm on a horse.

REACT 2 Released

Reply #1247
As far as a solution using AutoIt: as you say, not something I'm willing to pursue.  I agree that it would be nice for REACT to provide methods for users to update their cuesheets - or not update their cuesheets: IIRC REACT updates the image cuesheet by default, and I'm not actually sure I want it to.

More for your to-do list!

Thanks a lot.  Now it has only about 350 lines of notes. The "almost out" new version shortened the list quite nicely but there's still lots of work to be done. So don't you worry that I could be out of things to do.

I'm interested to know why wouldn't you want REACT to update your image cuesheet?

Edit:
Edit: After searching this thread I think your main issue was the use of certain characters needing escaping inthe RHS of a SED command (ampersand being one). As I am only using the static value "FILE \1 WAVE" this is not an issue in this instance.

Hmm, I'm not so sure about that.. I have my doubts.. but I'm in no position to judge since I'm not willing to start testing that with special chars again... you win.

 

REACT 2 Released

Reply #1248
I'm interested to know why wouldn't you want REACT to update your image cuesheet?
IIRC (long time since I bothered about this) REACT amends the image cuesheet to point to the compressed image: in my case the Wavpack file.  foobar doesn't care about the FILE command when the cuesheet is embedded in the image.  The only time I may need the cuesheet outside of foobar would be to burn to CD.  Burrn (and foobar) will burn using the embedded cuesheet.  EAC cannot burn WV, so I would decompress to WAVE... which means my cuesheet is then pointing to the wrong file.

Wavpack also has a nifty feature which allows you to turn an image with embedded cuesheet into a self-extracting executable; useful if you wanted to pass someone a lossless image and they had no idea about lossless codecs.  When executed the file will decompress to WAVE and create an external cuesheet from the cuesheet tag.  If the cuesheet was embedded pointing to the WV file this negates the usefulness (if indeed you see it as useful).

Being someone who knows his archive, and who rarely burns to CD or ever creates EXEs, then these issues are not huge for me; however, they are still potential niggles for any image user.

Edit:
Edit: After searching this thread I think your main issue was the use of certain characters needing escaping inthe RHS of a SED command (ampersand being one). As I am only using the static value "FILE \1 WAVE" this is not an issue in this instance.
Hmm, I'm not so sure about that.. I have my doubts.. but I'm in no position to judge since I'm not willing to start testing that with special chars again... you win. 
  Yes!  Winner!

It seems you also had an issue with SED converting files to *nix LF format (although this strangely does not appear to be an issue in this instance).  I think the fact that the only dynamic text in the SED command is the tracknumber should keep the problem of escaping down to zero.  I may be wrong, but as you are too busy to prove it I will pretend that I definitely am not.
I'm on a horse.

REACT 2 Released

Reply #1249
IIRC (long time since I bothered about this) REACT amends the image cuesheet to point to the compressed image: in my case the Wavpack file.
...
Being someone who knows his archive, and who rarely burns to CD or ever creates EXEs, then these issues are not huge for me; however, they are still potential niggles for any image user.

Good points, thanks. Although, the cuefile still have to be amended since EAC creates the temp image with .eac (which goes also to cuefile). But, an option to change this would be ideal for the (very few?) users who'd need this.

Yes!  Winner!

Yes, 10 points and a parrot stamp to your booklet. Enjoy.