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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+ 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 LookupAlbumInfo(bool useFreedb, bool useMusicBrainz) + public List LookupAlbumInfo(bool useFreedb, bool useMusicBrainz, bool useCache) { List Releases = new List(); + StringCollection DiscIds = new StringCollection(); + DiscIds.Add(_toc.MusicBrainzId); + + if (useCache) + { + try + { + CUEMetadata cache = CUEMetadata.Load(TOC.TOCID); + if (cache != null) + Releases.Add(new CUEMetadataEntry(cache, TOC, "local")); + } + catch (Exception ex) + { + System.Diagnostics.Trace.WriteLine(ex.Message); + } + } + + Releases.Add(new CUEMetadataEntry(Metadata, TOC, "cue")); + Releases.Add(new CUEMetadataEntry(new CUEMetadata(taglibMetadata), TOC, "tags")); if (useFreedb) { @@ -1846,7 +1907,14 @@ string status = processor.Go(); ShowProgress("Looking up album via Freedb... " + queryResult.Discid, 0.5, null, null); code = m_freedb.Read(queryResult, out cdEntry); if (code == FreedbHelper.ResponseCodes.CODE_210) - Releases.Add(cdEntry); + { + CUEMetadata metadata = new CUEMetadata(TOC.TOCID, (int)TOC.AudioTracks); + metadata.FillFromFreedb(cdEntry, TOC.FirstAudio - 1); + CDImageLayout toc = TocFromCDEntry(cdEntry); + if (!DiscIds.Contains(toc.MusicBrainzId)) + DiscIds.Add(toc.MusicBrainzId); + Releases.Add(new CUEMetadataEntry(metadata, toc, "freedb")); + } } else if (code == FreedbHelper.ResponseCodes.CODE_210 || @@ -1859,7 +1927,14 @@ string status = processor.Go(); CheckStop(); code = m_freedb.Read(qr, out cdEntry); if (code == FreedbHelper.ResponseCodes.CODE_210) - Releases.Add(cdEntry); + { + CUEMetadata metadata = new CUEMetadata(TOC.TOCID, (int)TOC.AudioTracks); + metadata.FillFromFreedb(cdEntry, TOC.FirstAudio - 1); + CDImageLayout toc = TocFromCDEntry(cdEntry); + if (!DiscIds.Contains(toc.MusicBrainzId)) + DiscIds.Add(toc.MusicBrainzId); + Releases.Add(new CUEMetadataEntry(metadata, toc,"freedb")); + } } } } @@ -1874,16 +1949,8 @@ string status = processor.Go(); { ShowProgress("Looking up album via MusicBrainz...", 0.0, null, null); - StringCollection DiscIds = new StringCollection(); - DiscIds.Add(_toc.MusicBrainzId); //if (_tocFromLog != null && !DiscIds.Contains(_tocFromLog.MusicBrainzId)) // DiscIds.Add(_tocFromLog.MusicBrainzId); - foreach (CDEntry cdEntry in Releases) - { - CDImageLayout toc = TocFromCDEntry(cdEntry); - if (!DiscIds.Contains(toc.MusicBrainzId)) - DiscIds.Add(toc.MusicBrainzId); - } MusicBrainzService.XmlRequest += new EventHandler(MusicBrainz_LookupProgress); foreach (string DiscId in DiscIds) @@ -1909,7 +1976,9 @@ string status = processor.Go(); ; } catch { } - Releases.Add(release); + CUEMetadata metadata = new CUEMetadata(TOC.TOCID, (int)TOC.AudioTracks); + metadata.FillFromMusicBrainz(release, TOC.FirstAudio - 1); + Releases.Add(new CUEMetadataEntry(metadata, TOC, "musicbrainz")); } } catch (Exception ex) @@ -2499,59 +2568,44 @@ string status = processor.Go(); _fileInfo = _tracks[0]._fileInfo; _tracks[0]._fileInfo = null; } + taglibMetadata = new CUEMetadata(TOC.TOCID, (int)TOC.AudioTracks); + taglibMetadata.Artist = GetCommonTag(file => file.Tag.JoinedAlbumArtists) ?? GetCommonTag(file => file.Tag.JoinedPerformers) ?? ""; + taglibMetadata.Title = GetCommonTag(file => file.Tag.Album) ?? ""; + taglibMetadata.Year = GetCommonTag(file => file.Tag.Year != 0 ? file.Tag.Year.ToString() : null) ?? ""; + taglibMetadata.Genre = GetCommonTag(file => file.Tag.JoinedGenres) ?? ""; + taglibMetadata.TotalDiscs = GetCommonTag(file => file.Tag.DiscCount != 0 ? file.Tag.DiscCount.ToString() : null) ?? ""; + taglibMetadata.DiscNumber = GetCommonTag(file => file.Tag.Disc != 0 ? file.Tag.Disc.ToString() : null) ?? ""; + for (i = 0; i < TrackCount; i++) + { + TrackInfo track = _tracks[i]; + taglibMetadata.Tracks[i].Artist = (_hasTrackFilenames && track._fileInfo != null ? track._fileInfo.Tag.JoinedPerformers : + _hasEmbeddedCUESheet && _fileInfo != null ? Tagging.TagListToSingleValue(Tagging.GetMiscTag(_fileInfo, String.Format("cue_track{0:00}_ARTIST", i + 1))) : + null) ?? ""; + taglibMetadata.Tracks[i].Title = (_hasTrackFilenames && track._fileInfo != null ? track._fileInfo.Tag.Title : + _hasEmbeddedCUESheet && _fileInfo != null ? Tagging.TagListToSingleValue(Tagging.GetMiscTag(_fileInfo, String.Format("cue_track{0:00}_TITLE", i + 1))) : + null) ?? ""; + } + if (_config.fillUpCUE) { - if (_config.overwriteCUEData || General.FindCUELine(_attributes, "PERFORMER") == null) - { - string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.JoinedAlbumArtists; }); - if (value == null) - value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.JoinedPerformers; }); - if (value != null && value != "") - General.SetCUELine(_attributes, "PERFORMER", value, true); - } - if (_config.overwriteCUEData || General.FindCUELine(_attributes, "TITLE") == null) - { - string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.Album; }); - if (value != null) - General.SetCUELine(_attributes, "TITLE", value, true); - } - if (_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "DATE") == null) - { - string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.Year != 0 ? file.Tag.Year.ToString() : null; }); - if (value != null) - General.SetCUELine(_attributes, "REM", "DATE", value, false); - } - if (_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "GENRE") == null) - { - string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.JoinedGenres; }); - if (value != null) - General.SetCUELine(_attributes, "REM", "GENRE", value, true); - } - if (_config.overwriteCUEData || TotalDiscs == "") - { - string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.DiscCount != 0 ? file.Tag.DiscCount.ToString() : null; }); - if (value != null) - TotalDiscs = value; - } - if (_config.overwriteCUEData || DiscNumber == "") - { - string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.Disc != 0 ? file.Tag.Disc.ToString() : null; }); - if (value != null) - DiscNumber = value; - } + if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "PERFORMER") == null) && taglibMetadata.Artist != "") + General.SetCUELine(_attributes, "PERFORMER", taglibMetadata.Artist, true); + if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "TITLE") == null) && taglibMetadata.Title != "") + General.SetCUELine(_attributes, "TITLE", taglibMetadata.Title, true); + if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "DATE") == null) && taglibMetadata.Year != "") + General.SetCUELine(_attributes, "REM", "DATE", taglibMetadata.Year, false); + if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "GENRE") == null) && taglibMetadata.Genre != "") + General.SetCUELine(_attributes, "REM", "GENRE", taglibMetadata.Genre, true); + if ((_config.overwriteCUEData || TotalDiscs == "") && taglibMetadata.TotalDiscs != "") + TotalDiscs = taglibMetadata.TotalDiscs; + if ((_config.overwriteCUEData || DiscNumber == "") && taglibMetadata.DiscNumber != "") + DiscNumber = taglibMetadata.DiscNumber; for (i = 0; i < TrackCount; i++) { - TrackInfo track = _tracks[i]; - string artist = _hasTrackFilenames && track._fileInfo != null ? track._fileInfo.Tag.JoinedPerformers : - _hasEmbeddedCUESheet && _fileInfo != null ? Tagging.TagListToSingleValue(Tagging.GetMiscTag(_fileInfo, String.Format("cue_track{0:00}_ARTIST", i + 1))) : - null; - string title = _hasTrackFilenames && track._fileInfo != null ? track._fileInfo.Tag.Title : - _hasEmbeddedCUESheet && _fileInfo != null ? Tagging.TagListToSingleValue(Tagging.GetMiscTag(_fileInfo, String.Format("cue_track{0:00}_TITLE", i + 1))) : - null; - if ((_config.overwriteCUEData || track.Artist == "") && artist != null && artist != "") - track.Artist = artist; - if ((_config.overwriteCUEData || track.Title == "") && title != null) - track.Title = title; + if ((_config.overwriteCUEData || _tracks[i].Artist == "") && taglibMetadata.Tracks[i].Artist != "") + _tracks[i].Artist = taglibMetadata.Tracks[i].Artist; + if ((_config.overwriteCUEData || _tracks[i].Title == "") && taglibMetadata.Tracks[i].Title != "") + _tracks[i].Title = taglibMetadata.Tracks[i].Title; } } @@ -4055,32 +4109,46 @@ string status = processor.Go(); _albumArt.Add(picture); return; } - if ((_config.extractAlbumArt || _config.embedAlbumArt) && _inputDir != null) + if ((_config.extractAlbumArt || _config.embedAlbumArt) && !_isCD) { List names = new List(); names.Add("folder.jpg"); names.Add("cover.jpg"); names.Add("albumart.jpg"); + names.Add("thumbnail.jpg"); names.Add("albumartlarge.jpg"); + names.Add("front.jpg"); + foreach (string name in names) { - string imgPath = Path.Combine(_inputDir, name); - if (File.Exists(imgPath)) + string imgPath = Path.Combine(_isArchive ? _archiveCUEpath : _inputDir, name); + bool exists = _isArchive ? _archiveContents.Contains(imgPath) : File.Exists(imgPath); + if (exists) { - TagLib.Picture pic = new TagLib.Picture(imgPath); + TagLib.File.IFileAbstraction file = _isArchive + ? (TagLib.File.IFileAbstraction)new ArchiveFileAbstraction(this, imgPath) + : (TagLib.File.IFileAbstraction)new TagLib.File.LocalFileAbstraction(imgPath); + TagLib.Picture pic = new TagLib.Picture(file); pic.Description = name; _albumArt.Add(pic); return; } } - foreach (string imgPath in Directory.GetFiles(_inputDir, "*.jpg")) + if (!_isArchive) { - TagLib.Picture pic = new TagLib.Picture(imgPath); - pic.Description = Path.GetFileName(imgPath); - _albumArt.Add(pic); - if (Action != CUEAction.Encode) - return; + // TODO: archive case + foreach (string imgPath in Directory.GetFiles(_inputDir, "*.jpg", SearchOption.AllDirectories)) + { + TagLib.Picture pic = new TagLib.Picture(imgPath); + if (imgPath.StartsWith(_inputDir)) + pic.Description = imgPath.Substring(_inputDir.Length).Trim(Path.DirectorySeparatorChar); + else + pic.Description = Path.GetFileName(imgPath); + _albumArt.Add(pic); + if (Action != CUEAction.Encode) + return; + } } if (_albumArt.Count != 0) @@ -4809,12 +4877,7 @@ string status = processor.Go(); if (files == null) audioFiles = Directory.GetFiles(dir == "" ? "." : dir, "*." + format.Key); else - { - audioFiles = files.FindAll(delegate(string s) - { - return Path.GetDirectoryName(s) == dir && Path.GetExtension(s).ToLower() == "." + format.Key; - }).ToArray(); - } + audioFiles = files.FindAll(s => Path.GetDirectoryName(s) == dir && Path.GetExtension(s).ToLower() == "." + format.Key).ToArray(); if (audioFiles.Length == filePos.Count) { Array.Sort(audioFiles); @@ -4836,12 +4899,13 @@ string status = processor.Go(); foundAll = false; break; } - audioFiles = fileGroup.files.ConvertAll(delegate(FileSystemInfo info) { return info.FullName; }).ToArray(); + audioFiles = fileGroup.files.ConvertAll(info => info.FullName).ToArray(); Array.Sort(audioFiles); extension = fileGroup.main.Extension.ToLower().TrimStart('.'); foundAll = true; } } + // Choose filegroup by DISCID? } if (!foundAll) diff --git a/CUETools.Processor/Tagging.cs b/CUETools.Processor/Tagging.cs index 4bb7e8b..27adc19 100644 --- a/CUETools.Processor/Tagging.cs +++ b/CUETools.Processor/Tagging.cs @@ -21,6 +21,7 @@ namespace CUETools.Processor if (fileInfo is TagLib.Mpeg4.File) { // remove fb2k/nero nasty tags mess + //if (((TagLib.Mpeg4.File)fileInfo).UserData. ((TagLib.Mpeg4.File)fileInfo).UserData.RemoveChild("tags"); TagLib.Mpeg4.AppleTag mpeg4 = (TagLib.Mpeg4.AppleTag)fileInfo.GetTag(TagLib.TagTypes.Apple, true); return true; diff --git a/CUETools/Resources/more/icons/card--pencil.png b/CUETools/Resources/more/icons/card--pencil.png new file mode 100644 index 0000000..d7fa8d7 Binary files /dev/null and b/CUETools/Resources/more/icons/card--pencil.png differ diff --git a/CUETools/Resources/more/icons/tag-label.png b/CUETools/Resources/more/icons/tag-label.png new file mode 100644 index 0000000..354f9ee Binary files /dev/null and b/CUETools/Resources/more/icons/tag-label.png differ diff --git a/CUETools/frmCUETools.cs b/CUETools/frmCUETools.cs index 79136ae..414d7aa 100644 --- a/CUETools/frmCUETools.cs +++ b/CUETools/frmCUETools.cs @@ -745,7 +745,19 @@ namespace JDP { if (_batchPaths.Count == 0 && action == CUEAction.Encode) { if (checkBoxUseFreeDb.Checked || checkBoxUseMusicBrainz.Checked) - releases = cueSheet.LookupAlbumInfo(checkBoxUseFreeDb.Checked, checkBoxUseMusicBrainz.Checked); + releases = cueSheet.LookupAlbumInfo(checkBoxUseFreeDb.Checked, checkBoxUseMusicBrainz.Checked, true); + } + else // if checkBoxUseMetadataCache.Checked + { + try + { + CUEMetadata cache = CUEMetadata.Load(cueSheet.TOC.TOCID); + if (cache != null) + cueSheet.CopyMetadata(cache); + } + catch + { + } } this.Invoke((MethodInvoker)delegate() diff --git a/CUETools/frmChoice.Designer.cs b/CUETools/frmChoice.Designer.cs index b6fdcda..707685a 100644 --- a/CUETools/frmChoice.Designer.cs +++ b/CUETools/frmChoice.Designer.cs @@ -82,10 +82,12 @@ namespace JDP // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; - this.imageList1.Images.SetKeyName(0, "eac3.ico"); - this.imageList1.Images.SetKeyName(1, "freedb.ico"); - this.imageList1.Images.SetKeyName(2, "musicbrainz.ico"); - this.imageList1.Images.SetKeyName(3, "cue3.ico"); + this.imageList1.Images.SetKeyName(0, "eac"); + this.imageList1.Images.SetKeyName(1, "freedb"); + this.imageList1.Images.SetKeyName(2, "musicbrainz"); + this.imageList1.Images.SetKeyName(3, "cue"); + this.imageList1.Images.SetKeyName(4, "tags"); + this.imageList1.Images.SetKeyName(5, "local"); // // textBox1 // diff --git a/CUETools/frmChoice.cs b/CUETools/frmChoice.cs index 9e2c83f..e6d6f6c 100644 --- a/CUETools/frmChoice.cs +++ b/CUETools/frmChoice.cs @@ -8,8 +8,6 @@ using System.IO; using System.Windows.Forms; using CUETools.CDImage; using CUETools.Processor; -using MusicBrainz; -using Freedb; namespace JDP { @@ -43,38 +41,26 @@ namespace JDP item.Tag = pic; listChoices.Items.Add(item); } - else if (i is MusicBrainz.Release) + else if (i is CUEMetadataEntry) { - ReleaseInfo r = new ReleaseInfo(CUE, i as MusicBrainz.Release); - ListViewItem item = new ListViewItem(r.Text, 2); - item.Tag = r; - listChoices.Items.Add(item); - } - else if (i is Freedb.CDEntry) - { - ReleaseInfo r = new ReleaseInfo(CUE, i as Freedb.CDEntry); - ListViewItem item = new ListViewItem(r.Text, 1); - item.Tag = r; + CUEMetadataEntry entry = i as CUEMetadataEntry; + ListViewItem item = new ListViewItem(entry.ToString(), entry.ImageKey); + item.Tag = entry; listChoices.Items.Add(item); - // check if the entry contains non-iso characters, - // and add a second one if it does - ReleaseInfo r2 = new ReleaseInfo(CUE, i as Freedb.CDEntry); - r2.FixEncoding(); - if (!r.Equals(r2)) + if (entry.ImageKey == "freedb") { - item = new ListViewItem(r2.Text, 1); - item.Tag = r2; - listChoices.Items.Add(item); + // check if the entry contains non-iso characters, + // and add a second one if it does + CUEMetadata copy = new CUEMetadata(entry.metadata); + if (copy.FreedbToEncoding()) + { + entry = new CUEMetadataEntry(copy, entry.TOC, entry.ImageKey); + item = new ListViewItem(entry.ToString(), entry.ImageKey); + item.Tag = entry; + listChoices.Items.Add(item); + } } - return; - } - else if (i is CUESheet) - { - ReleaseInfo r = new ReleaseInfo(CUE); - ListViewItem item = new ListViewItem(r.Text, 3); - item.Tag = r; - listChoices.Items.Add(item); } else { @@ -88,8 +74,6 @@ namespace JDP { set { - if (CUE != null) - AddItem(CUE); foreach (object i in value) AddItem(i); if (CUE != null) @@ -133,12 +117,12 @@ namespace JDP } } - private ReleaseInfo ChosenRelease + private CUEMetadataEntry ChosenRelease { get { object o = ChosenObject; - return o != null && o is ReleaseInfo ? o as ReleaseInfo : null; + return o != null && o is CUEMetadataEntry ? o as CUEMetadataEntry : null; } } @@ -152,10 +136,11 @@ namespace JDP private void frmChoice_FormClosing(object sender, FormClosingEventArgs e) { - ReleaseInfo ri = ChosenRelease; + CUEMetadataEntry ri = ChosenRelease; if (e.CloseReason != CloseReason.None || DialogResult != DialogResult.OK || ri == null || CUE == null) return; CUE.CopyMetadata(ri.metadata); + ri.metadata.Save(); } private void AutoResizeTracks() @@ -176,7 +161,7 @@ namespace JDP TagLib.IPicture picture = item as TagLib.IPicture; using (MemoryStream imageStream = new MemoryStream(picture.Data.Data, 0, picture.Data.Count)) try { pictureBox1.Image = Image.FromStream(imageStream); } - catch { } + catch { } textBox1.Hide(); pictureBox1.Show(); tableLayoutPanel1.SetRowSpan(pictureBox1, 4); @@ -185,17 +170,17 @@ namespace JDP { textBox1.Text = (item as CUEToolsSourceFile).contents.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n"); } - else if (item != null && item is ReleaseInfo) + else if (item != null && item is CUEMetadataEntry) { - ReleaseInfo r = (item as ReleaseInfo); + CUEMetadataEntry r = (item as CUEMetadataEntry); listTracks.Items.Clear(); - foreach (TrackInfo track in r.metadata.Tracks) + foreach (CUETrackMetadata track in r.metadata.Tracks) { listTracks.Items.Add(new ListViewItem(new string[] { track.Title, (listTracks.Items.Count + 1).ToString(), - r.metadata.TOC[listTracks.Items.Count + r.metadata.TOC.FirstAudio].StartMSF, - r.metadata.TOC[listTracks.Items.Count + r.metadata.TOC.FirstAudio].LengthMSF + r.TOC[listTracks.Items.Count + r.TOC.FirstAudio].StartMSF, + r.TOC[listTracks.Items.Count + r.TOC.FirstAudio].LengthMSF })); } AutoResizeTracks(); @@ -237,7 +222,7 @@ namespace JDP private void listTracks_AfterLabelEdit(object sender, LabelEditEventArgs e) { - ReleaseInfo ri = ChosenRelease; + CUEMetadataEntry ri = ChosenRelease; if (ri != null && e.Label != null) ri.metadata.Tracks[e.Item].Title = e.Label; } @@ -246,13 +231,13 @@ namespace JDP { if (e.KeyCode == Keys.Enter) { - if (listTracks.FocusedItem.Index + 1 < listTracks.Items.Count) // && e.editing - { - listTracks.FocusedItem.Selected = false; - listTracks.FocusedItem = listTracks.Items[listTracks.FocusedItem.Index + 1]; - listTracks.FocusedItem.Selected = true; - listTracks.FocusedItem.BeginEdit(); - } + if (listTracks.FocusedItem.Index + 1 < listTracks.Items.Count) // && e.editing + { + listTracks.FocusedItem.Selected = false; + listTracks.FocusedItem = listTracks.Items[listTracks.FocusedItem.Index + 1]; + listTracks.FocusedItem.Selected = true; + listTracks.FocusedItem.BeginEdit(); + } } } @@ -270,13 +255,13 @@ namespace JDP private void listMetadata_AfterLabelEdit(object sender, LabelEditEventArgs e) { ListViewItem item = ChosenItem; - ReleaseInfo r = ChosenRelease; + CUEMetadataEntry r = ChosenRelease; if (e.Label != null && item != null && r != null) { switch (e.Item) { case 0: - foreach (TrackInfo track in r.metadata.Tracks) + foreach (CUETrackMetadata track in r.metadata.Tracks) if (track.Artist == r.metadata.Artist) track.Artist = e.Label; r.metadata.Artist = e.Label; @@ -287,7 +272,7 @@ namespace JDP case 4: r.metadata.DiscNumber = e.Label; break; case 5: r.metadata.TotalDiscs = e.Label; break; } - item.Text = r.Text; + item.Text = r.ToString(); } } @@ -297,67 +282,4 @@ namespace JDP PictureBoxSizeMode.CenterImage : PictureBoxSizeMode.Zoom; } } - - sealed class ReleaseInfo - { - public CUESheet metadata; - - public ReleaseInfo(CUESheet cue) - { - metadata = new CUESheet(cue.Config); - metadata.TOC = cue.TOC; - metadata.CopyMetadata(cue); - } - - public ReleaseInfo(CUESheet cue, Freedb.CDEntry release) - { - metadata = new CUESheet(cue.Config); - metadata.TOC = cue.TocFromCDEntry(release); - metadata.FillFromFreedb(release); - } - - public ReleaseInfo(CUESheet cue, MusicBrainz.Release release) - { - metadata = new CUESheet(cue.Config); - metadata.TOC = cue.TOC; - metadata.FillFromMusicBrainz(release); - } - - private string FixEncoding(string src) - { - Encoding iso = Encoding.GetEncoding("iso-8859-1"); - return Encoding.Default.GetString(iso.GetBytes(src)); - } - - public string Text - { - get - { - return string.Format("{0}: {1} - {2}", - metadata.Year == "" ? "YYYY" : metadata.Year, - metadata.Artist == "" ? "Unknown Artist" : metadata.Artist, - metadata.Title == "" ? "Unknown Title" : metadata.Title); - } - } - - public void FixEncoding() - { - metadata.Artist = FixEncoding(metadata.Artist); - metadata.Title = FixEncoding(metadata.Title); - foreach (TrackInfo track in metadata.Tracks) - { - track.Title = FixEncoding(track.Title); - track.Artist = FixEncoding(track.Artist); - } - } - - public bool Equals(ReleaseInfo r) - { - bool equal = metadata.Title == r.metadata.Title && metadata.Artist == r.metadata.Artist; - for (int t = 0; t < metadata.TrackCount; t++) - if (r.metadata.Tracks[t].Title != metadata.Tracks[t].Title || r.metadata.Tracks[t].Artist != metadata.Tracks[t].Artist) - equal = false; - return equal; - } - } -} \ No newline at end of file +} diff --git a/CUETools/frmChoice.resx b/CUETools/frmChoice.resx index be18e9f..315b585 100644 --- a/CUETools/frmChoice.resx +++ b/CUETools/frmChoice.resx @@ -166,83 +166,119 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACg - EQAAAk1TRnQBSQFMAgEBBAEAAQwBAAEEAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA - AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD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QH/AZkCUQH/AwcB/wMAAf8DOAH/AxQB/wGZAlEB/xQAAzIBUANRAaIDXQHS + AYwCiQH/A2AB1ANUAaYDNwFaAwUBBxAAAUIBTQE+BwABPgMAASgDAAFAAwABIAMAAQEBAAEBBgABARYA + A/8BAAHjA/8EAAHBA/8EAAGAAf8BCAEQBQABfwcAAT8HAAEfBgABgAEPBgABwAEHBgAB4AEDBgAB8AEB + BgAB+AcAAfwHAAH+AQgGAAH/BwAB/wGAAf8B8AQAAf8BwAH/AfgEAAHgAQMCAAGAAQEB4AEDAcABAQQA + AcABAQGABQABgAEAAYAFAAGAQQABgAUAAYABAAGAAQEEAAGAAQEBwAEDBAABwAEDAfABDwIAAYABAQHw + AQ8L diff --git a/ThirdParty/taglib-sharp.dll b/ThirdParty/taglib-sharp.dll index c618247..58b1dba 100644 Binary files a/ThirdParty/taglib-sharp.dll and b/ThirdParty/taglib-sharp.dll differ