smart combobox control

some localization for cueripper
version bump
This commit is contained in:
chudov
2010-03-25 01:05:26 +00:00
parent 5f270e4a8e
commit 612fba3bcb
33 changed files with 2623 additions and 1303 deletions

View File

@@ -40,6 +40,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Resource1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
<Compile Include="SCSIDrive.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -68,6 +73,13 @@
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resource1.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource1.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resource1.ru-RU.resx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.6.0")]
[assembly: AssemblyFileVersion("2.0.6.0")]
[assembly: AssemblyVersion("2.0.7.0")]
[assembly: AssemblyFileVersion("2.0.7.0")]

126
CUETools.Ripper.SCSI/Resource1.Designer.cs generated Normal file
View File

@@ -0,0 +1,126 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CUETools.Ripper.SCSI {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resource1 {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resource1() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CUETools.Ripper.SCSI.Resource1", typeof(Resource1).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to failed to autodetect read command.
/// </summary>
internal static string AutodetectReadCommandFailed {
get {
return ResourceManager.GetString("AutodetectReadCommandFailed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error querying drive.
/// </summary>
internal static string DeviceInquiryError {
get {
return ResourceManager.GetString("DeviceInquiryError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to not an MMC device.
/// </summary>
internal static string DeviceNotMMC {
get {
return ResourceManager.GetString("DeviceNotMMC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Open failed.
/// </summary>
internal static string DeviceOpenError {
get {
return ResourceManager.GetString("DeviceOpenError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to no audio.
/// </summary>
internal static string NoAudio {
get {
return ResourceManager.GetString("NoAudio", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error reading CD.
/// </summary>
internal static string ReadCDError {
get {
return ResourceManager.GetString("ReadCDError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cannot open CD.
/// </summary>
internal static string ReadTOCError {
get {
return ResourceManager.GetString("ReadTOCError", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AutodetectReadCommandFailed" xml:space="preserve">
<value>failed to autodetect read command</value>
</data>
<data name="DeviceInquiryError" xml:space="preserve">
<value>Error querying drive</value>
</data>
<data name="DeviceNotMMC" xml:space="preserve">
<value>not an MMC device</value>
</data>
<data name="DeviceOpenError" xml:space="preserve">
<value>Open failed</value>
</data>
<data name="NoAudio" xml:space="preserve">
<value>no audio</value>
</data>
<data name="ReadCDError" xml:space="preserve">
<value>Error reading CD</value>
</data>
<data name="ReadTOCError" xml:space="preserve">
<value>Cannot open CD</value>
</data>
</root>

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AutodetectReadCommandFailed" xml:space="preserve">
<value>не удалось определить команду чтения</value>
</data>
<data name="DeviceInquiryError" xml:space="preserve">
<value>Ошибка при опросе устройства</value>
</data>
<data name="DeviceNotMMC" xml:space="preserve">
<value>устройство не поддерживает стандарт MMC</value>
</data>
<data name="DeviceOpenError" xml:space="preserve">
<value>Ошибка при открытии устройства</value>
</data>
<data name="NoAudio" xml:space="preserve">
<value>отсутствует аудио</value>
</data>
<data name="ReadCDError" xml:space="preserve">
<value>Ошибка при чтении диска</value>
</data>
<data name="ReadTOCError" xml:space="preserve">
<value>Ошибка при обращении к диску</value>
</data>
</root>

View File

@@ -49,7 +49,6 @@ namespace CUETools.Ripper.SCSI
const int NSECTORS = 16;
//const int MSECTORS = 5*1024*1024 / (4 * 588);
const int MSECTORS = 2400;
int _currentTrack = -1, _currentIndex = -1, _currentTrackActualStart = -1;
Logger m_logger;
CDImageLayout _toc;
CDImageLayout _toc2;
@@ -201,14 +200,14 @@ namespace CUETools.Ripper.SCSI
m_device = new Device(m_logger);
if (!m_device.Open(m_device_letter))
throw new Exception("Open failed: " + WinDev.Win32ErrorToString(m_device.LastError));
throw new Exception(Resource1.DeviceOpenError + ": " + WinDev.Win32ErrorToString(m_device.LastError));
// Get device info
st = m_device.Inquiry(out m_inqury_result);
if (st != Device.CommandStatus.Success || !m_inqury_result.Valid)
throw new SCSIException("Inquiry", m_device, st);
throw new SCSIException(Resource1.DeviceInquiryError, m_device, st);
if (m_inqury_result.PeripheralQualifier != 0 || m_inqury_result.PeripheralDeviceType != Device.MMCDeviceType)
throw new Exception(Path + " is not an MMC device");
throw new Exception(Path + ": " + Resource1.DeviceNotMMC);
m_max_sectors = Math.Min(NSECTORS, m_device.MaximumTransferLength / CB_AUDIO - 1);
//// Open/Initialize the driver
@@ -252,7 +251,7 @@ namespace CUETools.Ripper.SCSI
IList<TocEntry> toc;
st = m_device.ReadToc((byte)0, false, out toc);
if (st != Device.CommandStatus.Success)
throw new SCSIException("ReadTOC", m_device, st);
throw new SCSIException(Resource1.ReadTOCError, m_device, st);
//throw new Exception("ReadTOC: " + (st == Device.CommandStatus.DeviceFailed ? Device.LookupSenseError(m_device.GetSenseAsc(), m_device.GetSenseAscq()) : st.ToString()));
//byte[] qdata = null;
@@ -566,7 +565,7 @@ namespace CUETools.Ripper.SCSI
public unsafe bool DetectGaps()
{
if (!TestReadCommand())
throw new Exception("failed to autodetect read command:\n" + _autodetectResult);
throw new Exception(Resource1.AutodetectReadCommandFailed+ ":\n" + _autodetectResult);
if (_gapDetection == GapDetectionMethod.None)
{
@@ -715,8 +714,6 @@ namespace CUETools.Ripper.SCSI
bool found = false;
_autodetectResult = "";
_currentStart = 0;
_currentTrack = -1;
_currentIndex = -1;
m_max_sectors = Math.Min(NSECTORS, m_device.MaximumTransferLength / CB_AUDIO - 1);
int sector = 3;
int pass = 0;
@@ -810,16 +807,22 @@ namespace CUETools.Ripper.SCSI
int offs = 0;
if (c2Size == 296)
{
// TODO: sometimes sector C2 byte is placed after C2 info, not before!!
// TODO: sometimes (e.g on PIONEER 215D) sector C2 byte is placed after C2 info,
// not before, like it says in mmc6r02g.pdf !!
int c2 = 0;
for (int pos = 2; pos < 294; pos++)
c2 |= sectorPtr[4 * 588 + pos];
if (sectorPtr[4 * 588 + 294] == (c2 | sectorPtr[4 * 588 + 0] | sectorPtr[4 * 588 + 1]))
offs = 0;
else if (sectorPtr[4 * 588] == (c2 | sectorPtr[4 * 588 + 294] | sectorPtr[4 * 588 + 295]))
else
offs = 2;
else
throw new Exception("invalid C2 pointers");
// TSSTcorp CDDVDW SH-S203B SB03
// TSSTcorpCD/DVDW SH-W162C TS12
// Both produced Exception("invalid C2 pointers");
//else if (sectorPtr[4 * 588] == (c2 | sectorPtr[4 * 588 + 294] | sectorPtr[4 * 588 + 295]))
// offs = 2;
//else
// throw new Exception("invalid C2 pointers");
}
for (int pos = 0; pos < 294; pos++)
{
@@ -881,7 +884,7 @@ namespace CUETools.Ripper.SCSI
if (!abort)
return st;
SCSIException ex = new SCSIException("ReadCD", m_device, st);
SCSIException ex = new SCSIException(Resource1.ReadCDError, m_device, st);
if (sector != 0 && Sectors2Read > 1 && st == Device.CommandStatus.DeviceFailed && m_device.GetSenseAsc() == 0x64 && m_device.GetSenseAscq() == 0x00)
{
if (_debugMessages)
@@ -1139,7 +1142,7 @@ namespace CUETools.Ripper.SCSI
return;
if (!TestReadCommand())
throw new Exception("failed to autodetect read command:\n" + _autodetectResult);
throw new Exception(Resource1.AutodetectReadCommandFailed + "\n" + _autodetectResult);
_currentStart = iSector;
_currentEnd = _currentStart + MSECTORS;
@@ -1312,9 +1315,7 @@ namespace CUETools.Ripper.SCSI
set
{
if (_toc.AudioLength <= 0)
throw new Exception("no audio");
_currentTrack = -1;
_currentIndex = -1;
throw new Exception(Resource1.NoAudio);
_crcErrorsCount = 0;
_errorsCount = 0;
_currentStart = -1;
@@ -1363,7 +1364,7 @@ namespace CUETools.Ripper.SCSI
{
get
{
return "CUERipper v2.0.6 Copyright (C) 2008-10 Gregory S. Chudov";
return "CUERipper v2.0.7 Copyright (C) 2008-10 Gregory S. Chudov";
// ripper.GetName().Name + " " + ripper.GetName().Version;
}
}