diff --git a/CUEControls/BNComboBox.cs b/CUEControls/BNComboBox.cs
index 5eb4ee3..088caef 100644
--- a/CUEControls/BNComboBox.cs
+++ b/CUEControls/BNComboBox.cs
@@ -30,9 +30,9 @@ namespace CUEControls
private Rectangle rectBtn = new Rectangle(0, 0, 1, 1);
private Rectangle rectContent = new Rectangle(0, 0, 1, 1);
- private ToolStripControlHost _controlHost;
+ //private ToolStripControlHost _controlHost;
private ListBox _listBox;
- private ToolStripDropDown _popupControl;
+ //private ToolStripDropDown _popupControl;
private TextBox _textBox;
private DrawMode _drawMode = DrawMode.Normal;
@@ -153,9 +153,9 @@ namespace CUEControls
_isDroppedDown = value;
- if (!_isDroppedDown && _popupControl.IsDropDown)
+ if (!_isDroppedDown && _listBox.Visible)
{
- _popupControl.Close();
+ _listBox.Visible = false;
hovered = this.RectangleToScreen(this.ClientRectangle).Contains(MousePosition);
}
@@ -163,7 +163,9 @@ namespace CUEControls
{
_listBox.Width = _dropDownWidth;
_listBox.Height = CalculateListHeight();
- _popupControl.Show(this, CalculateDropPosition(), ToolStripDropDownDirection.BelowRight);
+ _listBox.Location = CalculateDropPosition();
+ _listBox.Show();
+ //_popupControl.Show(this, CalculateDropPosition(), ToolStripDropDownDirection.BelowRight);
Capture = false;
_listBox.Capture = true;
}
@@ -199,11 +201,12 @@ namespace CUEControls
{
get
{
- return _popupControl.DropShadowEnabled;
+ return true; // _popupControl.DropShadowEnabled;
}
set
{
- _popupControl.DropShadowEnabled = value;
+ // TODO
+ //_popupControl.DropShadowEnabled = value;
}
}
@@ -265,7 +268,7 @@ namespace CUEControls
_radius.TopRight = 6;
this.Height = 21;
- this.Width = 95;
+ this.Width = 95 + 100;
this.SuspendLayout();
_textBox = new TextBox();
@@ -278,32 +281,36 @@ namespace CUEControls
_textBox.Padding = new Padding(0);
_textBox.TextAlign = HorizontalAlignment.Left;
_textBox.Font = base.Font;
- this.Controls.Add(_textBox);
+
+ _listBox = new ListBox();
+ _listBox.IntegralHeight = true;
+ _listBox.BorderStyle = BorderStyle.None;
+ _listBox.SelectionMode = SelectionMode.One;
+ _listBox.DrawMode = DrawMode.OwnerDrawFixed;
+ _listBox.Font = base.Font;
+ //_listBox.DrawMode = DrawMode.Normal;
+ _listBox.BindingContext = new BindingContext();
+ _listBox.Visible = false;
+ _listBox.Parent = this;
+
+ this.Controls.Add(_textBox);
+ this.Controls.Add(_listBox);
this.ResumeLayout(false);
AdjustControls();
- _listBox = new ListBox();
- _listBox.IntegralHeight = true;
- _listBox.BorderStyle = BorderStyle.None;
- _listBox.SelectionMode = SelectionMode.One;
- _listBox.DrawMode = DrawMode.OwnerDrawFixed;
- _listBox.Font = base.Font;
- //_listBox.DrawMode = DrawMode.Normal;
- _listBox.BindingContext = new BindingContext();
+ //_controlHost = new ToolStripControlHost(_listBox);
+ //_controlHost.Padding = new Padding(0);
+ //_controlHost.Margin = new Padding(0);
+ //_controlHost.AutoSize = false;
- _controlHost = new ToolStripControlHost(_listBox);
- _controlHost.Padding = new Padding(0);
- _controlHost.Margin = new Padding(0);
- _controlHost.AutoSize = false;
-
- _popupControl = new ToolStripDropDown();
- _popupControl.Padding = new Padding(0);
- _popupControl.Margin = new Padding(0);
- _popupControl.AutoSize = true;
- _popupControl.AutoClose = true;
- _popupControl.DropShadowEnabled = true;
- _popupControl.Items.Add(_controlHost);
+ //_popupControl = new ToolStripDropDown();
+ //_popupControl.Padding = new Padding(0);
+ //_popupControl.Margin = new Padding(0);
+ //_popupControl.AutoSize = true;
+ //_popupControl.AutoClose = true;
+ //_popupControl.DropShadowEnabled = true;
+ //_popupControl.Items.Add(_controlHost);
_dropDownWidth = this.Width;
@@ -317,8 +324,8 @@ namespace CUEControls
_listBox.MouseMove += new MouseEventHandler(_listBox_MouseMove);
//(_listBox.DataManager as CurrencyManager).ListChanged += new ListChangedEventHandler(BNComboBox_ListChanged);
- _popupControl.Closing += new ToolStripDropDownClosingEventHandler(_popupControl_Closing);
- _popupControl.Closed += new ToolStripDropDownClosedEventHandler(_popupControl_Closed);
+ //_popupControl.Closing += new ToolStripDropDownClosingEventHandler(_popupControl_Closing);
+ //_popupControl.Closed += new ToolStripDropDownClosedEventHandler(_popupControl_Closed);
_textBox.Resize += new EventHandler(_textBox_Resize);
_textBox.TextChanged += new EventHandler(_textBox_TextChanged);
@@ -331,6 +338,17 @@ namespace CUEControls
#region Overrides
+ protected override CreateParams CreateParams
+ {
+ //[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
+ get
+ {
+ CreateParams cp = base.CreateParams;
+ cp.Style &= ~0x06000000;
+ return cp;
+ }
+ }
+
protected override void OnCreateControl()
{
base.OnCreateControl();
@@ -423,7 +441,7 @@ namespace CUEControls
Invalidate(true);
}
if (!this.RectangleToScreen(this.ClientRectangle).Contains(MousePosition) &&
- (!IsDroppedDown || !_popupControl.RectangleToScreen(_popupControl.ClientRectangle).Contains(MousePosition)))
+ (!IsDroppedDown || !_listBox.RectangleToScreen(_listBox.ClientRectangle).Contains(MousePosition)))
base.OnMouseLeave(e);
}
@@ -460,7 +478,7 @@ namespace CUEControls
get
{
if (base.ContainsFocus) return true;
- if (this.IsDroppedDown && _popupControl.ContainsFocus) return true;
+ if (this.IsDroppedDown && _listBox.ContainsFocus) return true;
//if (this.IsDroppedDown && _listBox.ContainsFocus) return true;
if (this._dropDownStyle != ComboBoxStyle.DropDownList && _textBox.ContainsFocus) return true;
return false;
@@ -1037,9 +1055,9 @@ namespace CUEControls
private Point CalculateDropPosition()
{
Point point = new Point(0, this.Height);
- if ((this.PointToScreen(new Point(0, 0)).Y + this.Height + _controlHost.Height) > Screen.PrimaryScreen.WorkingArea.Height)
+ if ((this.PointToScreen(new Point(0, 0)).Y + this.Height + _listBox.Height) > Screen.PrimaryScreen.WorkingArea.Height)
{
- point.Y = -this._controlHost.Height - 7;
+ point.Y = -this._listBox.Height - 7;
}
return point;
}
diff --git a/CUEControls/CUEControls.csproj b/CUEControls/CUEControls.csproj
index 61ab018..5b372e4 100644
--- a/CUEControls/CUEControls.csproj
+++ b/CUEControls/CUEControls.csproj
@@ -42,9 +42,6 @@
-
- Component
-
Component
@@ -52,6 +49,9 @@
FileSystemTreeView.cs
+
+ Component
+
UserControl
diff --git a/CUEControls/ImgComboBox.cs b/CUEControls/ImgComboBox.cs
new file mode 100644
index 0000000..aca2765
--- /dev/null
+++ b/CUEControls/ImgComboBox.cs
@@ -0,0 +1,480 @@
+using System.Windows.Forms;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms.Design;
+using System.ComponentModel;
+using System;
+
+namespace CUEControls
+{
+ public class ImgComboBox : ComboBox
+ {
+ private Rectangle rectBtn = new Rectangle(0, 0, 1, 1);
+ private Rectangle rectContent = new Rectangle(0, 0, 1, 1);
+ private Rectangle rectTextBounds = new Rectangle(0, 0, 1, 1);
+ private RectRadius _radius = new RectRadius(2, 6, 2, 2);
+
+ public ImgComboBox()
+ {
+ SetStyle(ControlStyles.AllPaintingInWmPaint, true);
+ SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
+ SetStyle(ControlStyles.ResizeRedraw, true);
+ SetStyle(ControlStyles.SupportsTransparentBackColor, true);
+ //SetStyle(ControlStyles.UserMouse, true);
+ SetStyle(ControlStyles.UserPaint, true);
+ //SetStyle(ControlStyles.Selectable, true);
+ base.BackColor = Color.Transparent;
+ base.DrawMode = DrawMode.OwnerDrawFixed;
+ AdjustControls();
+ }
+
+ #region Properties
+
+ private string _text;
+
+ [Localizable(true),Bindable(true)]
+ public override string Text
+ {
+ get
+ {
+ if (DropDownStyle != ComboBoxStyle.DropDownList || Items.Count != 0)
+ return base.Text;
+ return _text;
+ }
+ set
+ {
+ if (DropDownStyle != ComboBoxStyle.DropDownList || Items.Count != 0)
+ base.Text = value;
+ _text = value;
+ Invalidate();
+ }
+ }
+
+ private DrawMode _drawMode = DrawMode.Normal;
+
+ [DefaultValue(DrawMode.Normal)]
+ [Category("Behavior"), Description("Indicates whether the user code or this control will handle the drawing of elements in the list.")]
+ public new DrawMode DrawMode
+ {
+ get { return _drawMode; }
+ set
+ {
+ _drawMode = value;
+ base.DrawMode = value == DrawMode.Normal ? DrawMode.OwnerDrawFixed : value;
+ }
+ }
+
+ [Category("Appearance"), Description("Selects the radius of combobox edges.")]
+ [DefaultValue("2, 6, 2, 2")]
+ public RectRadius Radius
+ {
+ get { return _radius; }
+ set { if (value != null) _radius = value; }
+ }
+ private ImageList _imageList = null;
+
+ public ImageList ImageList
+ {
+ get
+ {
+ return _imageList;
+ }
+ set
+ {
+ _imageList = value;
+ AdjustControls();
+ }
+ }
+
+ private string _imageKeyMember = null;
+
+ [Category("Data"), Description("Indicates the property to use as a key to select images from ImageList."), DefaultValue(null)]
+ [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+ [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
+ [Browsable(true)]
+ public string ImageKeyMember
+ {
+ get
+ {
+ return _imageKeyMember;
+ }
+ set
+ {
+ _imageKeyMember = value;
+ }
+ }
+
+ #endregion
+
+ protected virtual Color GetOuterBorderColor()
+ {
+ return (Enabled) ? BackColor : BackColor;
+ }
+
+ protected virtual Color GetInnerBorderColor()
+ {
+ return (Enabled) ? BackColor : SystemColors.Control;
+ }
+
+ private void AdjustControls()
+ {
+ rectTextBounds.X = ClientRectangle.Left + 5 + (ImageList != null ? ImageList.ImageSize.Width + 5 : 0);
+ rectTextBounds.Y = ClientRectangle.Top + 4;
+ rectTextBounds.Width = ClientRectangle.Width - rectTextBounds.X - 18;
+ rectTextBounds.Height = ClientRectangle.Height - 8;
+
+ rectBtn.X = ClientRectangle.Width - 18;
+ rectBtn.Y = ClientRectangle.Top + 4;
+ rectBtn.Width = 18;
+ rectBtn.Height = ClientRectangle.Height - 8;
+
+ rectContent.X = ClientRectangle.Left;
+ rectContent.Y = ClientRectangle.Top;
+ rectContent.Width = ClientRectangle.Width;
+ rectContent.Height = ClientRectangle.Height;
+
+ Invalidate(true);
+ }
+
+ private int GetImageKey(int index)
+ {
+ if (this.ImageList == null || index < 0)
+ return -1;
+ object key = FilterItemOnProperty(Items[index], ImageKeyMember ?? DisplayMember);
+ if (key == null)
+ return -1;
+ if (key is int)
+ return (int)key;
+ if (key is string)
+ return this.ImageList.Images.IndexOfKey(key as string);
+ return -1;
+ }
+
+ protected override void OnResize(EventArgs e)
+ {
+ base.OnResize(e);
+ AdjustControls();
+ }
+
+ protected override void OnDrawItem(DrawItemEventArgs e)
+ {
+ if (_drawMode != DrawMode.Normal)
+ {
+ base.OnDrawItem(e);
+ return;
+ }
+ if ((e.State & DrawItemState.ComboBoxEdit) != 0)
+ return;
+ //if (e.State == DrawItemState.
+ //int _hoverItem = SelectedIndex;
+ Color fg = e.ForeColor; // _hoverItem != -1 && _hoverItem == e.Index ? SystemColors.HighlightText : ForeColor;
+ Color bg = e.BackColor; // _hoverItem != -1 && _hoverItem == e.Index ? SystemColors.Highlight : BackColor;
+
+ if (bg == SystemColors.Window || bg.A < 255)
+ e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);
+ else using (Brush b = new SolidBrush(bg))
+ e.Graphics.FillRectangle(b, e.Bounds);
+
+ if (e.Index >= 0)
+ {
+ Rectangle textBounds = e.Bounds;
+
+ textBounds.X += 5;
+ textBounds.Width -= 5;
+
+ // image
+ if (this.ImageList != null)
+ {
+ int idx = GetImageKey(e.Index);
+ if (idx >= 0)
+ this.ImageList.Draw(e.Graphics, e.Bounds.X + 5, e.Bounds.Y, idx);
+ textBounds.X += this.ImageList.ImageSize.Width + 5;
+ textBounds.Width -= this.ImageList.ImageSize.Width + 5;
+ }
+
+ //text
+ StringFormat sf = new StringFormat(StringFormatFlags.NoWrap);
+ sf.Alignment = StringAlignment.Near;
+ textBounds.Offset(-3, 0);
+ //textBounds.Height = _textBox.Height;
+ e.Graphics.DrawString(GetItemText(Items[e.Index]), this.Font, new SolidBrush(fg), textBounds, sf);
+ }
+ //base.OnDrawItem(e);
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ bool hovered = this.RectangleToScreen(this.ClientRectangle).Contains(MousePosition);
+
+ e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
+
+ //content border
+ Rectangle rectCont = rectContent;
+ rectCont.X += 1;
+ rectCont.Y += 1;
+ rectCont.Width -= 3;
+ rectCont.Height -= 3;
+ GraphicsPath pathContentBorder = CreateRoundRectangle(rectCont, Radius.TopLeft, Radius.TopRight, Radius.BottomRight,
+ Radius.BottomLeft);
+
+ //button border
+ Rectangle rectButton = rectBtn;
+ rectButton.X += 1;
+ rectButton.Y += 1;
+ rectButton.Width -= 3;
+ rectButton.Height -= 3;
+ GraphicsPath pathBtnBorder = CreateRoundRectangle(rectButton, 0, Radius.TopRight, Radius.BottomRight, 0);
+
+ //outer border
+ Rectangle rectOuter = rectContent;
+ rectOuter.Width -= 1;
+ rectOuter.Height -= 1;
+ GraphicsPath pathOuterBorder = CreateRoundRectangle(rectOuter, Radius.TopLeft, Radius.TopRight, Radius.BottomRight,
+ Radius.BottomLeft);
+
+ //inner border
+ Rectangle rectInner = rectContent;
+ rectInner.X += 1;
+ rectInner.Y += 1;
+ rectInner.Width -= 3;
+ rectInner.Height -= 3;
+ GraphicsPath pathInnerBorder = CreateRoundRectangle(rectInner, Radius.TopLeft, Radius.TopRight, Radius.BottomRight,
+ Radius.BottomLeft);
+
+ //brushes and pens
+ Color foreColor = Color.FromArgb(DroppedDown ? 100 : 50, ForeColor);
+ Brush brInnerBrush = new LinearGradientBrush(
+ new Rectangle(rectInner.X, rectInner.Y, rectInner.Width, rectInner.Height + 1),
+ Color.FromArgb((hovered || DroppedDown || Focused) ? 200 : 100, ForeColor),
+ Color.Transparent,
+ LinearGradientMode.Vertical);
+ Brush brBackground;
+ if (this.DropDownStyle == ComboBoxStyle.DropDownList)
+ brBackground = new LinearGradientBrush(pathInnerBorder.GetBounds(), BackColor, hovered ? Color.FromArgb(100, SystemColors.HotTrack) : foreColor, LinearGradientMode.Vertical);
+ else
+ brBackground = new SolidBrush(BackColor);
+ Pen penInnerBorder = new Pen(brInnerBrush, 0);
+ LinearGradientBrush brButtonLeft = new LinearGradientBrush(rectBtn, BackColor, ForeColor, LinearGradientMode.Vertical);
+ ColorBlend blend = new ColorBlend();
+ blend.Colors = new Color[] { Color.Transparent, foreColor, Color.Transparent };
+ blend.Positions = new float[] { 0.0f, 0.5f, 1.0f };
+ brButtonLeft.InterpolationColors = blend;
+ Pen penLeftButton = new Pen(brButtonLeft, 0);
+ Brush brButton = new LinearGradientBrush(pathBtnBorder.GetBounds(), BackColor, foreColor, LinearGradientMode.Vertical);
+
+ //draw
+ e.Graphics.FillPath(brBackground, pathContentBorder);
+ if (DropDownStyle != ComboBoxStyle.DropDownList)
+ {
+ e.Graphics.FillPath(brButton, pathBtnBorder);
+ }
+ Color outerBorderColor = GetOuterBorderColor();
+ if (outerBorderColor.IsSystemColor)
+ {
+ Pen penOuterBorder = SystemPens.FromSystemColor(outerBorderColor);
+ e.Graphics.DrawPath(penOuterBorder, pathOuterBorder);
+ }
+ else using (Pen penOuterBorder = new Pen(outerBorderColor))
+ e.Graphics.DrawPath(penOuterBorder, pathOuterBorder);
+ e.Graphics.DrawPath(penInnerBorder, pathInnerBorder);
+
+ e.Graphics.DrawLine(penLeftButton, rectBtn.Left + 1, rectInner.Top + 1, rectBtn.Left + 1, rectInner.Bottom - 1);
+
+
+ //Glimph
+ Rectangle rectGlimph = rectButton;
+ rectButton.Width -= 4;
+ e.Graphics.TranslateTransform(rectGlimph.Left + rectGlimph.Width / 2.0f, rectGlimph.Top + rectGlimph.Height / 2.0f);
+ GraphicsPath path = new GraphicsPath();
+ PointF[] points = new PointF[3];
+ points[0] = new PointF(-6 / 2.0f, -3 / 2.0f);
+ points[1] = new PointF(6 / 2.0f, -3 / 2.0f);
+ points[2] = new PointF(0, 6 / 2.0f);
+ path.AddLine(points[0], points[1]);
+ path.AddLine(points[1], points[2]);
+ path.CloseFigure();
+ e.Graphics.RotateTransform(0);
+
+ SolidBrush br = new SolidBrush(Enabled ? Color.Gray : Color.Gainsboro);
+ e.Graphics.FillPath(br, path);
+ e.Graphics.ResetTransform();
+ br.Dispose();
+ path.Dispose();
+
+ // image
+ if (ImageList != null)
+ {
+ int idx = GetImageKey(SelectedIndex);
+ if (idx >= 0)
+ this.ImageList.Draw(e.Graphics, rectTextBounds.Left - this.ImageList.ImageSize.Width - 5, rectContent.Y + 2, idx);
+ }
+
+ //text
+ if (DropDownStyle == ComboBoxStyle.DropDownList)
+ {
+ StringFormat sf = new StringFormat(StringFormatFlags.NoWrap);
+ sf.Alignment = StringAlignment.Near;
+
+ Rectangle rectText = rectTextBounds;
+ rectText.Offset(-3, 0);
+
+ SolidBrush foreBrush = new SolidBrush(ForeColor);
+ if (Enabled)
+ {
+ e.Graphics.DrawString(Text, this.Font, foreBrush, rectText, sf);
+ }
+ else
+ {
+ ControlPaint.DrawStringDisabled(e.Graphics, Text, Font, BackColor, rectText, sf);
+ }
+ }
+ /*
+ Dim foreBrush As SolidBrush = New SolidBrush(color)
+ If (enabled) Then
+ g.DrawString(text, font, foreBrush, rect, sf)
+ Else
+ ControlPaint.DrawStringDisabled(g, text, font, backColor, _
+ rect, sf)
+ End If
+ foreBrush.Dispose()*/
+
+
+ pathContentBorder.Dispose();
+ pathOuterBorder.Dispose();
+ pathInnerBorder.Dispose();
+ pathBtnBorder.Dispose();
+
+ penInnerBorder.Dispose();
+ penLeftButton.Dispose();
+
+ brBackground.Dispose();
+ brInnerBrush.Dispose();
+ brButtonLeft.Dispose();
+ brButton.Dispose();
+ }
+
+ public static GraphicsPath CreateRoundRectangle(Rectangle rectangle, int topLeftRadius, int topRightRadius,
+ int bottomRightRadius, int bottomLeftRadius)
+ {
+ GraphicsPath path = new GraphicsPath();
+ int l = rectangle.Left;
+ int t = rectangle.Top;
+ int w = rectangle.Width;
+ int h = rectangle.Height;
+
+ if (topLeftRadius > 0)
+ {
+ path.AddArc(l, t, topLeftRadius * 2, topLeftRadius * 2, 180, 90);
+ }
+ path.AddLine(l + topLeftRadius, t, l + w - topRightRadius, t);
+ if (topRightRadius > 0)
+ {
+ path.AddArc(l + w - topRightRadius * 2, t, topRightRadius * 2, topRightRadius * 2, 270, 90);
+ }
+ path.AddLine(l + w, t + topRightRadius, l + w, t + h - bottomRightRadius);
+ if (bottomRightRadius > 0)
+ {
+ path.AddArc(l + w - bottomRightRadius * 2, t + h - bottomRightRadius * 2,
+ bottomRightRadius * 2, bottomRightRadius * 2, 0, 90);
+ }
+ path.AddLine(l + w - bottomRightRadius, t + h, l + bottomLeftRadius, t + h);
+ if (bottomLeftRadius > 0)
+ {
+ path.AddArc(l, t + h - bottomLeftRadius * 2, bottomLeftRadius * 2, bottomLeftRadius * 2, 90, 90);
+ }
+ path.AddLine(l, t + h - bottomLeftRadius, l, t + topLeftRadius);
+ path.CloseFigure();
+ return path;
+ }
+ }
+
+ [TypeConverter(typeof(RectRadiusConverter))]
+ public class RectRadius : ICloneable
+ {
+ public static readonly RectRadius Default = new RectRadius();
+ public RectRadius()
+ : this(0,0,0,0)
+ {
+ }
+ public RectRadius(int topLeft, int topRight, int bottomLeft, int bottomRight)
+ {
+ TopLeft = topLeft;
+ TopRight = topRight;
+ BottomLeft = bottomLeft;
+ BottomRight = bottomRight;
+ }
+ public override bool Equals(object other)
+ {
+ RectRadius rrOther = other as RectRadius;
+ return rrOther.TopLeft == TopLeft && rrOther.TopRight == TopRight && rrOther.BottomLeft == BottomLeft && rrOther.BottomRight == BottomRight;
+ }
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+ object ICloneable.Clone()
+ {
+ return new RectRadius(TopLeft, TopRight, BottomLeft, BottomRight);
+ }
+ [RefreshProperties(RefreshProperties.All)]
+ public int TopLeft { get; set; }
+ [RefreshProperties(RefreshProperties.All)]
+ public int TopRight {get; set; }
+ [RefreshProperties(RefreshProperties.All)]
+ public int BottomLeft { get; set; }
+ [RefreshProperties(RefreshProperties.All)]
+ public int BottomRight { get; set; }
+ }
+
+ // Summary:
+ // Converts rectangles from one data type to another. Access this class through
+ // the System.ComponentModel.TypeDescriptor.
+ public class RectRadiusConverter : TypeConverter
+ {
+ public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
+ {
+ PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(RectRadius), attributes);
+ return props.Sort(new string[] { "TopLeft", "TopRight", "BottomLeft", "BottomRight" });
+ }
+
+ public override bool GetPropertiesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+ }
+
+ public class ImgComboBoxItem
+ {
+ string text;
+ string imageKey;
+ T value;
+
+ public string ImageKey
+ {
+ get
+ {
+ return imageKey;
+ }
+ }
+
+ public override string ToString()
+ {
+ return text ?? value.ToString();
+ }
+
+ public T Value
+ {
+ get
+ {
+ return value;
+ }
+ }
+
+ public ImgComboBoxItem(string text, string imageKey, T value)
+ {
+ this.text = text;
+ this.imageKey = imageKey;
+ this.value = value;
+ }
+ }
+}
diff --git a/CUERipper/frmCUERipper.Designer.cs b/CUERipper/frmCUERipper.Designer.cs
index 8e7f9cf..3416552 100644
--- a/CUERipper/frmCUERipper.Designer.cs
+++ b/CUERipper/frmCUERipper.Designer.cs
@@ -30,6 +30,13 @@ namespace CUERipper
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmCUERipper));
+ CUEControls.RectRadius rectRadius1 = new CUEControls.RectRadius();
+ CUEControls.RectRadius rectRadius2 = new CUEControls.RectRadius();
+ CUEControls.RectRadius rectRadius3 = new CUEControls.RectRadius();
+ CUEControls.RectRadius rectRadius4 = new CUEControls.RectRadius();
+ CUEControls.RectRadius rectRadius5 = new CUEControls.RectRadius();
+ CUEControls.RectRadius rectRadius6 = new CUEControls.RectRadius();
+ CUEControls.RectRadius rectRadius7 = new CUEControls.RectRadius();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelMusicBrainz = new System.Windows.Forms.ToolStripStatusLabel();
@@ -49,25 +56,27 @@ namespace CUERipper
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.variousToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fixEncodingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reloadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.numericWriteOffset = new System.Windows.Forms.NumericUpDown();
this.lblWriteOffset = new System.Windows.Forms.Label();
this.checkBoxEACMode = new System.Windows.Forms.CheckBox();
this.groupBoxSettings = new System.Windows.Forms.GroupBox();
- this.bnComboBoxLosslessOrNot = new CUEControls.BNComboBox();
+ this.bnComboBoxLosslessOrNot = new CUEControls.ImgComboBox();
this.losslessOrNotBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.bindingSourceCR = new System.Windows.Forms.BindingSource(this.components);
- this.bnComboBoxEncoder = new CUEControls.BNComboBox();
+ this.bnComboBoxEncoder = new CUEControls.ImgComboBox();
this.encodersBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.labelSecureMode = new System.Windows.Forms.Label();
- this.bnComboBoxFormat = new CUEControls.BNComboBox();
+ this.bnComboBoxFormat = new CUEControls.ImgComboBox();
this.formatsBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.labelEncoderMinMode = new System.Windows.Forms.Label();
- this.bnComboBoxImage = new CUEControls.BNComboBox();
+ this.bnComboBoxImage = new CUEControls.ImgComboBox();
this.cUEStylesBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.labelEncoderMaxMode = new System.Windows.Forms.Label();
this.labelEncoderMode = new System.Windows.Forms.Label();
this.trackBarEncoderMode = new System.Windows.Forms.TrackBar();
this.trackBarSecureMode = new System.Windows.Forms.TrackBar();
+ this.drivesBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.imageListChecked = new System.Windows.Forms.ImageList(this.components);
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.progressBarErrors = new ProgressODoom.ProgressBarEx();
@@ -79,12 +88,11 @@ namespace CUERipper
this.plainProgressPainter2 = new ProgressODoom.PlainProgressPainter();
this.txtOutputPath = new System.Windows.Forms.TextBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
- this.bnComboBoxRelease = new CUEControls.BNComboBox();
+ this.bnComboBoxRelease = new CUEControls.ImgComboBox();
this.releasesBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.imageListMetadataSource = new System.Windows.Forms.ImageList(this.components);
- this.bnComboBoxDrives = new CUEControls.BNComboBox();
- this.drivesBindingSource = new System.Windows.Forms.BindingSource(this.components);
- this.bnComboBoxOutputFormat = new CUEControls.BNComboBox();
+ this.bnComboBoxDrives = new CUEControls.ImgComboBox();
+ this.bnComboBoxOutputFormat = new CUEControls.ImgComboBox();
this.statusStrip1.SuspendLayout();
this.contextMenuStripRelease.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericWriteOffset)).BeginInit();
@@ -96,8 +104,8 @@ namespace CUERipper
((System.ComponentModel.ISupportInitialize)(this.cUEStylesBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBarEncoderMode)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackBarSecureMode)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.releasesBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.drivesBindingSource)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.releasesBindingSource)).BeginInit();
this.SuspendLayout();
//
// statusStrip1
@@ -127,6 +135,8 @@ namespace CUERipper
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
this.toolStripStatusLabelMusicBrainz.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenInner;
this.toolStripStatusLabelMusicBrainz.Image = global::CUERipper.Properties.Resources.musicbrainz;
+ this.toolStripStatusLabelMusicBrainz.IsLink = true;
+ this.toolStripStatusLabelMusicBrainz.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
this.toolStripStatusLabelMusicBrainz.Name = "toolStripStatusLabelMusicBrainz";
resources.ApplyResources(this.toolStripStatusLabelMusicBrainz, "toolStripStatusLabelMusicBrainz");
this.toolStripStatusLabelMusicBrainz.Click += new System.EventHandler(this.toolStripStatusLabelMusicBrainz_Click);
@@ -228,7 +238,8 @@ namespace CUERipper
this.contextMenuStripRelease.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.editToolStripMenuItem,
this.variousToolStripMenuItem,
- this.fixEncodingToolStripMenuItem});
+ this.fixEncodingToolStripMenuItem,
+ this.reloadToolStripMenuItem});
this.contextMenuStripRelease.Name = "contextMenuStripRelease";
resources.ApplyResources(this.contextMenuStripRelease, "contextMenuStripRelease");
this.contextMenuStripRelease.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripRelease_Opening);
@@ -251,6 +262,12 @@ namespace CUERipper
resources.ApplyResources(this.fixEncodingToolStripMenuItem, "fixEncodingToolStripMenuItem");
this.fixEncodingToolStripMenuItem.Click += new System.EventHandler(this.fixEncodingToolStripMenuItem_Click);
//
+ // reloadToolStripMenuItem
+ //
+ this.reloadToolStripMenuItem.Name = "reloadToolStripMenuItem";
+ resources.ApplyResources(this.reloadToolStripMenuItem, "reloadToolStripMenuItem");
+ this.reloadToolStripMenuItem.Click += new System.EventHandler(this.reloadToolStripMenuItem_Click);
+ //
// numericWriteOffset
//
resources.ApplyResources(this.numericWriteOffset, "numericWriteOffset");
@@ -299,24 +316,21 @@ namespace CUERipper
//
// bnComboBoxLosslessOrNot
//
- this.bnComboBoxLosslessOrNot.BackColor = System.Drawing.Color.White;
+ this.bnComboBoxLosslessOrNot.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxLosslessOrNot.DataSource = this.losslessOrNotBindingSource;
- this.bnComboBoxLosslessOrNot.DropDownHeight = 200;
this.bnComboBoxLosslessOrNot.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.bnComboBoxLosslessOrNot.DropDownWidth = 80;
this.bnComboBoxLosslessOrNot.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxLosslessOrNot.ImageKeyMember = "ImageKey";
this.bnComboBoxLosslessOrNot.ImageList = null;
- this.bnComboBoxLosslessOrNot.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxLosslessOrNot, "bnComboBoxLosslessOrNot");
- this.bnComboBoxLosslessOrNot.MaxDropDownItems = 8;
- this.bnComboBoxLosslessOrNot.MinimumSize = new System.Drawing.Size(40, 21);
+ this.bnComboBoxLosslessOrNot.MinimumSize = new System.Drawing.Size(40, 0);
this.bnComboBoxLosslessOrNot.Name = "bnComboBoxLosslessOrNot";
- this.bnComboBoxLosslessOrNot.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxLosslessOrNot.Radius")));
- this.bnComboBoxLosslessOrNot.SelectedIndex = -1;
- this.bnComboBoxLosslessOrNot.SelectedItem = null;
- this.bnComboBoxLosslessOrNot.Sorted = false;
- this.bnComboBoxLosslessOrNot.SelectedIndexChanged += new System.EventHandler(this.bnComboBoxLosslessOrNot_SelectedIndexChanged);
+ rectRadius1.BottomLeft = 2;
+ rectRadius1.BottomRight = 2;
+ rectRadius1.TopLeft = 2;
+ rectRadius1.TopRight = 6;
+ this.bnComboBoxLosslessOrNot.Radius = rectRadius1;
+ this.bnComboBoxLosslessOrNot.SelectedValueChanged += new System.EventHandler(this.bnComboBoxLosslessOrNot_SelectedValueChanged);
//
// losslessOrNotBindingSource
//
@@ -325,27 +339,24 @@ namespace CUERipper
//
// bindingSourceCR
//
- this.bindingSourceCR.DataSource = typeof(CUERipper.frmCUERipper);
+ this.bindingSourceCR.DataSource = typeof(CUERipper.CUERipperData);
//
// bnComboBoxEncoder
//
- this.bnComboBoxEncoder.BackColor = System.Drawing.Color.White;
+ this.bnComboBoxEncoder.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxEncoder.DataSource = this.encodersBindingSource;
- this.bnComboBoxEncoder.DropDownHeight = 200;
this.bnComboBoxEncoder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.bnComboBoxEncoder.DropDownWidth = 80;
this.bnComboBoxEncoder.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxEncoder.ImageList = null;
- this.bnComboBoxEncoder.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxEncoder, "bnComboBoxEncoder");
- this.bnComboBoxEncoder.MaxDropDownItems = 8;
- this.bnComboBoxEncoder.MinimumSize = new System.Drawing.Size(40, 21);
+ this.bnComboBoxEncoder.MinimumSize = new System.Drawing.Size(40, 0);
this.bnComboBoxEncoder.Name = "bnComboBoxEncoder";
- this.bnComboBoxEncoder.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxEncoder.Radius")));
- this.bnComboBoxEncoder.SelectedIndex = -1;
- this.bnComboBoxEncoder.SelectedItem = null;
- this.bnComboBoxEncoder.Sorted = false;
- this.bnComboBoxEncoder.SelectedIndexChanged += new System.EventHandler(this.comboBoxEncoder_SelectedIndexChanged);
+ rectRadius2.BottomLeft = 2;
+ rectRadius2.BottomRight = 2;
+ rectRadius2.TopLeft = 2;
+ rectRadius2.TopRight = 6;
+ this.bnComboBoxEncoder.Radius = rectRadius2;
+ this.bnComboBoxEncoder.SelectedValueChanged += new System.EventHandler(this.bnComboBoxEncoder_SelectedValueChanged);
//
// encodersBindingSource
//
@@ -359,24 +370,20 @@ namespace CUERipper
//
// bnComboBoxFormat
//
- this.bnComboBoxFormat.BackColor = System.Drawing.Color.White;
+ this.bnComboBoxFormat.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxFormat.DataSource = this.formatsBindingSource;
- this.bnComboBoxFormat.DropDownHeight = 200;
this.bnComboBoxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.bnComboBoxFormat.DropDownWidth = 80;
this.bnComboBoxFormat.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxFormat.ImageKeyMember = "DotExtension";
this.bnComboBoxFormat.ImageList = null;
- this.bnComboBoxFormat.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxFormat, "bnComboBoxFormat");
- this.bnComboBoxFormat.MaxDropDownItems = 8;
- this.bnComboBoxFormat.MinimumSize = new System.Drawing.Size(40, 21);
this.bnComboBoxFormat.Name = "bnComboBoxFormat";
- this.bnComboBoxFormat.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxFormat.Radius")));
- this.bnComboBoxFormat.SelectedIndex = -1;
- this.bnComboBoxFormat.SelectedItem = null;
- this.bnComboBoxFormat.Sorted = false;
- this.bnComboBoxFormat.SelectedIndexChanged += new System.EventHandler(this.bnComboBoxFormat_SelectedIndexChanged);
+ rectRadius3.BottomLeft = 2;
+ rectRadius3.BottomRight = 2;
+ rectRadius3.TopLeft = 2;
+ rectRadius3.TopRight = 6;
+ this.bnComboBoxFormat.Radius = rectRadius3;
+ this.bnComboBoxFormat.SelectedValueChanged += new System.EventHandler(this.bnComboBoxFormat_SelectedValueChanged);
//
// formatsBindingSource
//
@@ -390,22 +397,19 @@ namespace CUERipper
//
// bnComboBoxImage
//
- this.bnComboBoxImage.BackColor = System.Drawing.Color.White;
+ this.bnComboBoxImage.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxImage.DataSource = this.cUEStylesBindingSource;
- this.bnComboBoxImage.DropDownHeight = 200;
this.bnComboBoxImage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.bnComboBoxImage.DropDownWidth = 80;
this.bnComboBoxImage.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxImage.ImageList = null;
- this.bnComboBoxImage.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxImage, "bnComboBoxImage");
- this.bnComboBoxImage.MaxDropDownItems = 8;
- this.bnComboBoxImage.MinimumSize = new System.Drawing.Size(40, 21);
+ this.bnComboBoxImage.MinimumSize = new System.Drawing.Size(40, 0);
this.bnComboBoxImage.Name = "bnComboBoxImage";
- this.bnComboBoxImage.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxImage.Radius")));
- this.bnComboBoxImage.SelectedIndex = -1;
- this.bnComboBoxImage.SelectedItem = null;
- this.bnComboBoxImage.Sorted = false;
+ rectRadius4.BottomLeft = 2;
+ rectRadius4.BottomRight = 2;
+ rectRadius4.TopLeft = 2;
+ rectRadius4.TopRight = 6;
+ this.bnComboBoxImage.Radius = rectRadius4;
//
// cUEStylesBindingSource
//
@@ -432,11 +436,16 @@ namespace CUERipper
// trackBarSecureMode
//
resources.ApplyResources(this.trackBarSecureMode, "trackBarSecureMode");
- this.trackBarSecureMode.LargeChange = 3;
+ this.trackBarSecureMode.LargeChange = 1;
this.trackBarSecureMode.Maximum = 2;
this.trackBarSecureMode.Name = "trackBarSecureMode";
this.trackBarSecureMode.Scroll += new System.EventHandler(this.trackBarSecureMode_Scroll);
//
+ // drivesBindingSource
+ //
+ this.drivesBindingSource.DataMember = "Drives";
+ this.drivesBindingSource.DataSource = this.bindingSourceCR;
+ //
// imageListChecked
//
this.imageListChecked.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListChecked.ImageStream")));
@@ -529,26 +538,23 @@ namespace CUERipper
//
// bnComboBoxRelease
//
- this.bnComboBoxRelease.BackColor = System.Drawing.SystemColors.ControlLightLight;
+ this.bnComboBoxRelease.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxRelease.ContextMenuStrip = this.contextMenuStripRelease;
this.bnComboBoxRelease.DataSource = this.releasesBindingSource;
- this.bnComboBoxRelease.DropDownHeight = 200;
this.bnComboBoxRelease.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.bnComboBoxRelease.DropDownWidth = 552;
this.bnComboBoxRelease.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxRelease.ImageKeyMember = "ImageKey";
this.bnComboBoxRelease.ImageList = this.imageListMetadataSource;
- this.bnComboBoxRelease.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxRelease, "bnComboBoxRelease");
- this.bnComboBoxRelease.MaxDropDownItems = 8;
- this.bnComboBoxRelease.MinimumSize = new System.Drawing.Size(61, 21);
+ this.bnComboBoxRelease.MinimumSize = new System.Drawing.Size(61, 0);
this.bnComboBoxRelease.Name = "bnComboBoxRelease";
- this.bnComboBoxRelease.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxRelease.Radius")));
- this.bnComboBoxRelease.SelectedIndex = -1;
- this.bnComboBoxRelease.SelectedItem = null;
- this.bnComboBoxRelease.Sorted = false;
+ rectRadius5.BottomLeft = 2;
+ rectRadius5.BottomRight = 2;
+ rectRadius5.TopLeft = 2;
+ rectRadius5.TopRight = 6;
+ this.bnComboBoxRelease.Radius = rectRadius5;
this.toolTip1.SetToolTip(this.bnComboBoxRelease, resources.GetString("bnComboBoxRelease.ToolTip"));
- this.bnComboBoxRelease.SelectedIndexChanged += new System.EventHandler(this.bnComboBoxRelease_SelectedIndexChanged);
+ this.bnComboBoxRelease.SelectedValueChanged += new System.EventHandler(this.bnComboBoxRelease_SelectedValueChanged);
//
// releasesBindingSource
//
@@ -561,53 +567,42 @@ namespace CUERipper
this.imageListMetadataSource.TransparentColor = System.Drawing.Color.Transparent;
this.imageListMetadataSource.Images.SetKeyName(0, "musicbrainz");
this.imageListMetadataSource.Images.SetKeyName(1, "freedb");
+ this.imageListMetadataSource.Images.SetKeyName(2, "local");
//
// bnComboBoxDrives
//
- this.bnComboBoxDrives.BackColor = System.Drawing.SystemColors.ControlLightLight;
+ this.bnComboBoxDrives.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxDrives.DataSource = this.drivesBindingSource;
- this.bnComboBoxDrives.DropDownHeight = 200;
this.bnComboBoxDrives.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.bnComboBoxDrives.DropDownWidth = 552;
this.bnComboBoxDrives.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxDrives.ImageKeyMember = "ImageKey";
this.bnComboBoxDrives.ImageList = this.imageListMetadataSource;
- this.bnComboBoxDrives.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxDrives, "bnComboBoxDrives");
- this.bnComboBoxDrives.MaxDropDownItems = 8;
- this.bnComboBoxDrives.MinimumSize = new System.Drawing.Size(61, 21);
+ this.bnComboBoxDrives.MinimumSize = new System.Drawing.Size(61, 0);
this.bnComboBoxDrives.Name = "bnComboBoxDrives";
- this.bnComboBoxDrives.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxDrives.Radius")));
- this.bnComboBoxDrives.SelectedIndex = -1;
- this.bnComboBoxDrives.SelectedItem = null;
- this.bnComboBoxDrives.Sorted = false;
- this.bnComboBoxDrives.SelectedIndexChanged += new System.EventHandler(this.bnComboBoxDrives_SelectedIndexChanged);
- //
- // drivesBindingSource
- //
- this.drivesBindingSource.DataMember = "Drives";
- this.drivesBindingSource.DataSource = this.bindingSourceCR;
+ rectRadius6.BottomLeft = 2;
+ rectRadius6.BottomRight = 2;
+ rectRadius6.TopLeft = 2;
+ rectRadius6.TopRight = 6;
+ this.bnComboBoxDrives.Radius = rectRadius6;
+ this.bnComboBoxDrives.SelectedValueChanged += new System.EventHandler(this.bnComboBoxDrives_SelectedValueChanged);
//
// bnComboBoxOutputFormat
//
- this.bnComboBoxOutputFormat.BackColor = System.Drawing.SystemColors.ControlLightLight;
- this.bnComboBoxOutputFormat.DropDownHeight = 200;
- this.bnComboBoxOutputFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
- this.bnComboBoxOutputFormat.DropDownWidth = 552;
+ this.bnComboBoxOutputFormat.BackColor = System.Drawing.Color.Transparent;
this.bnComboBoxOutputFormat.ForeColor = System.Drawing.SystemColors.ControlText;
this.bnComboBoxOutputFormat.ImageList = null;
- this.bnComboBoxOutputFormat.IsDroppedDown = false;
resources.ApplyResources(this.bnComboBoxOutputFormat, "bnComboBoxOutputFormat");
- this.bnComboBoxOutputFormat.MaxDropDownItems = 8;
- this.bnComboBoxOutputFormat.MinimumSize = new System.Drawing.Size(40, 21);
+ this.bnComboBoxOutputFormat.MinimumSize = new System.Drawing.Size(40, 0);
this.bnComboBoxOutputFormat.Name = "bnComboBoxOutputFormat";
- this.bnComboBoxOutputFormat.Radius = ((CUEControls.BNRadius)(resources.GetObject("bnComboBoxOutputFormat.Radius")));
- this.bnComboBoxOutputFormat.SelectedIndex = -1;
- this.bnComboBoxOutputFormat.SelectedItem = null;
- this.bnComboBoxOutputFormat.Sorted = false;
- this.bnComboBoxOutputFormat.DroppedDown += new System.EventHandler(this.bnComboBoxOutputFormat_DroppedDown);
+ rectRadius7.BottomLeft = 2;
+ rectRadius7.BottomRight = 2;
+ rectRadius7.TopLeft = 2;
+ rectRadius7.TopRight = 6;
+ this.bnComboBoxOutputFormat.Radius = rectRadius7;
this.bnComboBoxOutputFormat.Leave += new System.EventHandler(this.bnComboBoxOutputFormat_Leave);
this.bnComboBoxOutputFormat.MouseLeave += new System.EventHandler(this.bnComboBoxOutputFormat_MouseLeave);
+ this.bnComboBoxOutputFormat.DropDown += new System.EventHandler(this.bnComboBoxOutputFormat_DroppedDown);
this.bnComboBoxOutputFormat.TextChanged += new System.EventHandler(this.bnComboBoxOutputFormat_TextChanged);
//
// frmCUERipper
@@ -647,8 +642,8 @@ namespace CUERipper
((System.ComponentModel.ISupportInitialize)(this.cUEStylesBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBarEncoderMode)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackBarSecureMode)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.releasesBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.drivesBindingSource)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.releasesBindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -693,24 +688,25 @@ namespace CUERipper
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelMusicBrainz;
private System.Windows.Forms.TextBox txtOutputPath;
private System.Windows.Forms.ToolTip toolTip1;
- private CUEControls.BNComboBox bnComboBoxImage;
+ private CUEControls.ImgComboBox bnComboBoxImage;
private System.Windows.Forms.BindingSource bindingSourceCR;
private System.Windows.Forms.ImageList imageListMetadataSource;
private System.Windows.Forms.BindingSource cUEStylesBindingSource;
- private CUEControls.BNComboBox bnComboBoxRelease;
+ private CUEControls.ImgComboBox bnComboBoxRelease;
private System.Windows.Forms.BindingSource releasesBindingSource;
- private CUEControls.BNComboBox bnComboBoxDrives;
+ private CUEControls.ImgComboBox bnComboBoxDrives;
private System.Windows.Forms.BindingSource drivesBindingSource;
- private CUEControls.BNComboBox bnComboBoxFormat;
+ private CUEControls.ImgComboBox bnComboBoxFormat;
private System.Windows.Forms.BindingSource formatsBindingSource;
- private CUEControls.BNComboBox bnComboBoxEncoder;
+ private CUEControls.ImgComboBox bnComboBoxEncoder;
private System.Windows.Forms.BindingSource encodersBindingSource;
- private CUEControls.BNComboBox bnComboBoxLosslessOrNot;
+ private CUEControls.ImgComboBox bnComboBoxLosslessOrNot;
private System.Windows.Forms.BindingSource losslessOrNotBindingSource;
- private CUEControls.BNComboBox bnComboBoxOutputFormat;
+ private CUEControls.ImgComboBox bnComboBoxOutputFormat;
private System.Windows.Forms.ImageList imageListChecked;
private System.Windows.Forms.ToolStripMenuItem variousToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fixEncodingToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem reloadToolStripMenuItem;
}
}
diff --git a/CUERipper/frmCUERipper.cs b/CUERipper/frmCUERipper.cs
index 085af54..4cb771a 100644
--- a/CUERipper/frmCUERipper.cs
+++ b/CUERipper/frmCUERipper.cs
@@ -28,11 +28,13 @@ namespace CUERipper
private StartStop _startStop;
private CUEConfig _config;
private CUESheet cueSheet;
- private ReleaseInfo selectedRelease;
+ private CUEMetadataEntry selectedRelease;
private DriveInfo selectedDriveInfo;
private string _pathOut;
string _defaultLosslessFormat, _defaultLossyFormat, _defaultHybridFormat;
private CUEControls.ShellIconMgr m_icon_mgr;
+ private string defaultDrive;
+ internal CUERipperData data = new CUERipperData();
public frmCUERipper()
{
@@ -55,65 +57,6 @@ namespace CUERipper
"%music%\\%artist%\\[%year% - ]%album%[ - %edition%]$ifgreater($max(%discnumber%,%totaldiscs%),1, - cd %discnumber%,)[' ('%unique%')']\\%artist% - %album%[ - %edition%].cue"
};
- private BindingList cueStyles = new BindingList { "image", "tracks" };
- //private BindingList losslessOrNot = new BindingList { "lossless", "lossy" };
- private BindingList> losslessOrNot = new BindingList> {
- new BNComboBoxItem("lossless", "checked", AudioEncoderType.Lossless),
- new BNComboBoxItem("lossy", "unchecked", AudioEncoderType.Lossy)
- };
- private BindingList releases = new BindingList();
- private BindingList drives = new BindingList();
- private BindingList formats = new BindingList();
- private BindingList encoders = new BindingList();
-
- public BindingList CUEStyles
- {
- get
- {
- return cueStyles;
- }
- }
-
- public BindingList> LosslessOrNot
- {
- get
- {
- return losslessOrNot;
- }
- }
-
- public BindingList Releases
- {
- get
- {
- return releases;
- }
- }
-
- public BindingList Drives
- {
- get
- {
- return drives;
- }
- }
-
- public BindingList Formats
- {
- get
- {
- return formats;
- }
- }
-
- public BindingList Encoders
- {
- get
- {
- return encoders;
- }
- }
-
private void frmCUERipper_Load(object sender, EventArgs e)
{
SettingsReader sr = new SettingsReader("CUERipper", "settings.txt", Application.ExecutablePath);
@@ -125,7 +68,7 @@ namespace CUERipper
//_config.preserveHTOA = sr.LoadBoolean("PreserveHTOA") ?? false;
//_config.createM3U = sr.LoadBoolean("CreateM3U") ?? true;
- bindingSourceCR.DataSource = this;
+ bindingSourceCR.DataSource = data;
bnComboBoxDrives.ImageList = m_icon_mgr.ImageList;
bnComboBoxFormat.ImageList = m_icon_mgr.ImageList;
SetupControls();
@@ -142,6 +85,7 @@ namespace CUERipper
bnComboBoxImage.SelectedIndex = sr.LoadInt32("ComboImage", 0, bnComboBoxImage.Items.Count - 1) ?? 0;
trackBarSecureMode.Value = sr.LoadInt32("SecureMode", 0, trackBarSecureMode.Maximum - 1) ?? 1;
trackBarSecureMode_Scroll(this, new EventArgs());
+ defaultDrive = sr.Load("DefaultDrive");
UpdateDrives();
}
@@ -171,7 +115,10 @@ namespace CUERipper
if (val == DBT_DEVICEARRIVAL || val == DBT_DEVICEREMOVECOMPLETE)
UpdateDrive();
else if (val == DBT_DEVNODES_CHANGED)
- UpdateDrives();
+ {
+ if (_workThread == null)
+ UpdateDrives();
+ }
}
base.WndProc(ref m);
}
@@ -179,7 +126,7 @@ namespace CUERipper
private void DrivesLookup(object o)
{
// Lookup
- drives.RaiseListChangedEvents = false;
+ data.Drives.RaiseListChangedEvents = false;
foreach (char drive in CDDrivesList.DrivesAvailable())
{
ICDRipper reader = null;
@@ -204,35 +151,40 @@ namespace CUERipper
}
catch
{
- drives.Add(new DriveInfo(m_icon_mgr, drive + ":\\", ex.Message));
+ data.Drives.Add(new DriveInfo(m_icon_mgr, drive + ":\\", ex.Message));
continue;
}
}
if (!AccurateRipVerify.FindDriveReadOffset(arName, out driveOffset))
; //throw new Exception("Failed to find drive read offset for drive" + _ripper.ARName);
reader.DriveOffset = driveOffset;
- drives.Add(new DriveInfo(m_icon_mgr, drive + ":\\", reader));
+ data.Drives.Add(new DriveInfo(m_icon_mgr, drive + ":\\", reader));
}
- _workThread = null;
this.BeginInvoke((MethodInvoker)delegate()
{
+ data.Drives.RaiseListChangedEvents = true;
+ data.Drives.ResetBindings();
+ for(int i = 0; i < bnComboBoxDrives.Items.Count; i++)
+ if ((bnComboBoxDrives.Items[i] as DriveInfo).Path == defaultDrive)
+ bnComboBoxDrives.SelectedIndex = i;
+ _workThread = null;
SetupControls();
- drives.RaiseListChangedEvents = true;
- drives.ResetBindings();
- if (drives.Count == 0)
+ if (data.Drives.Count == 0)
bnComboBoxDrives.Text = Properties.Resources.NoDrives;
+ else
+ UpdateDrive();
});
}
private void UpdateDrives()
{
buttonGo.Enabled = false;
- foreach (DriveInfo driveInfo in drives)
+ foreach (DriveInfo driveInfo in data.Drives)
if (driveInfo.drive != null)
driveInfo.drive.Close();
- drives.Clear();
+ data.Drives.Clear();
listTracks.Items.Clear();
- releases.Clear();
+ data.Releases.Clear();
selectedRelease = null;
selectedDriveInfo = null;
bnComboBoxRelease.Text = "";
@@ -259,8 +211,8 @@ namespace CUERipper
bnComboBoxOutputFormat.Visible = outputFormatVisible;
txtOutputPath.Visible = !outputFormatVisible;
txtOutputPath.Enabled = !running && !outputFormatVisible;
- bnComboBoxRelease.Enabled = !running && releases.Count > 0;
- bnComboBoxDrives.Enabled = !running && drives.Count > 0;
+ bnComboBoxRelease.Enabled = !running && data.Releases.Count > 0;
+ bnComboBoxDrives.Enabled = !running && data.Drives.Count > 0;
bnComboBoxOutputFormat.Enabled =
listTracks.Enabled =
groupBoxSettings.Enabled = !running;
@@ -399,7 +351,7 @@ namespace CUERipper
{
this.BeginInvoke((MethodInvoker)delegate()
{
- releases.Clear();
+ data.Releases.Clear();
selectedRelease = null;
bnComboBoxRelease.Text = ex.Message;
});
@@ -424,6 +376,8 @@ namespace CUERipper
bnComboBoxOutputFormat.Items.RemoveAt(OutputPathUseTemplates.Length + 10);
}
+ selectedRelease.metadata.Save();
+
cueSheet.CopyMetadata(selectedRelease.metadata);
cueSheet.OutputStyle = bnComboBoxImage.SelectedIndex == 0 ? CUEStyle.SingleFileWithCUE :
CUEStyle.GapsAppended;
@@ -458,7 +412,7 @@ namespace CUERipper
private void UpdateRelease()
{
listTracks.Items.Clear();
- selectedRelease = bnComboBoxRelease.SelectedItem as ReleaseInfo;
+ selectedRelease = bnComboBoxRelease.SelectedItem as CUEMetadataEntry;
comboBoxOutputFormat_TextUpdate(this, new EventArgs());
if (selectedRelease == null)
return;
@@ -485,43 +439,42 @@ namespace CUERipper
});
}
- private ReleaseInfo CreateCUESheet(ICDRipper audioSource, Release release, CDEntry cdEntry)
+ private CUEMetadataEntry CreateCUESheet(ICDRipper audioSource, Release release)
{
- ReleaseInfo r = new ReleaseInfo(_config, audioSource.TOC);
- General.SetCUELine(r.metadata.Attributes, "REM", "GENRE", "", true);
- General.SetCUELine(r.metadata.Attributes, "REM", "DATE", "", false);
- if (release != null)
- {
- r.metadata.FillFromMusicBrainz(release);
- r.ImageKey = "musicbrainz";
- }
- else if (cdEntry != null)
- {
- r.metadata.FillFromFreedb(cdEntry);
- r.ImageKey = "freedb";
- }
- else
- {
- r.metadata.Artist = "Unknown Artist";
- r.metadata.Title = "Unknown Title";
- for (int i = 0; i < audioSource.TOC.AudioTracks; i++)
- {
- r.metadata.Tracks[i].Title = string.Format("Track {0:00}", i + 1);
- r.metadata.Tracks[i].Artist = r.metadata.Artist;
- }
- }
- if (r.metadata.Genre == "") r.metadata.Genre = "";
- if (r.metadata.Year == "") r.metadata.Year = "";
- return r;
+ CUEMetadataEntry entry = new CUEMetadataEntry(audioSource.TOC, "musicbrainz");
+ entry.metadata.FillFromMusicBrainz(release, entry.TOC.FirstAudio - 1);
+ return entry;
}
+ private CUEMetadataEntry CreateCUESheet(ICDRipper audioSource, CDEntry cdEntry)
+ {
+ CUEMetadataEntry entry = new CUEMetadataEntry(audioSource.TOC, "freedb");
+ entry.metadata.FillFromFreedb(cdEntry, entry.TOC.FirstAudio - 1);
+ return entry;
+ }
+
+ private CUEMetadataEntry CreateCUESheet(ICDRipper audioSource)
+ {
+ CUEMetadataEntry entry = new CUEMetadataEntry(audioSource.TOC, "local");
+ entry.metadata.Artist = "Unknown Artist";
+ entry.metadata.Title = "Unknown Title";
+ for (int i = 0; i < entry.TOC.AudioTracks; i++)
+ {
+ entry.metadata.Tracks[i].Title = string.Format("Track {0:00}", i + 1);
+ entry.metadata.Tracks[i].Artist = entry.metadata.Artist;
+ }
+ return entry;
+ }
+
+ private bool loadAllMetadata = false;
+
private void Lookup(object o)
{
ICDRipper audioSource = o as ICDRipper;
int mbresults_count = 0; // have to cache results.Count, because it sometimes hangs in it, and we don't want UI thread to hang.
string musicbrainzError = "";
- releases.RaiseListChangedEvents = false;
+ data.Releases.RaiseListChangedEvents = false;
cueSheet = new CUESheet(_config);
cueSheet.OpenCD(audioSource);
@@ -532,86 +485,103 @@ namespace CUERipper
cueSheet.CTDB.UploadHelper.onProgress += new EventHandler(UploadProgress);
this.BeginInvoke((MethodInvoker)delegate() { toolStripStatusLabel1.Text = Properties.Resources.LookingUpVia + " AccurateRip..."; });
cueSheet.UseAccurateRip();
- this.BeginInvoke((MethodInvoker)delegate() { toolStripStatusLabel1.Text = Properties.Resources.LookingUpVia + " MusicBrainz..."; });
General.SetCUELine(cueSheet.Attributes, "REM", "DISCID", AccurateRipVerify.CalculateCDDBId(audioSource.TOC), false);
General.SetCUELine(cueSheet.Attributes, "REM", "COMMENT", _config.createEACLOG ? "ExactAudioCopy v0.99pb4" : audioSource.RipperVersion, true);
- ReleaseQueryParameters p = new ReleaseQueryParameters();
- p.DiscId = audioSource.TOC.MusicBrainzId;
- Query results = Release.Query(p);
- MusicBrainzService.XmlRequest += new EventHandler(MusicBrainz_LookupProgress);
-
try
{
- foreach (Release release in results)
- {
- release.GetEvents();
- release.GetTracks();
- releases.Add(CreateCUESheet(audioSource, release, null));
- }
- mbresults_count = results.Count;
+ CUEMetadata cache = CUEMetadata.Load(audioSource.TOC.TOCID);
+ if (cache != null)
+ data.Releases.Add(new CUEMetadataEntry(cache, audioSource.TOC, "local"));
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine(ex.Message);
- if (!(ex is MusicBrainzNotFoundException))
- musicbrainzError = ex.Message;
}
- MusicBrainzService.XmlRequest -= new EventHandler(MusicBrainz_LookupProgress);
-
- FreedbHelper m_freedb = new FreedbHelper();
-
- m_freedb.UserName = "gchudov";
- m_freedb.Hostname = "gmail.com";
- m_freedb.ClientName = "CUERipper";
- m_freedb.Version = "2.0.8";
- m_freedb.SetDefaultSiteAddress(Properties.Settings.Default.MAIN_FREEDB_SITEADDRESS);
-
- QueryResult queryResult;
- QueryResultCollection coll;
- string code = string.Empty;
- try
+ if (data.Releases.Count == 0 || loadAllMetadata)
{
- MusicBrainz_LookupProgress(this, null);
- code = m_freedb.Query(AccurateRipVerify.CalculateCDDBQuery(audioSource.TOC), out queryResult, out coll);
- if (code == FreedbHelper.ResponseCodes.CODE_200)
+ loadAllMetadata = false;
+
+ this.BeginInvoke((MethodInvoker)delegate() { toolStripStatusLabel1.Text = Properties.Resources.LookingUpVia + " MusicBrainz..."; });
+
+ ReleaseQueryParameters p = new ReleaseQueryParameters();
+ p.DiscId = audioSource.TOC.MusicBrainzId;
+ Query results = Release.Query(p);
+ MusicBrainzService.XmlRequest += new EventHandler(MusicBrainz_LookupProgress);
+
+ try
{
- CDEntry cdEntry;
- MusicBrainz_LookupProgress(this, null);
- code = m_freedb.Read(queryResult, out cdEntry);
- if (code == FreedbHelper.ResponseCodes.CODE_210)
+ foreach (Release release in results)
{
- ReleaseInfo r = CreateCUESheet(audioSource, null, cdEntry);
- releases.Add(r);
+ release.GetEvents();
+ release.GetTracks();
+ data.Releases.Add(CreateCUESheet(audioSource, release));
}
+ mbresults_count = results.Count;
}
- else
- if (code == FreedbHelper.ResponseCodes.CODE_210 ||
- code == FreedbHelper.ResponseCodes.CODE_211 )
+ catch (Exception ex)
{
- foreach (QueryResult qr in coll)
+ System.Diagnostics.Trace.WriteLine(ex.Message);
+ if (!(ex is MusicBrainzNotFoundException))
+ musicbrainzError = ex.Message;
+ }
+ MusicBrainzService.XmlRequest -= new EventHandler(MusicBrainz_LookupProgress);
+
+
+ FreedbHelper m_freedb = new FreedbHelper();
+
+ m_freedb.UserName = "gchudov";
+ m_freedb.Hostname = "gmail.com";
+ m_freedb.ClientName = "CUERipper";
+ m_freedb.Version = "2.0.8";
+ m_freedb.SetDefaultSiteAddress(Properties.Settings.Default.MAIN_FREEDB_SITEADDRESS);
+
+ QueryResult queryResult;
+ QueryResultCollection coll;
+ string code = string.Empty;
+ try
+ {
+ MusicBrainz_LookupProgress(this, null);
+ code = m_freedb.Query(AccurateRipVerify.CalculateCDDBQuery(audioSource.TOC), out queryResult, out coll);
+ if (code == FreedbHelper.ResponseCodes.CODE_200)
{
CDEntry cdEntry;
MusicBrainz_LookupProgress(this, null);
- code = m_freedb.Read(qr, out cdEntry);
+ code = m_freedb.Read(queryResult, out cdEntry);
if (code == FreedbHelper.ResponseCodes.CODE_210)
{
- ReleaseInfo r = CreateCUESheet(audioSource, null, cdEntry);
- releases.Add(r);
+ CUEMetadataEntry r = CreateCUESheet(audioSource, cdEntry);
+ data.Releases.Add(r);
}
}
+ else
+ if (code == FreedbHelper.ResponseCodes.CODE_210 ||
+ code == FreedbHelper.ResponseCodes.CODE_211)
+ {
+ foreach (QueryResult qr in coll)
+ {
+ CDEntry cdEntry;
+ MusicBrainz_LookupProgress(this, null);
+ code = m_freedb.Read(qr, out cdEntry);
+ if (code == FreedbHelper.ResponseCodes.CODE_210)
+ {
+ CUEMetadataEntry r = CreateCUESheet(audioSource, cdEntry);
+ data.Releases.Add(r);
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ System.Diagnostics.Trace.WriteLine(ex.Message);
}
}
- catch (Exception ex)
- {
- System.Diagnostics.Trace.WriteLine(ex.Message);
- }
- if (releases.Count == 0)
+ if (data.Releases.Count == 0)
{
- releases.Add(CreateCUESheet(audioSource, null, null));
+ data.Releases.Add(CreateCUESheet(audioSource));
}
_workThread = null;
if (musicbrainzError != "")
@@ -619,8 +589,8 @@ namespace CUERipper
this.BeginInvoke((MethodInvoker)delegate()
{
SetupControls();
- releases.RaiseListChangedEvents = true;
- releases.ResetBindings();
+ data.Releases.RaiseListChangedEvents = true;
+ data.Releases.ResetBindings();
//bnComboBoxRelease.SelectedIndex = 0;
toolStripStatusAr.Enabled = cueSheet.ArVerify.ARStatus == null;
toolStripStatusAr.Text = cueSheet.ArVerify.ARStatus == null ? cueSheet.ArVerify.WorstTotal().ToString() : "";
@@ -637,10 +607,12 @@ namespace CUERipper
private void UpdateDrive()
{
- selectedDriveInfo = bnComboBoxDrives.SelectedItem as DriveInfo;
- if (selectedDriveInfo == null)
+ if (bnComboBoxDrives.SelectedItem as DriveInfo == null)
return;
+ selectedDriveInfo = bnComboBoxDrives.SelectedItem as DriveInfo;
+ defaultDrive = selectedDriveInfo.Path;
+
toolStripStatusAr.Enabled = false;
toolStripStatusAr.Text = "";
toolStripStatusAr.ToolTipText = "";
@@ -652,7 +624,7 @@ namespace CUERipper
toolStripStatusLabelMusicBrainz.ToolTipText = "";
buttonGo.Enabled = false;
listTracks.Items.Clear();
- releases.Clear();
+ data.Releases.Clear();
selectedRelease = null;
bnComboBoxRelease.Enabled = false;
bnComboBoxRelease.Text = "";
@@ -677,6 +649,7 @@ namespace CUERipper
numericWriteOffset.Value = selectedDriveInfo.drive.DriveOffset;
//selectedDriveInfo.drive.Close();
bnComboBoxRelease.Text = ex.Message;
+ //bnComboBoxRelease.Enabled = false;
return;
}
if (selectedDriveInfo.drive.TOC.AudioTracks == 0)
@@ -732,22 +705,21 @@ namespace CUERipper
{
if (selectedRelease == null) return;
bool isVarious = false;
- for (int i = 0; i < selectedRelease.metadata.TOC.AudioTracks; i++)
+ for (int i = 0; i < selectedRelease.metadata.Tracks.Count; i++)
if (selectedRelease.metadata.Tracks[i].Artist != selectedRelease.metadata.Artist)
isVarious = true;
variousToolStripMenuItem.Enabled = selectedRelease.ImageKey == "freedb" && !isVarious;
- ReleaseInfo r = new ReleaseInfo(_config, selectedRelease.metadata.TOC);
- r.metadata.CopyMetadata(selectedRelease.metadata);
- fixEncodingToolStripMenuItem.Enabled = selectedRelease.ImageKey == "freedb" && r.metadata.FreedbToEncoding();
+ CUEMetadata copy = new CUEMetadata(selectedRelease.metadata);
+ fixEncodingToolStripMenuItem.Enabled = selectedRelease.ImageKey == "freedb" && copy.FreedbToEncoding();
}
private void editToolStripMenuItem_Click(object sender, EventArgs e)
{
if (selectedRelease == null) return;
frmProperties frm = new frmProperties();
- frm.CUE = selectedRelease.metadata;
+ frm.Metadata = selectedRelease.metadata;
frm.ShowDialog();
- releases.ResetItem(bnComboBoxRelease.SelectedIndex);
+ data.Releases.ResetItem(bnComboBoxRelease.SelectedIndex);
comboBoxOutputFormat_TextUpdate(sender, e);
}
@@ -756,7 +728,7 @@ namespace CUERipper
if (selectedRelease == null) return;
selectedRelease.metadata.FreedbToVarious();
UpdateRelease();
- releases.ResetItem(bnComboBoxRelease.SelectedIndex);
+ data.Releases.ResetItem(bnComboBoxRelease.SelectedIndex);
}
private void fixEncodingToolStripMenuItem_Click(object sender, EventArgs e)
@@ -764,10 +736,23 @@ namespace CUERipper
if (selectedRelease == null) return;
selectedRelease.metadata.FreedbToEncoding();
UpdateRelease();
- releases.ResetItem(bnComboBoxRelease.SelectedIndex);
+ data.Releases.ResetItem(bnComboBoxRelease.SelectedIndex);
comboBoxOutputFormat_TextUpdate(sender, e);
}
+ private void reloadToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ loadAllMetadata = true;
+ data.Releases.Clear();
+ selectedRelease = null;
+ UpdateRelease();
+ _workThread = new Thread(Lookup);
+ _workThread.Priority = ThreadPriority.BelowNormal;
+ _workThread.IsBackground = true;
+ SetupControls();
+ _workThread.Start(selectedDriveInfo.drive);
+ }
+
private void frmCUERipper_FormClosed(object sender, FormClosedEventArgs e)
{
SettingsWriter sw = new SettingsWriter("CUERipper", "settings.txt", Application.ExecutablePath);
@@ -786,6 +771,8 @@ namespace CUERipper
for (int iFormat = bnComboBoxOutputFormat.Items.Count - 1; iFormat >= OutputPathUseTemplates.Length; iFormat--)
sw.Save(string.Format("OutputPathUseTemplate{0}", iFormat - OutputPathUseTemplates.Length), bnComboBoxOutputFormat.Items[iFormat].ToString());
+ if (defaultDrive != null)
+ sw.Save("DefaultDrive", defaultDrive);
sw.Close();
}
@@ -803,7 +790,7 @@ namespace CUERipper
}
set
{
- foreach (FormatInfo fmt in formats)
+ foreach (FormatInfo fmt in data.Formats)
if (fmt.ToString() == value)
bnComboBoxFormat.SelectedItem = fmt;
}
@@ -823,11 +810,11 @@ namespace CUERipper
{
get
{
- return (bnComboBoxLosslessOrNot.SelectedItem as BNComboBoxItem).Value;
+ return (bnComboBoxLosslessOrNot.SelectedItem as ImgComboBoxItem).Value;
}
set
{
- foreach (BNComboBoxItem item in losslessOrNot)
+ foreach (ImgComboBoxItem item in data.LosslessOrNot)
if (value == item.Value)
{
bnComboBoxLosslessOrNot.SelectedItem = item;
@@ -842,7 +829,7 @@ namespace CUERipper
_config.createEACLOG = checkBoxEACMode.Checked;
}
- private void comboBoxEncoder_SelectedIndexChanged(object sender, EventArgs e)
+ private void bnComboBoxEncoder_SelectedValueChanged(object sender, EventArgs e)
{
if (SelectedOutputAudioFormat == null)
return;
@@ -902,7 +889,10 @@ namespace CUERipper
private void frmCUERipper_KeyDown(object sender, KeyEventArgs e)
{
if (_workThread == null && e.KeyCode == Keys.F5)
+ {
+ loadAllMetadata = true;
UpdateDrives();
+ }
}
private void comboBoxOutputFormat_SelectedIndexChanged(object sender, EventArgs e)
@@ -913,17 +903,25 @@ namespace CUERipper
private void comboBoxOutputFormat_TextUpdate(object sender, EventArgs e)
{
if (selectedFormat == null) return;
+ if (selectedRelease == null)
+ {
+ txtOutputPath.Text = "";
+ return;
+ }
CUEStyle style = bnComboBoxImage.SelectedIndex == 0 ? CUEStyle.SingleFileWithCUE : CUEStyle.GapsAppended;
- txtOutputPath.Text = selectedRelease == null ? "" : selectedRelease.metadata.GenerateUniqueOutputPath(bnComboBoxOutputFormat.Text,
+ CUESheet sheet = new CUESheet(_config);
+ sheet.TOC = selectedDriveInfo.drive.TOC;
+ sheet.CopyMetadata(selectedRelease.metadata);
+ txtOutputPath.Text = sheet.GenerateUniqueOutputPath(bnComboBoxOutputFormat.Text,
style == CUEStyle.SingleFileWithCUE ? "." + selectedFormat.ToString() : ".cue", CUEAction.Encode, null);
}
- private void bnComboBoxRelease_SelectedIndexChanged(object sender, EventArgs e)
+ private void bnComboBoxRelease_SelectedValueChanged(object sender, EventArgs e)
{
UpdateRelease();
}
- private void bnComboBoxDrives_SelectedIndexChanged(object sender, EventArgs e)
+ private void bnComboBoxDrives_SelectedValueChanged(object sender, EventArgs e)
{
if (_workThread == null)
UpdateDrive();
@@ -931,11 +929,11 @@ namespace CUERipper
private FormatInfo selectedFormat;
- private void bnComboBoxFormat_SelectedIndexChanged(object sender, EventArgs e)
+ private void bnComboBoxFormat_SelectedValueChanged(object sender, EventArgs e)
{
selectedFormat = bnComboBoxFormat.SelectedItem as FormatInfo;
- encoders.Clear();
+ data.Encoders.Clear();
if (SelectedOutputAudioFmt == null)
return;
@@ -952,7 +950,7 @@ namespace CUERipper
break;
}
- encoders.RaiseListChangedEvents = false;
+ data.Encoders.RaiseListChangedEvents = false;
foreach (CUEToolsUDC encoder in _config.encoders)
if (encoder.extension == SelectedOutputAudioFmt.extension)
@@ -961,24 +959,24 @@ namespace CUERipper
continue;
if (SelectedOutputAudioType == AudioEncoderType.Lossy && (encoder.lossless && !selectedFormat.lossyWAV))
continue;
- encoders.Add(encoder);
+ data.Encoders.Add(encoder);
}
CUEToolsUDC select = SelectedOutputAudioFormat.StartsWith("lossy.") ? SelectedOutputAudioFmt.encoderLossless
: SelectedOutputAudioType == AudioEncoderType.Lossless ? SelectedOutputAudioFmt.encoderLossless
: SelectedOutputAudioFmt.encoderLossy;
- encoders.RaiseListChangedEvents = true;
- encoders.ResetBindings();
+ data.Encoders.RaiseListChangedEvents = true;
+ data.Encoders.ResetBindings();
bnComboBoxEncoder.SelectedItem = select;
comboBoxOutputFormat_TextUpdate(sender, e);
}
- private void bnComboBoxLosslessOrNot_SelectedIndexChanged(object sender, EventArgs e)
+ private void bnComboBoxLosslessOrNot_SelectedValueChanged(object sender, EventArgs e)
{
if (bnComboBoxLosslessOrNot.SelectedItem == null) return;
- formats.Clear();
- formats.RaiseListChangedEvents = false;
+ data.Formats.Clear();
+ data.Formats.RaiseListChangedEvents = false;
foreach (KeyValuePair format in _config.formats)
{
if (SelectedOutputAudioType == AudioEncoderType.Lossless && !format.Value.allowLossless)
@@ -987,7 +985,7 @@ namespace CUERipper
continue;
if (SelectedOutputAudioType == AudioEncoderType.Lossy && !format.Value.allowLossy)
continue;
- formats.Add(new FormatInfo(format.Value, false));
+ data.Formats.Add(new FormatInfo(format.Value, false));
}
foreach (KeyValuePair format in _config.formats)
{
@@ -997,7 +995,7 @@ namespace CUERipper
continue;
if (SelectedOutputAudioType == AudioEncoderType.NoAudio)
continue;
- formats.Add(new FormatInfo(format.Value, true));
+ data.Formats.Add(new FormatInfo(format.Value, true));
}
string select = null;
switch (SelectedOutputAudioType)
@@ -1012,8 +1010,8 @@ namespace CUERipper
select = _defaultHybridFormat;
break;
}
- formats.RaiseListChangedEvents = true;
- formats.ResetBindings();
+ data.Formats.RaiseListChangedEvents = true;
+ data.Formats.ResetBindings();
SelectedOutputAudioFormat = select;
}
@@ -1045,7 +1043,7 @@ namespace CUERipper
private void bnComboBoxOutputFormat_DroppedDown(object sender, EventArgs e)
{
- if (!outputFormatVisible || bnComboBoxOutputFormat.IsDroppedDown || bnComboBoxOutputFormat.Focused)
+ if (!outputFormatVisible || bnComboBoxOutputFormat.DroppedDown || bnComboBoxOutputFormat.Focused)
return;
outputFormatVisible = false;
bnComboBoxOutputFormat.Visible = false;
@@ -1123,34 +1121,6 @@ namespace CUERipper
}
}
- public class ReleaseInfo
- {
- public CUESheet metadata;
- private string imageKey;
- public string ImageKey
- {
- get
- {
- return imageKey;
- }
- set
- {
- imageKey = value;
- }
- }
-
- public ReleaseInfo(CUEConfig config, CDImageLayout TOC)
- {
- metadata = new CUESheet(config);
- metadata.TOC = TOC;
- }
-
- public override string ToString()
- {
- return string.Format("{0}{1} - {2}", metadata.Year != "" ? metadata.Year + ": " : "", metadata.Artist, metadata.Title);
- }
- }
-
public class DriveInfo
{
public ICDRipper drive;
@@ -1158,6 +1128,14 @@ namespace CUERipper
DirectoryInfo di;
CUEControls.IIconManager iconMgr;
+ public string Path
+ {
+ get
+ {
+ return di.FullName;
+ }
+ }
+
public int ImageKey
{
get
@@ -1185,4 +1163,66 @@ namespace CUERipper
return drive != null ? drive.Path : this.di.FullName + ": " + error;
}
}
+
+ internal class CUERipperData
+ {
+ private BindingList cueStyles = new BindingList { "image", "tracks" };
+ //private BindingList losslessOrNot = new BindingList { "lossless", "lossy" };
+ private BindingList> losslessOrNot = new BindingList> {
+ new ImgComboBoxItem("lossless", "checked", AudioEncoderType.Lossless),
+ new ImgComboBoxItem("lossy", "unchecked", AudioEncoderType.Lossy)
+ };
+ private BindingList releases = new BindingList();
+ private BindingList drives = new BindingList();
+ private BindingList formats = new BindingList();
+ private BindingList encoders = new BindingList();
+
+ public BindingList CUEStyles
+ {
+ get
+ {
+ return cueStyles;
+ }
+ }
+
+ public BindingList> LosslessOrNot
+ {
+ get
+ {
+ return losslessOrNot;
+ }
+ }
+
+ public BindingList Releases
+ {
+ get
+ {
+ return releases;
+ }
+ }
+
+ public BindingList Drives
+ {
+ get
+ {
+ return drives;
+ }
+ }
+
+ public BindingList Formats
+ {
+ get
+ {
+ return formats;
+ }
+ }
+
+ public BindingList Encoders
+ {
+ get
+ {
+ return encoders;
+ }
+ }
+ }
}
diff --git a/CUERipper/frmCUERipper.resx b/CUERipper/frmCUERipper.resx
index 1d578e6..48727c6 100644
--- a/CUERipper/frmCUERipper.resx
+++ b/CUERipper/frmCUERipper.resx
@@ -360,25 +360,31 @@
17, 17
- 152, 22
+ 149, 22
Edit
- 152, 22
+ 149, 22
Various Artists
- 152, 22
+ 149, 22
Fix Encoding
+
+ 149, 22
+
+
+ Reload
+
- 153, 92
+ 150, 92
contextMenuStripRelease
@@ -479,25 +485,20 @@
6, 19
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
80, 21
39
+
+ lossless
+
bnComboBoxLosslessOrNot
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
groupBoxSettings
@@ -511,25 +512,20 @@
92, 46
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
80, 21
38
+
+ libFlac
+
bnComboBoxEncoder
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
groupBoxSettings
@@ -570,25 +566,20 @@
92, 19
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
80, 21
37
+
+ flac
+
bnComboBoxFormat
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
groupBoxSettings
@@ -641,25 +632,20 @@
6, 46
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
80, 21
34
+
+ image
+
bnComboBoxImage
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
groupBoxSettings
@@ -814,6 +800,9 @@
7
+
+ 998, 56
+
207, 17
@@ -965,8 +954,8 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAa
- CQAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAS
+ CgAAAk1TRnQBSQFMAgEBAwEAAQQBAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -996,34 +985,34 @@
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wIAAXoCUQt6AQAB7Q8K
IAABUQEAAREBEwEAAQ8KegG1BAQD8wEEA/MCBAFfAQohAAG8A/8BEwEPCXoBtQMEAfQCBAH0AQQB9AIE
- AfQCBAEKIQABvAT/AQAJegG1AaICBAH/AgQB/wEEAf8CBAH/AgQBCiAAAVEBDwHrAgcBvAEAAREEAAER
- A3oBtQGiAwQD/wEEA/8DBAEKIAABegFRAQ8CAAH/AQABDwH3Av8BkgIRAnoBtQGiBQQB/wEEAf8FBAEK
- IAAEegEAAf8BAAERBP8BvAEAAnoBtQGiBQQB/wEEAf8FBAEKIAAErgEAAf8CAAETAbwD/wEAAq4BtQGi
- DQQBCiAABK4BAAH/AQABEgEPAwAB/wEAAq4N/wH0AfMB7CAABK4BAAH/AQ8BAAERAhIBAAH/AQACrgH/
- AaIC/wEEA/8CBAP/AgQB7CAABK4BAAL/AZIBEQEAAQ8BAAH/AQACrgH/AaIC/wEEAv8BBAT/AQQB9AHz
- AewgAASuAQABBwP/AbwB6gEAAf8BAAKuAf8BogL/AQQC/wQEAf8DBAEKIAAErgERARMBBwb/AQACrgH/
- AaIBBAH/AQQC/wEEAv8BBAH/AQQB9AHzAQogAAWuAREBAAERAZIE/wEAAq4B/wGGAv8CBAL/AgQD/wIE
- AewgAAeuAREBAAEPAesBvAH/AQACrgH/AYYL/wH0AfMB7CEACa4BDwEAARMBEQGuAQAC/wG1C/8B9AEH
- IAABQgFNAT4HAAE+AwABKAMAAUADAAEQAwABAQEAAQEFAAGAFwAD/wEAAYABAXYAAYABAQYACw==
+ AfQCBAEKAfEC7gHyAQAB8gTuAfIBAAHyAu4B8REAAbwE/wEACXoBtQGiAgQB/wIEAf8BBAH/AgQB/wIE
+ AQoBvAH1AfQDBwT0AwcB9AH1AbwQAAFRAQ8B6wIHAbwBAAERBAABEQN6AbUBogMEA/8BBAP/AwQBCgHw
+ AfQC8wH0BvMB9ALzAfQB8BAAAXoBUQEPAgAB/wEAAQ8B9wL/AZICEQJ6AbUBogUEAf8BBAH/BQQBCgHw
+ AfQM8wH0AfAQAAR6AQAB/wEAAREE/wG8AQACegG1AaIFBAH/AQQB/wUEAQoB8AH0DPMB9AHwEAAErgEA
+ Af8CAAETAbwD/wEAAq4BtQGiDQQBCgHxAfUF9AEAAXMB7gT0AfUB8RAABK4BAAH/AQABEgEPAwAB/wEA
+ Aq4N/wH0AfMB7AHyAfUF9AEcAcMBUQEIA/QB9QHyEAAErgEAAf8BDwEAARECEgEAAf8BAAKuAf8BogL/
+ AQQD/wIEA/8CBAHsAfIG9QEbAVgBegFRAQgD9QHyEAAErgEAAv8BkgERAQABDwEAAf8BAAKuAf8BogL/
+ AQQC/wEEBP8BBAH0AfMB7AHyAf8G9QEaAVgBegFRARoB9QH/AfIQAASuAQABBwP/AbwB6gEAAf8BAAKu
+ Af8BogL/AQQC/wQEAf8DBAEKAfII/wEaAVgBegFRARoB/wHyEAAErgERARMBBwb/AQACrgH/AaIBBAH/
+ AQQC/wEEAv8BBAH/AQQB9AHzAQoB8gn/ARsBWAF6Ae0B8AHyEAAFrgERAQABEQGSBP8BAAKuAf8BhgL/
+ AgQC/wIEA/8CBAHsAfMK8gHwAe8B9AHtAbwQAAeuAREBAAEPAesBvAH/AQACrgH/AYYL/wH0AfMB7AwA
+ AfQB7gEWAW8RAAmuAQ8BAAETAREBrgEAAv8BtQv/AfQBBw0AAfQBFgHzEAABQgFNAT4HAAE+AwABKAMA
+ AUADAAEQAwABAQEAAQEFAAGAFwAD/wEAAYABAQIAAv8GAAL/BgABCAEQXgAB/wHwAgABgAEBAgAB/wH4
+ AgAL
6, 33
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
552, 21
35
+
+ Releases
+
Right-lick to edit release info
@@ -1031,7 +1020,7 @@
bnComboBoxRelease
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
$this
@@ -1039,31 +1028,23 @@
2
-
- 998, 56
-
6, 6
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
552, 21
36
+
+ Drives
+
bnComboBoxDrives
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
$this
@@ -1074,14 +1055,6 @@
6, 60
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAEJDVUVDb250cm9scywgVmVyc2lvbj0yLjAuOC4wLCBDdWx0dXJl
- PW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwFAQAAABRDVUVDb250cm9scy5CTlJhZGl1cwQAAAAI
- X3RvcExlZnQJX3RvcFJpZ2h0C19ib3R0b21MZWZ0DF9ib3R0b21SaWdodAAAAAAICAgIAgAAAAIAAAAG
- AAAAAgAAAAIAAAAL
-
-
552, 21
@@ -1092,7 +1065,7 @@
bnComboBoxOutputFormat
- CUEControls.BNComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
+ CUEControls.ImgComboBox, CUEControls, Version=2.0.8.0, Culture=neutral, PublicKeyToken=null
$this
@@ -1593,6 +1566,12 @@
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ reloadToolStripMenuItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
losslessOrNotBindingSource
@@ -1623,6 +1602,12 @@
System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ drivesBindingSource
+
+
+ System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
imageListChecked
@@ -1683,12 +1668,6 @@
System.Windows.Forms.ImageList, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- drivesBindingSource
-
-
- System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
frmCUERipper
diff --git a/CUERipper/frmProperties.cs b/CUERipper/frmProperties.cs
index 4ef5916..46c9bbb 100644
--- a/CUERipper/frmProperties.cs
+++ b/CUERipper/frmProperties.cs
@@ -18,41 +18,27 @@ namespace CUETools.Processor
private void frmProperties_Load(object sender, EventArgs e)
{
- textArtist.Text = _cueSheet.Artist;
- textTitle.Text = _cueSheet.Title;
- textYear.Text = _cueSheet.Year;
- textGenre.Text = _cueSheet.Genre;
- textCatalog.Text = _cueSheet.Catalog;
- textBoxDiscNumber.Text = _cueSheet.DiscNumber;
- textBoxTotalDiscs.Text = _cueSheet.TotalDiscs;
+ textArtist.Text = Metadata.Artist;
+ textTitle.Text = Metadata.Title;
+ textYear.Text = Metadata.Year;
+ textGenre.Text = Metadata.Genre;
+ textCatalog.Text = Metadata.Catalog;
+ textBoxDiscNumber.Text = Metadata.DiscNumber;
+ textBoxTotalDiscs.Text = Metadata.TotalDiscs;
}
- public CUESheet CUE
- {
- get
- {
- return _cueSheet;
- }
- set
- {
- _cueSheet = value;
- }
- }
-
- CUESheet _cueSheet;
+ public CUEMetadata Metadata { get; set; }
private void button1_Click(object sender, EventArgs e)
{
- foreach (TrackInfo track in _cueSheet.Tracks)
- if (track.Artist == _cueSheet.Artist)
- track.Artist = textArtist.Text;
- _cueSheet.Artist = textArtist.Text;
- _cueSheet.Title = textTitle.Text;
- _cueSheet.Year = textYear.Text;
- _cueSheet.Genre = textGenre.Text;
- _cueSheet.Catalog = textCatalog.Text;
- _cueSheet.DiscNumber = textBoxDiscNumber.Text;
- _cueSheet.TotalDiscs = textBoxTotalDiscs.Text;
+ Metadata.Tracks.ForEach(track => track.Artist = track.Artist == Metadata.Artist ? textArtist.Text : track.Artist);
+ Metadata.Artist = textArtist.Text;
+ Metadata.Title = textTitle.Text;
+ Metadata.Year = textYear.Text;
+ Metadata.Genre = textGenre.Text;
+ Metadata.Catalog = textCatalog.Text;
+ Metadata.DiscNumber = textBoxDiscNumber.Text;
+ Metadata.TotalDiscs = textBoxTotalDiscs.Text;
}
}
}
\ No newline at end of file
diff --git a/CUETools.AccurateRip/AccurateRip.cs b/CUETools.AccurateRip/AccurateRip.cs
index 25f294a..92ac657 100644
--- a/CUETools.AccurateRip/AccurateRip.cs
+++ b/CUETools.AccurateRip/AccurateRip.cs
@@ -1054,7 +1054,7 @@ namespace CUETools.AccurateRip
public static bool FindDriveReadOffset(string driveName, out int driveReadOffset)
{
string fileName = System.IO.Path.Combine(CachePath, "DriveOffsets.bin");
- if (!File.Exists(fileName) || (DateTime.Now - File.GetLastWriteTime(fileName) > TimeSpan.FromDays(1)) )
+ if (!File.Exists(fileName) || (DateTime.Now - File.GetLastWriteTime(fileName) > TimeSpan.FromDays(10)) )
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://www.accuraterip.com/accuraterip/DriveOffsets.bin");
req.Method = "GET";
diff --git a/CUETools.Processor/CUETools.Processor.csproj b/CUETools.Processor/CUETools.Processor.csproj
index 18f3254..a709ae8 100644
--- a/CUETools.Processor/CUETools.Processor.csproj
+++ b/CUETools.Processor/CUETools.Processor.csproj
@@ -69,6 +69,7 @@
+
diff --git a/CUETools.Processor/Processor.cs b/CUETools.Processor/Processor.cs
index 2260fd2..c9977de 100644
--- a/CUETools.Processor/Processor.cs
+++ b/CUETools.Processor/Processor.cs
@@ -1045,6 +1045,7 @@ namespace CUETools.Processor
encoders.Add(new CUEToolsUDC("lame cbr", "mp3", false, "96 128 192 256 320", "256", "lame.exe", "-m s -q 0 -b %M --noreplaygain - %O"));
encoders.Add(new CUEToolsUDC("oggenc", "ogg", false, "-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8", "3", "oggenc.exe", "-q %M - -o %O"));
encoders.Add(new CUEToolsUDC("nero aac", "m4a", false, "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9", "0.4", "neroAacEnc.exe", "-q %M -if - -of %O"));
+ encoders.Add(new CUEToolsUDC("qaac tvbr", "m4a", false, "10 20 30 40 50 60 70 80 90 100 110 127", "80", "qaac.exe", "-s -V %M -q 2 - -o %O"));
decoders.Add("takc", new CUEToolsUDC("takc", "tak", true, "", "", "takc.exe", "-d %I -"));
decoders.Add("ffmpeg alac", new CUEToolsUDC("ffmpeg alac", "m4a", true, "", "", "ffmpeg.exe", "%I -f wav -"));
@@ -1638,6 +1639,7 @@ string status = processor.Go();
private List _albumArt = new List();
private int _padding = 8192;
private IWebProxy proxy;
+ private CUEMetadata taglibMetadata;
public event EventHandler PasswordRequired;
public event EventHandler CUEToolsProgress;
@@ -1748,6 +1750,7 @@ string status = processor.Go();
Genre = metadata.Genre;
Artist = metadata.Artist;
Title = metadata.Title;
+ Catalog = metadata.Catalog;
for (int i = 0; i < Tracks.Count; i++)
{
Tracks[i].Title = metadata.Tracks[i].Title;
@@ -1755,6 +1758,45 @@ string status = processor.Go();
}
}
+ public void CopyMetadata(CUEMetadata metadata)
+ {
+ TotalDiscs = metadata.TotalDiscs;
+ DiscNumber = metadata.DiscNumber;
+ Year = metadata.Year;
+ Genre = metadata.Genre;
+ Artist = metadata.Artist;
+ Title = metadata.Title;
+ Catalog = metadata.Catalog;
+ for (int i = 0; i < Tracks.Count; i++)
+ {
+ Tracks[i].Title = metadata.Tracks[i].Title;
+ Tracks[i].Artist = metadata.Tracks[i].Artist;
+ // ISRC?
+ }
+ }
+
+ public CUEMetadata Metadata
+ {
+ get
+ {
+ CUEMetadata metadata = new CUEMetadata(TOC.TOCID, (int)TOC.AudioTracks);
+ metadata.TotalDiscs = TotalDiscs;
+ metadata.DiscNumber = DiscNumber;
+ metadata.Year = Year;
+ metadata.Genre = Genre;
+ metadata.Artist = Artist;
+ metadata.Title = Title;
+ metadata.Catalog = Catalog;
+ for (int i = 0; i < Tracks.Count; i++)
+ {
+ metadata.Tracks[i].Title = Tracks[i].Title;
+ metadata.Tracks[i].Artist = Tracks[i].Artist;
+ // ISRC?
+ }
+ return metadata;
+ }
+ }
+
public void FillFromMusicBrainz(MusicBrainz.Release release)
{
string date = release.GetEvents().Count > 0 ? release.GetEvents()[0].Date : null;
@@ -1818,9 +1860,28 @@ string status = processor.Go();
}
}
- public List