Files
cuetools.net/CUETools/Program.cs

54 lines
1.4 KiB
C#
Raw Normal View History

2008-10-13 19:25:11 +00:00
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Text;
2008-12-01 20:24:16 +00:00
using CUETools.Processor;
2008-10-13 19:25:11 +00:00
namespace JDP {
static class Program {
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length > 1 && (args[0] == "/verify" || args[0] == "/crc" || args[0] == "/convert" || args[0] == "/fix"))
2008-10-13 19:25:11 +00:00
{
frmBatch batch = new frmBatch();
2008-12-01 20:24:16 +00:00
batch.AccurateRip =
args[0] == "/convert" ? AccurateRipMode.VerifyAndConvert :
args[0] == "/fix" ? AccurateRipMode.VerifyThenConvert :
args[0] == "/crc" ? AccurateRipMode.VerifyPlusCRCs :
2008-12-01 20:24:16 +00:00
AccurateRipMode.Verify;
if (args.Length == 2 && args[1][0] != '@')
batch.InputPath = args[1];
else for (int i = 1; i < args.Length; i++)
{
if (args[i][0] == '@')
{
string lineStr;
StreamReader sr;
try
{
sr = new StreamReader(args[i].Substring(1), Encoding.Default);
while ((lineStr = sr.ReadLine()) != null)
batch.AddInputPath(lineStr);
}
catch
{
batch.AddInputPath(args[i]);
}
} else
batch.AddInputPath(args[i]);
}
Application.Run(batch);
2008-10-13 19:25:11 +00:00
return;
}
frmCUETools form = new frmCUETools();
if (args.Length == 1)
form.InputPath = args[0];
Application.Run(form);
}
}
}