Skip to content

Commit

Permalink
Add setting for writing dummy CUE sheet comment
Browse files Browse the repository at this point in the history
If desired, this setting allows disabling writing of the following
comment in dummy CUE sheets:
REM COMMENT "CUETools generated dummy CUE sheet"

- Add setting:
  `WriteDummyCUESheetComment`
  Default:
  `WriteDummyCUESheetComment=1`
  The setting is enabled by default, to preserve previous behavior.
- The setting can be modified by editing `settings.txt` after
  closing CUETools:
  Use bool value 0, to disable writing the dummy CUE sheet comment.
- Resolves: #343
  • Loading branch information
c72578 committed Sep 4, 2024
1 parent ea835f7 commit 9ed297b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CUETools.Processor/CUEConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class CUEConfig
public bool extractLog;
public bool alwaysWriteUTF8CUEFile;
public bool writeUTF8BOM;
public bool writeDummyCUESheetComment;
public bool fillUpCUE;
public bool overwriteCUEData;
public bool filenamesANSISafe;
Expand Down Expand Up @@ -112,6 +113,7 @@ public CUEConfig()
extractLog = true;
alwaysWriteUTF8CUEFile = false;
writeUTF8BOM = true;
writeDummyCUESheetComment = true;
fillUpCUE = true;
overwriteCUEData = false;
filenamesANSISafe = true;
Expand Down Expand Up @@ -200,6 +202,7 @@ public CUEConfig(CUEConfig src)
extractLog = src.extractLog;
alwaysWriteUTF8CUEFile = src.alwaysWriteUTF8CUEFile;
writeUTF8BOM = src.writeUTF8BOM;
writeDummyCUESheetComment = src.writeDummyCUESheetComment;
fillUpCUE = src.fillUpCUE;
overwriteCUEData = src.overwriteCUEData;
filenamesANSISafe = src.filenamesANSISafe;
Expand Down Expand Up @@ -289,6 +292,7 @@ public void Save(SettingsWriter sw)
sw.Save("ExtractLog", extractLog);
sw.Save("AlwaysWriteUTF8CUEFile", alwaysWriteUTF8CUEFile);
sw.Save("WriteUTF8BOM", writeUTF8BOM);
sw.Save("WriteDummyCUESheetComment", writeDummyCUESheetComment);
sw.Save("FillUpCUE", fillUpCUE);
sw.Save("OverwriteCUEData", overwriteCUEData);
sw.Save("FilenamesANSISafe", filenamesANSISafe);
Expand Down Expand Up @@ -396,6 +400,7 @@ public void Load(SettingsReader sr)
extractLog = sr.LoadBoolean("ExtractLog") ?? true;
alwaysWriteUTF8CUEFile = sr.LoadBoolean("AlwaysWriteUTF8CUEFile") ?? false;
writeUTF8BOM = sr.LoadBoolean("WriteUTF8BOM") ?? true;
writeDummyCUESheetComment = sr.LoadBoolean("WriteDummyCUESheetComment") ?? true;
fillUpCUE = sr.LoadBoolean("FillUpCUE") ?? true;
overwriteCUEData = sr.LoadBoolean("OverwriteCUEData") ?? false;
filenamesANSISafe = sr.LoadBoolean("FilenamesANSISafe") ?? true;
Expand Down
3 changes: 2 additions & 1 deletion CUETools.Processor/CUESheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3888,7 +3888,8 @@ public static string CreateDummyCUESheet(CUEConfig _config, FileGroupInfo fileGr
}

StringWriter sw = new StringWriter();
sw.WriteLine(String.Format("REM COMMENT \"CUETools generated dummy CUE sheet\""));
if (_config.writeDummyCUESheetComment)
sw.WriteLine(String.Format("REM COMMENT \"CUETools generated dummy CUE sheet\""));
int trackNo = 0;
foreach (FileSystemInfo file in fileGroup.files)
{
Expand Down

0 comments on commit 9ed297b

Please sign in to comment.