mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Commit files I missed with the previous commit.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using CUETools.Processor;
|
||||
|
||||
@@ -27,7 +25,8 @@ namespace ArCueDotNet
|
||||
config.autoCorrectFilenames = true;
|
||||
config.extractAlbumArt = false;
|
||||
config.embedAlbumArt = false;
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
string accurateRipLog;
|
||||
try
|
||||
{
|
||||
CUESheet cueSheet = new CUESheet(config);
|
||||
@@ -37,14 +36,16 @@ namespace ArCueDotNet
|
||||
cueSheet.UseAccurateRip();
|
||||
cueSheet.GenerateFilenames(AudioEncoderType.NoAudio, "dummy", pathIn);
|
||||
cueSheet.Go();
|
||||
cueSheet.GenerateAccurateRipLog(sw);
|
||||
|
||||
accurateRipLog = CUESheetLogWriter.GetAccurateRipLog(cueSheet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Error: " + ex.Message);
|
||||
return;
|
||||
}
|
||||
sw.Close();
|
||||
Console.Write(sw.ToString());
|
||||
|
||||
Console.Write(accurateRipLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,10 +165,7 @@ namespace JDP
|
||||
}
|
||||
else if (useAR)
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
cueSheet.GenerateAccurateRipLog(sw);
|
||||
textBox1.Text += sw.ToString();
|
||||
sw.Close();
|
||||
textBox1.Text += CUESheetLogWriter.GetAccurateRipLog(cueSheet);
|
||||
textBox1.Show();
|
||||
}
|
||||
textBox1.Text += "----------------------------------------------------------\r\n";
|
||||
|
||||
@@ -43,8 +43,10 @@ using CUETools.Processor.Settings;
|
||||
|
||||
namespace JDP
|
||||
{
|
||||
public partial class frmCUETools : Form {
|
||||
public frmCUETools() {
|
||||
public partial class frmCUETools : Form
|
||||
{
|
||||
public frmCUETools()
|
||||
{
|
||||
_profile = _defaultProfile = new CUEToolsProfile("default");
|
||||
InitializeComponent();
|
||||
//splitContainer1.AutoScaleMode = AutoScaleMode.Font;
|
||||
@@ -134,7 +136,8 @@ namespace JDP
|
||||
|
||||
DialogResult overwriteResult = DialogResult.None;
|
||||
|
||||
private void btnConvert_Click(object sender, EventArgs e) {
|
||||
private void btnConvert_Click(object sender, EventArgs e)
|
||||
{
|
||||
if ((_workThread != null) && (_workThread.IsAlive))
|
||||
return;
|
||||
|
||||
@@ -261,16 +264,21 @@ namespace JDP
|
||||
}
|
||||
}
|
||||
|
||||
private void PathTextBox_DragEnter(object sender, DragEventArgs e) {
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop) && !((TextBox)sender).ReadOnly) {
|
||||
private void PathTextBox_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop) && !((TextBox)sender).ReadOnly)
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
}
|
||||
|
||||
private void PathTextBox_DragDrop(object sender, DragEventArgs e) {
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop)) {
|
||||
private void PathTextBox_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
if (files.Length == 1) {
|
||||
if (files.Length == 1)
|
||||
{
|
||||
((TextBox)sender).Text = files[0];
|
||||
if (FileBrowserState == FileBrowserStateEnum.Tree)
|
||||
fileSystemTreeView1.SelectedPath = files[0];
|
||||
@@ -278,11 +286,14 @@ namespace JDP
|
||||
}
|
||||
}
|
||||
|
||||
public string InputPath {
|
||||
get {
|
||||
public string InputPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return txtInputPath.Text;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
txtInputPath.Text = value;
|
||||
}
|
||||
}
|
||||
@@ -303,7 +314,8 @@ namespace JDP
|
||||
UpdateOutputPath();
|
||||
}
|
||||
|
||||
private void frmCUETools_Load(object sender, EventArgs e) {
|
||||
private void frmCUETools_Load(object sender, EventArgs e)
|
||||
{
|
||||
_batchPaths = new List<string>();
|
||||
try
|
||||
{
|
||||
@@ -390,7 +402,8 @@ namespace JDP
|
||||
updateOutputStyles();
|
||||
}
|
||||
|
||||
private void frmCUETools_FormClosed(object sender, FormClosedEventArgs e) {
|
||||
private void frmCUETools_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
SaveDatabase();
|
||||
SaveSettings();
|
||||
}
|
||||
@@ -404,7 +417,8 @@ namespace JDP
|
||||
Hidden = 4
|
||||
}
|
||||
|
||||
private enum CorrectorModeEnum {
|
||||
private enum CorrectorModeEnum
|
||||
{
|
||||
Locate = 0,
|
||||
Extension = 1
|
||||
}
|
||||
@@ -448,7 +462,8 @@ namespace JDP
|
||||
return pathIn.Length == 3 && pathIn.Substring(1) == ":\\" && new DriveInfo(pathIn).DriveType == DriveType.CDRom;
|
||||
}
|
||||
|
||||
private void StartConvert() {
|
||||
private void StartConvert()
|
||||
{
|
||||
try
|
||||
{
|
||||
_workThread = null;
|
||||
@@ -521,7 +536,8 @@ namespace JDP
|
||||
{
|
||||
e.Password = dlg.txtPassword.Text;
|
||||
e.ContinueOperation = true;
|
||||
} else
|
||||
}
|
||||
else
|
||||
e.ContinueOperation = false;
|
||||
});
|
||||
}
|
||||
@@ -587,7 +603,8 @@ namespace JDP
|
||||
}
|
||||
}
|
||||
|
||||
private void WriteAudioFilesThread(object o) {
|
||||
private void WriteAudioFilesThread(object o)
|
||||
{
|
||||
object[] p = (object[])o;
|
||||
|
||||
CUESheet cueSheet = (CUESheet)p[0];
|
||||
@@ -1078,11 +1095,7 @@ namespace JDP
|
||||
}
|
||||
else if (useAR && cueSheet.Processed)
|
||||
{
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
cueSheet.GenerateAccurateRipLog(sw);
|
||||
_batchReport.Append(sw.ToString());
|
||||
}
|
||||
_batchReport.Append(CUESheetLogWriter.GetAccurateRipLog(cueSheet));
|
||||
ReportState = true;
|
||||
|
||||
//frmReport reportForm = new frmReport();
|
||||
@@ -1142,7 +1155,8 @@ namespace JDP
|
||||
}
|
||||
cueSheet.Close();
|
||||
|
||||
if (_batchPaths.Count != 0) {
|
||||
if (_batchPaths.Count != 0)
|
||||
{
|
||||
_batchPaths.RemoveAt(0);
|
||||
if (_batchPaths.Count == 0)
|
||||
{
|
||||
@@ -1150,7 +1164,8 @@ namespace JDP
|
||||
}
|
||||
this.BeginInvoke((MethodInvoker)delegate()
|
||||
{
|
||||
if (_batchPaths.Count == 0) {
|
||||
if (_batchPaths.Count == 0)
|
||||
{
|
||||
SetupControls(false);
|
||||
ReportState = true;
|
||||
//frmReport reportForm = new frmReport();
|
||||
@@ -1158,7 +1173,8 @@ namespace JDP
|
||||
//reportForm.ShowDialog(this);
|
||||
//ShowBatchDoneMessage();
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
StartConvert();
|
||||
}
|
||||
});
|
||||
@@ -1201,7 +1217,8 @@ namespace JDP
|
||||
});
|
||||
}
|
||||
|
||||
private void SetupControls(bool running) {
|
||||
private void SetupControls(bool running)
|
||||
{
|
||||
bool converting = (SelectedAction == CUEAction.Encode);
|
||||
bool verifying = (SelectedAction == CUEAction.Verify || (SelectedAction == CUEAction.Encode && SelectedOutputAudioType != AudioEncoderType.NoAudio && checkBoxUseAccurateRip.Checked));
|
||||
//grpInput.Enabled = !running;
|
||||
@@ -1261,7 +1278,8 @@ namespace JDP
|
||||
// checkBoxAdvancedMode.Checked;
|
||||
}
|
||||
|
||||
private bool ShowErrorMessage(Exception ex) {
|
||||
private bool ShowErrorMessage(Exception ex)
|
||||
{
|
||||
string message = "Exception";
|
||||
for (Exception e = ex; e != null; e = e.InnerException)
|
||||
message += ": " + e.Message;
|
||||
@@ -1270,11 +1288,14 @@ namespace JDP
|
||||
return (dlgRes == DialogResult.OK);
|
||||
}
|
||||
|
||||
private void ShowFinishedMessage(bool warnAboutPadding, string status) {
|
||||
if (_batchPaths.Count != 0) {
|
||||
private void ShowFinishedMessage(bool warnAboutPadding, string status)
|
||||
{
|
||||
if (_batchPaths.Count != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (warnAboutPadding) {
|
||||
if (warnAboutPadding)
|
||||
{
|
||||
MessageBox.Show(this, "One or more input file doesn't end on a CD frame boundary. " +
|
||||
"The output has been padded where necessary to fix this. If your input " +
|
||||
"files are from a CD source, this may indicate a problem with your files.",
|
||||
@@ -1289,7 +1310,8 @@ namespace JDP
|
||||
// MessageBoxIcon.Information);
|
||||
//}
|
||||
|
||||
private bool CheckWriteOffset() {
|
||||
private bool CheckWriteOffset()
|
||||
{
|
||||
if (numericWriteOffset.Value == 0 || SelectedOutputAudioType == AudioEncoderType.NoAudio || rbActionVerify.Checked)
|
||||
{
|
||||
return true;
|
||||
@@ -1373,7 +1395,8 @@ namespace JDP
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadSettings() {
|
||||
private void LoadSettings()
|
||||
{
|
||||
SettingsReader sr = new SettingsReader("CUE Tools", "settings.txt", Application.ExecutablePath);
|
||||
profilePath = sr.ProfilePath;
|
||||
_profile.Load(sr);
|
||||
@@ -1479,14 +1502,18 @@ namespace JDP
|
||||
sw.Close();
|
||||
}
|
||||
|
||||
private CUEStyle SelectedCUEStyle {
|
||||
get {
|
||||
private CUEStyle SelectedCUEStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (rbEmbedCUE.Checked) return CUEStyle.SingleFileWithCUE;
|
||||
if (rbSingleFile.Checked) return CUEStyle.SingleFile;
|
||||
return _profile._config.gapsHandling;
|
||||
}
|
||||
set {
|
||||
switch (value) {
|
||||
set
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case CUEStyle.SingleFileWithCUE: rbEmbedCUE.Checked = true; break;
|
||||
case CUEStyle.SingleFile: rbSingleFile.Checked = true; break;
|
||||
default: rbTracks.Checked = true; break;
|
||||
@@ -1542,7 +1569,8 @@ namespace JDP
|
||||
}
|
||||
}
|
||||
|
||||
private string SelectedOutputAudioFormat {
|
||||
private string SelectedOutputAudioFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)(comboBoxAudioFormat.SelectedItem ?? "dummy");
|
||||
@@ -2276,7 +2304,8 @@ namespace JDP
|
||||
{
|
||||
if (!encoder.lossless)
|
||||
continue;
|
||||
} else if (SelectedOutputAudioType == AudioEncoderType.Lossless && !encoder.lossless)
|
||||
}
|
||||
else if (SelectedOutputAudioType == AudioEncoderType.Lossless && !encoder.lossless)
|
||||
continue;
|
||||
else if (SelectedOutputAudioType == AudioEncoderType.Lossy && encoder.lossless)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user