minor fixes

This commit is contained in:
chudov
2010-03-25 05:04:45 +00:00
parent 612fba3bcb
commit 74328ad330
13 changed files with 106 additions and 145 deletions

View File

@@ -285,7 +285,7 @@ namespace BBBNOVA
_listBox = new ListBox(); _listBox = new ListBox();
_listBox.IntegralHeight = true; _listBox.IntegralHeight = true;
_listBox.BorderStyle = BorderStyle.FixedSingle; _listBox.BorderStyle = BorderStyle.None;
_listBox.SelectionMode = SelectionMode.One; _listBox.SelectionMode = SelectionMode.One;
_listBox.DrawMode = DrawMode.OwnerDrawFixed; _listBox.DrawMode = DrawMode.OwnerDrawFixed;
_listBox.Font = base.Font; _listBox.Font = base.Font;

View File

@@ -282,7 +282,6 @@ namespace CUERipper
// bnComboBoxLosslessOrNot // bnComboBoxLosslessOrNot
// //
this.bnComboBoxLosslessOrNot.BackColor = System.Drawing.Color.White; this.bnComboBoxLosslessOrNot.BackColor = System.Drawing.Color.White;
this.bnComboBoxLosslessOrNot.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxLosslessOrNot.DataSource = this.losslessOrNotBindingSource; this.bnComboBoxLosslessOrNot.DataSource = this.losslessOrNotBindingSource;
this.bnComboBoxLosslessOrNot.DropDownHeight = 200; this.bnComboBoxLosslessOrNot.DropDownHeight = 200;
this.bnComboBoxLosslessOrNot.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.bnComboBoxLosslessOrNot.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -312,7 +311,6 @@ namespace CUERipper
// bnComboBoxEncoder // bnComboBoxEncoder
// //
this.bnComboBoxEncoder.BackColor = System.Drawing.Color.White; this.bnComboBoxEncoder.BackColor = System.Drawing.Color.White;
this.bnComboBoxEncoder.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxEncoder.DataSource = this.encodersBindingSource; this.bnComboBoxEncoder.DataSource = this.encodersBindingSource;
this.bnComboBoxEncoder.DropDownHeight = 200; this.bnComboBoxEncoder.DropDownHeight = 200;
this.bnComboBoxEncoder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.bnComboBoxEncoder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -343,7 +341,6 @@ namespace CUERipper
// bnComboBoxFormat // bnComboBoxFormat
// //
this.bnComboBoxFormat.BackColor = System.Drawing.Color.White; this.bnComboBoxFormat.BackColor = System.Drawing.Color.White;
this.bnComboBoxFormat.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxFormat.DataSource = this.formatsBindingSource; this.bnComboBoxFormat.DataSource = this.formatsBindingSource;
this.bnComboBoxFormat.DropDownHeight = 200; this.bnComboBoxFormat.DropDownHeight = 200;
this.bnComboBoxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.bnComboBoxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -375,7 +372,6 @@ namespace CUERipper
// bnComboBoxImage // bnComboBoxImage
// //
this.bnComboBoxImage.BackColor = System.Drawing.Color.White; this.bnComboBoxImage.BackColor = System.Drawing.Color.White;
this.bnComboBoxImage.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxImage.DataSource = this.cUEStylesBindingSource; this.bnComboBoxImage.DataSource = this.cUEStylesBindingSource;
this.bnComboBoxImage.DropDownHeight = 200; this.bnComboBoxImage.DropDownHeight = 200;
this.bnComboBoxImage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.bnComboBoxImage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -520,7 +516,6 @@ namespace CUERipper
// bnComboBoxRelease // bnComboBoxRelease
// //
this.bnComboBoxRelease.BackColor = System.Drawing.SystemColors.ControlLightLight; this.bnComboBoxRelease.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.bnComboBoxRelease.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxRelease.ContextMenuStrip = this.contextMenuStripRelease; this.bnComboBoxRelease.ContextMenuStrip = this.contextMenuStripRelease;
this.bnComboBoxRelease.DataSource = this.releasesBindingSource; this.bnComboBoxRelease.DataSource = this.releasesBindingSource;
this.bnComboBoxRelease.DropDownHeight = 200; this.bnComboBoxRelease.DropDownHeight = 200;
@@ -556,7 +551,6 @@ namespace CUERipper
// bnComboBoxDrives // bnComboBoxDrives
// //
this.bnComboBoxDrives.BackColor = System.Drawing.SystemColors.ControlLightLight; this.bnComboBoxDrives.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.bnComboBoxDrives.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxDrives.DataSource = this.drivesBindingSource; this.bnComboBoxDrives.DataSource = this.drivesBindingSource;
this.bnComboBoxDrives.DropDownHeight = 200; this.bnComboBoxDrives.DropDownHeight = 200;
this.bnComboBoxDrives.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.bnComboBoxDrives.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -583,7 +577,6 @@ namespace CUERipper
// bnComboBoxOutputFormat // bnComboBoxOutputFormat
// //
this.bnComboBoxOutputFormat.BackColor = System.Drawing.SystemColors.ControlLightLight; this.bnComboBoxOutputFormat.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.bnComboBoxOutputFormat.Border = System.Windows.Forms.BorderStyle.FixedSingle;
this.bnComboBoxOutputFormat.DropDownHeight = 200; this.bnComboBoxOutputFormat.DropDownHeight = 200;
this.bnComboBoxOutputFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; this.bnComboBoxOutputFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
this.bnComboBoxOutputFormat.DropDownWidth = 552; this.bnComboBoxOutputFormat.DropDownWidth = 552;

