* option to set process priority to idle (enabled by default)

* input can be a directory with audio files and no cue sheet.
This commit is contained in:
chudov
2008-11-08 16:47:23 +00:00
parent ad057576bc
commit 18d701a3a0
3 changed files with 80 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using System.Diagnostics;
using CUEToolsLib;
namespace JDP
@@ -178,8 +179,16 @@ namespace JDP
textBox1.Text += "Processing " + pathIn + ":\r\n";
textBox1.Select (0,0);
string cueName;
if (!File.Exists(pathIn))
throw new Exception("Input CUE Sheet not found.");
{
if (!Directory.Exists (pathIn))
throw new Exception("Input CUE Sheet not found.");
if (!pathIn.EndsWith(new string(Path.DirectorySeparatorChar, 1)))
pathIn = pathIn + Path.DirectorySeparatorChar;
cueName = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(pathIn)) + ".cue";
} else
cueName = Path.GetFileNameWithoutExtension(pathIn) + ".cue";
bool outputAudio = _accurateOffset || !_accurateRip;
cueSheet = new CUESheet(pathIn, _config);
@@ -192,7 +201,7 @@ namespace JDP
if (!Directory.Exists(outDir))
{
Directory.CreateDirectory(outDir);
pathOut = Path.Combine(outDir, Path.GetFileNameWithoutExtension(pathIn) + ".cue");
pathOut = Path.Combine(outDir, cueName);
pathFound = true;
break;
}
@@ -200,7 +209,7 @@ namespace JDP
if (!pathFound)
throw new Exception("Could not create a folder.");
} else
pathOut = pathIn;
pathOut = Path.Combine(Path.GetDirectoryName(pathIn), cueName);
cueSheet.GenerateFilenames(_audioFormat, pathOut);
if (outputAudio)
{
@@ -254,6 +263,9 @@ namespace JDP
}
catch { };
if (_config.processPriorityIdle)
Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.Idle;
if (_accurateOffset || !_accurateRip)
txtOutputFile.Show();