View File

@@ -319,7 +319,7 @@ namespace CUERipper
bool submit = cueSheet.CTDB.AccResult == HttpStatusCode.NotFound || bool submit = cueSheet.CTDB.AccResult == HttpStatusCode.NotFound ||
cueSheet.CTDB.AccResult == HttpStatusCode.OK; cueSheet.CTDB.AccResult == HttpStatusCode.OK;
//_cueSheet.CTDB.AccResult == HttpStatusCode.NoContent; //_cueSheet.CTDB.AccResult == HttpStatusCode.NoContent;
DBEntry confirm = null; DBEntry confirm = null;
submit &= audioSource.CorrectionQuality > 0; submit &= audioSource.CorrectionQuality > 0;
@@ -343,7 +343,6 @@ namespace CUERipper
cueSheet.Artist, cueSheet.Artist,
cueSheet.Title); cueSheet.Title);
} }
//CUESheet.WriteText(_pathOut, _cueSheet.CUESheetContents(_style)); //CUESheet.WriteText(_pathOut, _cueSheet.CUESheetContents(_style));
//CUESheet.WriteText(Path.ChangeExtension(_pathOut, ".log"), _cueSheet.LOGContents()); //CUESheet.WriteText(Path.ChangeExtension(_pathOut, ".log"), _cueSheet.LOGContents());
} }
@@ -362,9 +361,23 @@ namespace CUERipper
}); });
} }
#endif #endif
audioSource.ReadProgress -= new EventHandler<ReadProgressArgs>(CDReadProgress); audioSource.ReadProgress -= new EventHandler<ReadProgressArgs>(CDReadProgress);
audioSource.Close(); try
audioSource.Open(audioSource.Path[0]); {
audioSource.Close();
audioSource.Open(audioSource.Path[0]);
}
catch (Exception ex)
{
this.BeginInvoke((MethodInvoker)delegate()
{
releases.Clear();
selectedRelease = null;
bnComboBoxRelease.Text = ex.Message;
});
}
_workThread = null; _workThread = null;
this.BeginInvoke((MethodInvoker)delegate() this.BeginInvoke((MethodInvoker)delegate()
{ {

View File

@@ -469,7 +469,7 @@
</data> </data>
<data name="bnComboBoxLosslessOrNot.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxLosslessOrNot.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=
@@ -501,7 +501,7 @@
</data> </data>
<data name="bnComboBoxEncoder.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxEncoder.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=
@@ -560,7 +560,7 @@
</data> </data>
<data name="bnComboBoxFormat.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxFormat.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=
@@ -631,7 +631,7 @@
</data> </data>
<data name="bnComboBoxImage.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxImage.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=
@@ -976,7 +976,7 @@
</data> </data>
<data name="bnComboBoxRelease.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxRelease.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=
@@ -1011,7 +1011,7 @@
</data> </data>
<data name="bnComboBoxDrives.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxDrives.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=
@@ -1040,7 +1040,7 @@
</data> </data>
<data name="bnComboBoxOutputFormat.Radius" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="bnComboBoxOutputFormat.Radius" mimetype="application/x-microsoft.net.object.binary.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNi4wLCBDdWx0dXJl AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuNy4wLCBDdWx0dXJl
PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABBCQkJOT1ZBLkJOUmFkaXVzBAAAAAhfdG9w
TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC TGVmdAlfdG9wUmlnaHQLX2JvdHRvbUxlZnQMX2JvdHRvbVJpZ2h0AAAAAAgICAgCAAAAAgAAAAYAAAAC
AAAAAgAAAAs= AAAAAgAAAAs=

View File

@@ -47,8 +47,7 @@
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>..\bin\Release\</OutputPath> <OutputPath>..\bin\Release\</OutputPath>
<DefineConstants> <DefineConstants>TRACE</DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>

View File

@@ -836,7 +836,8 @@ namespace CUETools.Processor
try try
{ {
AssemblyName name = AssemblyName.GetAssemblyName(plugin_path); AssemblyName name = AssemblyName.GetAssemblyName(plugin_path);
Assembly assembly = Assembly.Load(name); Assembly assembly = Assembly.Load(name, Assembly.GetEntryAssembly().Evidence);
System.Diagnostics.Trace.WriteLine("Loaded " + assembly.FullName);
foreach (Type type in assembly.GetExportedTypes()) foreach (Type type in assembly.GetExportedTypes())
{ {
try try
@@ -860,13 +861,13 @@ namespace CUETools.Processor
} }
catch (Exception ex) catch (Exception ex)
{ {
System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Trace.WriteLine(ex.Message);
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Trace.WriteLine(ex.Message);
} }
} }
} }

View File

@@ -33,6 +33,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRules>
</CodeAnalysisRules>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />

View File

@@ -122,5 +122,32 @@ namespace CUETools.Ripper.SCSI {
return ResourceManager.GetString("ReadTOCError", resourceCulture); return ResourceManager.GetString("ReadTOCError", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Detecting drive features.
/// </summary>
internal static string StatusDetectingDriveFeatures {
get {
return ResourceManager.GetString("StatusDetectingDriveFeatures", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Detecting gaps.
/// </summary>
internal static string StatusDetectingGaps {
get {
return ResourceManager.GetString("StatusDetectingGaps", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ripping.
/// </summary>
internal static string StatusRipping {
get {
return ResourceManager.GetString("StatusRipping", resourceCulture);
}
}
} }
} }

View File

@@ -138,4 +138,13 @@
<data name="ReadTOCError" xml:space="preserve"> <data name="ReadTOCError" xml:space="preserve">
<value>Cannot open CD</value> <value>Cannot open CD</value>
</data> </data>
<data name="StatusDetectingDriveFeatures" xml:space="preserve">
<value>Detecting drive features</value>
</data>
<data name="StatusDetectingGaps" xml:space="preserve">
<value>Detecting gaps</value>
</data>
<data name="StatusRipping" xml:space="preserve">
<value>Ripping</value>
</data>
</root> </root>

View File

@@ -138,4 +138,13 @@
<data name="ReadTOCError" xml:space="preserve"> <data name="ReadTOCError" xml:space="preserve">
<value>Ошибка при обращении к диску</value> <value>Ошибка при обращении к диску</value>
</data> </data>
<data name="StatusDetectingDriveFeatures" xml:space="preserve">
<value>Диагностика устройства</value>
</data>
<data name="StatusDetectingGaps" xml:space="preserve">
<value>Определение зазоров</value>
</data>
<data name="StatusRipping" xml:space="preserve">
<value>Извлечение аудио</value>
</data>
</root> </root>

View File

@@ -596,7 +596,7 @@ namespace CUETools.Ripper.SCSI
{ {
if (ReadProgress != null) if (ReadProgress != null)
{ {
progressArgs.Action = "Detecting gaps"; progressArgs.Action = Resource1.StatusDetectingGaps;
progressArgs.Pass = -1; progressArgs.Pass = -1;
progressArgs.Position = (iTrack - _toc2.FirstAudio) * 3; progressArgs.Position = (iTrack - _toc2.FirstAudio) * 3;
progressArgs.PassStart = 0; progressArgs.PassStart = 0;
@@ -717,6 +717,9 @@ namespace CUETools.Ripper.SCSI
m_max_sectors = Math.Min(NSECTORS, m_device.MaximumTransferLength / CB_AUDIO - 1); m_max_sectors = Math.Min(NSECTORS, m_device.MaximumTransferLength / CB_AUDIO - 1);
int sector = 3; int sector = 3;
int pass = 0; int pass = 0;
_timeout = 10;
for (int c = 0; c <= 2 && !found; c++) for (int c = 0; c <= 2 && !found; c++)
for (int r = 0; r <= 1 && !found; r++) for (int r = 0; r <= 1 && !found; r++)
for (int m = 0; m <= 1 && !found; m++) for (int m = 0; m <= 1 && !found; m++)
@@ -732,7 +735,7 @@ namespace CUETools.Ripper.SCSI
DateTime tm = DateTime.Now; DateTime tm = DateTime.Now;
if (ReadProgress != null) if (ReadProgress != null)
{ {
progressArgs.Action = "Detecting drive features"; progressArgs.Action = Resource1.StatusDetectingDriveFeatures;
progressArgs.Pass = -1; progressArgs.Pass = -1;
progressArgs.Position = pass++; progressArgs.Position = pass++;
progressArgs.PassStart = 0; progressArgs.PassStart = 0;
@@ -741,10 +744,13 @@ namespace CUETools.Ripper.SCSI
progressArgs.PassTime = tm; progressArgs.PassTime = tm;
ReadProgress(this, progressArgs); ReadProgress(this, progressArgs);
} }
System.Diagnostics.Trace.WriteLine("Trying " + CurrentReadCommand);
Device.CommandStatus st = FetchSectors(sector, m_max_sectors, false); Device.CommandStatus st = FetchSectors(sector, m_max_sectors, false);
TimeSpan delay = DateTime.Now - tm; TimeSpan delay = DateTime.Now - tm;
_autodetectResult += string.Format("{0}: {1} ({2}ms)\n", CurrentReadCommand, (st == Device.CommandStatus.DeviceFailed ? Device.LookupSenseError(m_device.GetSenseAsc(), m_device.GetSenseAscq()) : st.ToString()), delay.TotalMilliseconds); _autodetectResult += string.Format("{0}: {1} ({2}ms)\n", CurrentReadCommand, (st == Device.CommandStatus.DeviceFailed ? Device.LookupSenseError(m_device.GetSenseAsc(), m_device.GetSenseAscq()) : st.ToString()), delay.TotalMilliseconds);
found = st == Device.CommandStatus.Success; found = st == Device.CommandStatus.Success;
_timeout = 1;
//sector += m_max_sectors; //sector += m_max_sectors;
} }
@@ -766,6 +772,7 @@ namespace CUETools.Ripper.SCSI
else else
_readCDCommand = ReadCDCommand.Unknown; _readCDCommand = ReadCDCommand.Unknown;
_timeout = 10;
_currentStart = -1; _currentStart = -1;
_currentEnd = -1; _currentEnd = -1;
readCommandFound = found; readCommandFound = found;
@@ -977,62 +984,6 @@ namespace CUETools.Ripper.SCSI
throw new Exception("wierd IntPtr.Size"); throw new Exception("wierd IntPtr.Size");
} }
private void PrintErrors(int pass, int sector, int Sectors2Read, byte[] realData)
{
//for (int iSector = 0; iSector < Sectors2Read; iSector++)
//{
// int pos = sector - _currentStart + iSector;
// if (_debugMessages)
// {
// StringBuilder st = new StringBuilder();
// for (int i = 0; i < 294; i++)
// if (C2Data[pos, i] != 0)
// {
// for (int j = i; j < i + 23; j++)
// if (j < 294)
// st.AppendFormat("{0:X2}", C2Data[_currentScan, pos, j]);
// else
// st.Append(" ");
// System.Console.WriteLine("\rC2 error @{0}[{1:000}]{2};", CDImageLayout.TimeToString((uint)(sector + iSector)), i, st.ToString());
// return;
// }
//for (int i = 0; i < 4 * 588; i++)
// if (_currentData[pos * 4 * 588 + i] != realData[pos * 4 * 588 + i])
// {
// StringBuilder st = new StringBuilder();
// for (int j = i; j < i + 25; j++)
// if (j < 4 * 588)
// st.AppendFormat("{0:X2}", realData[pos * 4 * 588 + j]);
// else
// st.Append(" ");
// System.Console.WriteLine("\r{0}[--][{1:X3}]{2};", CDImageLayout.TimeToString((uint)(sector + iSector)), i, st.ToString());
// st.Length = 0;
// for (int result = 0; result <= pass; result++)
// {
// for (int j = i; j < i + 25; j++)
// if (j < 4 * 588)
// st.AppendFormat("{0:X2}", UserData[result, pos, j]);
// else
// st.Append(" ");
// System.Console.WriteLine("\r{0}[{3:X2}][{1:X3}]{2};", CDImageLayout.TimeToString((uint)(sector + iSector)), i, st.ToString(), result);
// st.Length = 0;
// //int c2Bit = 0x80 >> (i % 8);
// //byte value = UserData[result, pos, i];
// //short score = (short)(1 + (((C2Data[result, pos, i >> 3] & c2Bit) == 0) ? (short) 10 : (short)0));
// //st.AppendFormat("{0:X2}[{1:X2}]", value, score);
// }
// i += 25;
// //return;
// //while (st.Length < 46)
// // st.Append(' ');
// //System.Console.WriteLine("\rReal error @{0}[{1:000}]{2};", CDImageLayout.TimeToString((uint)(sector + iSector)), i, st.ToString());
// }
// }
//}
}
private unsafe void CorrectSectors(int pass, int sector, int Sectors2Read, bool markErrors) private unsafe void CorrectSectors(int pass, int sector, int Sectors2Read, bool markErrors)
{ {
for (int iSector = 0; iSector < Sectors2Read; iSector++) for (int iSector = 0; iSector < Sectors2Read; iSector++)
@@ -1082,60 +1033,6 @@ namespace CUETools.Ripper.SCSI
int[] errtmp = new int[MSECTORS]; int[] errtmp = new int[MSECTORS];
//private unsafe int CorrectSectorsTest(int start, int end, int c2Score, byte[] realData, int worstScan)
//{
// int[] valueScore = new int[256];
// int[] scoreErrors = new int[256];
// int realErrors = 0;
// int bestScore = 0;
// int _errorsCaught = 0;
// int _falsePositives = 0;
// for (int iSector = 0; iSector < end - start; iSector++)
// {
// for (int iPar = 0; iPar < 4 * 588; iPar++)
// {
// int dataPos = iSector * CB_AUDIO + iPar;
// int c2Pos = iSector * CB_AUDIO + 2 + 4 * 588 + iPar / 8;
// int c2Bit = 0x80 >> (iPar % 8);
// Array.Clear(valueScore, 0, 256);
// byte bestValue = _currentScan.Data[dataPos];
// valueScore[bestValue] += 1 + (((_currentScan.Data[c2Pos] & c2Bit) == 0) ? c2Score : 0);
// int totalScore = valueScore[bestValue];
// for (int result = 0; result < _scanResults.Count; result++)
// {
// if (result == worstScan)
// continue;
// byte value = _scanResults[result].Data[dataPos];
// valueScore[value] += 1 + (((_scanResults[result].Data[c2Pos] & c2Bit) == 0) ? c2Score : 0);
// totalScore += 1 + (((_scanResults[result].Data[c2Pos] & c2Bit) == 0) ? c2Score : 0);
// if (valueScore[value] > valueScore[bestValue])
// bestValue = value;
// }
// if (valueScore[bestValue] < (1 + c2Score + totalScore) / 2)
// _currentErrorsCount++;
// //_currentData[iSector * 4 * 588 + iPar] = bestValue;
// if (realData[iSector * 4 * 588 + iPar] != bestValue)
// {
// if (valueScore[bestValue] > bestScore)
// scoreErrors[valueScore[bestValue]]++;
// realErrors++;
// if (valueScore[bestValue] * 2 <= c2Score + totalScore)
// _errorsCaught++;
// } else
// if (valueScore[bestValue] * 2 <= c2Score + totalScore)
// _falsePositives++;
// }
// }
// //string s = "";
// //for (int i = 0; i < 256; i++)
// // if (scoreErrors[i] > 0)
// // s += string.Format("[{0}]={1};", i, scoreErrors[i]);
// //System.Console.WriteLine("RE{0:000} EC{1} FP{2}", realErrors, _errorsCaught, _falsePositives);
// return realErrors;
//}
public unsafe void PrefetchSector(int iSector) public unsafe void PrefetchSector(int iSector)
{ {
if (iSector >= _currentStart && iSector < _currentEnd) if (iSector >= _currentStart && iSector < _currentEnd)
@@ -1195,16 +1092,13 @@ namespace CUETools.Ripper.SCSI
//TimeSpan delay1 = DateTime.Now - LastFetch; //TimeSpan delay1 = DateTime.Now - LastFetch;
//DateTime LastFetched = DateTime.Now; //DateTime LastFetched = DateTime.Now;
if (pass >= _correctionQuality) if (pass >= _correctionQuality)
{
CorrectSectors(pass, sector, Sectors2Read, pass == max_scans - 1); CorrectSectors(pass, sector, Sectors2Read, pass == max_scans - 1);
PrintErrors(pass, sector, Sectors2Read, /*realData*/null);
}
//TimeSpan delay2 = DateTime.Now - LastFetched; //TimeSpan delay2 = DateTime.Now - LastFetched;
//if (sector == _currentStart) //if (sector == _currentStart)
//System.Console.WriteLine("\n{0},{1}", delay1.TotalMilliseconds, delay2.TotalMilliseconds); //System.Console.WriteLine("\n{0},{1}", delay1.TotalMilliseconds, delay2.TotalMilliseconds);
if (ReadProgress != null) if (ReadProgress != null)
{ {
progressArgs.Action = "Ripping"; progressArgs.Action = Resource1.StatusRipping;
progressArgs.Position = sector + Sectors2Read; progressArgs.Position = sector + Sectors2Read;
progressArgs.Pass = pass; progressArgs.Pass = pass;
progressArgs.PassStart = _currentStart; progressArgs.PassStart = _currentStart;
@@ -1214,9 +1108,6 @@ namespace CUETools.Ripper.SCSI
ReadProgress(this, progressArgs); ReadProgress(this, progressArgs);
} }
} }
//System.Console.WriteLine();
//if (CorrectSectorsTest(start, _currentEnd, 10, realData) == 0)
// break;
if (pass >= _correctionQuality && _currentErrorsCount == 0) if (pass >= _correctionQuality && _currentErrorsCount == 0)
break; break;
} }
@@ -1314,7 +1205,7 @@ namespace CUETools.Ripper.SCSI
} }
set set
{ {
if (_toc.AudioLength <= 0) if (_toc == null || _toc.AudioLength <= 0)
throw new Exception(Resource1.NoAudio); throw new Exception(Resource1.NoAudio);
_crcErrorsCount = 0; _crcErrorsCount = 0;
_errorsCount = 0; _errorsCount = 0;

View File

@@ -12,7 +12,7 @@
<ApplicationIcon>cue2.ico</ApplicationIcon> <ApplicationIcon>cue2.ico</ApplicationIcon>
<ManifestCertificateThumbprint>611F49E043614FEDCFF1B128868CC8DC0B6656C5</ManifestCertificateThumbprint> <ManifestCertificateThumbprint>611F49E043614FEDCFF1B128868CC8DC0B6656C5</ManifestCertificateThumbprint>
<ManifestKeyFile>CUETools_TemporaryKey.pfx</ManifestKeyFile> <ManifestKeyFile>CUETools_TemporaryKey.pfx</ManifestKeyFile>
<GenerateManifests>false</GenerateManifests> <GenerateManifests>true</GenerateManifests>
<SignManifests>true</SignManifests> <SignManifests>true</SignManifests>
<IsWebBootstrapper>true</IsWebBootstrapper> <IsWebBootstrapper>true</IsWebBootstrapper>
<TargetZone>LocalIntranet</TargetZone> <TargetZone>LocalIntranet</TargetZone>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site">
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
</PermissionSet>
</applicationRequestMinimum>
</security>
</trustInfo>
</asmv1:assembly>