mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Applied patches that are needed for CUETools to function with this version of taglib:
1) .iso.wv support 2) foobar2000 tag mapping 3) new tags for ReleaseDate, ReleaseCountry, DiscSubtitle, Publisher, CatalogNumber 4) Bugfixes
This commit is contained in:
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly:AssemblyCopyright ("Copyright (c) 2006-2007 Brian Nickel. Copyright (c) 2009-2010 Other contributors")]
|
[assembly:AssemblyCopyright ("Copyright (c) 2006-2007 Brian Nickel. Copyright (c) 2009-2010 Other contributors")]
|
||||||
[assembly:AssemblyCompany ("")]
|
[assembly:AssemblyCompany ("")]
|
||||||
[assembly:AssemblyDelaySign(false)]
|
[assembly:AssemblyDelaySign(false)]
|
||||||
[assembly:AssemblyKeyFile("taglib-sharp.snk")]
|
[assembly:CLSCompliant(false)]
|
||||||
[assembly:CLSCompliant(false)]
|
[assembly: ComVisibleAttribute(false)]
|
||||||
|
|||||||
@@ -1418,6 +1418,75 @@ namespace TagLib.Ape {
|
|||||||
set {SetValue ("RELEASECOUNTRY", value);}
|
set {SetValue ("RELEASECOUNTRY", value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "RELEASE DATE" item.
|
||||||
|
/// </remarks>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get {return GetItemAsString ("RELEASE DATE") ?? GetItemAsString ("RELEASETIME");}
|
||||||
|
set {SetValue ("RELEASE DATE", value);}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "PUBLISHER" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get { return GetItemAsString ("PUBLISHER") ?? GetItemAsString ("LABEL"); }
|
||||||
|
set { SetValue ("PUBLISHER", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "LABELNO" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string CatalogNo {
|
||||||
|
get { return GetItemAsString ("CATALOG") ?? GetItemAsString ("CATALOGNUMBER") ?? GetItemAsString ("LABELNO"); }
|
||||||
|
set { SetValue ("CATALOG", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "DISCSUBTITLE" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string DiscSubtitle {
|
||||||
|
get { return GetItemAsString ("DISCSUBTITLE"); }
|
||||||
|
set { SetValue ("DISCSUBTITLE", value); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -1309,6 +1309,41 @@ namespace TagLib.Asf {
|
|||||||
set {SetDescriptorString (value, "MusicBrainz/Album Release Country");}
|
set {SetDescriptorString (value, "MusicBrainz/Album Release Country");}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "ReleaseDate" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get { return GetDescriptorString("ReleaseDate"); }
|
||||||
|
set { SetDescriptorString(value, "ReleaseDate"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "PUBLISHER" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get { return GetDescriptorString("WM/Publisher"); }
|
||||||
|
set { SetDescriptorString(value, "WM/Publisher"); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -1442,6 +1442,163 @@ namespace TagLib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child tags are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in each child
|
||||||
|
/// tag.</para>
|
||||||
|
/// </remarks>
|
||||||
|
/// <seealso cref="Tag.ReleaseDate" />
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get {
|
||||||
|
foreach (Tag tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.ReleaseDate;
|
||||||
|
|
||||||
|
if (value != null)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
set {
|
||||||
|
foreach (Tag tag in tags)
|
||||||
|
if (tag != null)
|
||||||
|
tag.ReleaseDate = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child tags are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in each child
|
||||||
|
/// tag.</para>
|
||||||
|
/// </remarks>
|
||||||
|
/// <seealso cref="Tag.Publisher" />
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
foreach (Tag tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.Publisher;
|
||||||
|
|
||||||
|
if (value != null)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
set {
|
||||||
|
foreach (Tag tag in tags)
|
||||||
|
if (tag != null)
|
||||||
|
tag.Publisher = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child tags are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in each child
|
||||||
|
/// tag.</para>
|
||||||
|
/// </remarks>
|
||||||
|
/// <seealso cref="Tag.CatalogNo" />
|
||||||
|
public override string CatalogNo {
|
||||||
|
get {
|
||||||
|
foreach (Tag tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.CatalogNo;
|
||||||
|
|
||||||
|
if (value != null)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
set {
|
||||||
|
foreach (Tag tag in tags)
|
||||||
|
if (tag != null)
|
||||||
|
tag.CatalogNo = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child tags are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in each child
|
||||||
|
/// tag.</para>
|
||||||
|
/// </remarks>
|
||||||
|
/// <seealso cref="Tag.DiscSubtitle" />
|
||||||
|
public override string DiscSubtitle {
|
||||||
|
get {
|
||||||
|
foreach (Tag tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.DiscSubtitle;
|
||||||
|
|
||||||
|
if (value != null)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
set {
|
||||||
|
foreach (Tag tag in tags)
|
||||||
|
if (tag != null)
|
||||||
|
tag.DiscSubtitle = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ namespace TagLib.Id3v2 {
|
|||||||
public static readonly ReadOnlyByteVector TCOP = "TCOP";
|
public static readonly ReadOnlyByteVector TCOP = "TCOP";
|
||||||
public static readonly ReadOnlyByteVector TCMP = "TCMP";
|
public static readonly ReadOnlyByteVector TCMP = "TCMP";
|
||||||
public static readonly ReadOnlyByteVector TDRC = "TDRC";
|
public static readonly ReadOnlyByteVector TDRC = "TDRC";
|
||||||
public static readonly ReadOnlyByteVector TDAT = "TDAT";
|
public static readonly ReadOnlyByteVector TDAT = "TDAT";
|
||||||
|
public static readonly ReadOnlyByteVector TDRL = "TDRL"; // Release Date
|
||||||
public static readonly ReadOnlyByteVector TEXT = "TEXT";
|
public static readonly ReadOnlyByteVector TEXT = "TEXT";
|
||||||
public static readonly ReadOnlyByteVector TIT1 = "TIT1";
|
public static readonly ReadOnlyByteVector TIT1 = "TIT1";
|
||||||
public static readonly ReadOnlyByteVector TIT2 = "TIT2";
|
public static readonly ReadOnlyByteVector TIT2 = "TIT2";
|
||||||
@@ -67,7 +68,8 @@ namespace TagLib.Id3v2 {
|
|||||||
public static readonly ReadOnlyByteVector TPE2 = "TPE2";
|
public static readonly ReadOnlyByteVector TPE2 = "TPE2";
|
||||||
public static readonly ReadOnlyByteVector TPE3 = "TPE3";
|
public static readonly ReadOnlyByteVector TPE3 = "TPE3";
|
||||||
public static readonly ReadOnlyByteVector TPE4 = "TPE4";
|
public static readonly ReadOnlyByteVector TPE4 = "TPE4";
|
||||||
public static readonly ReadOnlyByteVector TPOS = "TPOS";
|
public static readonly ReadOnlyByteVector TPOS = "TPOS";
|
||||||
|
public static readonly ReadOnlyByteVector TPUB = "TPUB"; // Publisher
|
||||||
public static readonly ReadOnlyByteVector TRCK = "TRCK";
|
public static readonly ReadOnlyByteVector TRCK = "TRCK";
|
||||||
public static readonly ReadOnlyByteVector TRDA = "TRDA";
|
public static readonly ReadOnlyByteVector TRDA = "TRDA";
|
||||||
public static readonly ReadOnlyByteVector TSIZ = "TSIZ";
|
public static readonly ReadOnlyByteVector TSIZ = "TSIZ";
|
||||||
@@ -75,7 +77,8 @@ namespace TagLib.Id3v2 {
|
|||||||
public static readonly ReadOnlyByteVector TSO2 = "TSO2"; // Album Artist Sort Frame
|
public static readonly ReadOnlyByteVector TSO2 = "TSO2"; // Album Artist Sort Frame
|
||||||
public static readonly ReadOnlyByteVector TSOC = "TSOC"; // Composer Sort Frame
|
public static readonly ReadOnlyByteVector TSOC = "TSOC"; // Composer Sort Frame
|
||||||
public static readonly ReadOnlyByteVector TSOP = "TSOP"; // Performer Sort Frame
|
public static readonly ReadOnlyByteVector TSOP = "TSOP"; // Performer Sort Frame
|
||||||
public static readonly ReadOnlyByteVector TSOT = "TSOT"; // Track Title Sort Frame
|
public static readonly ReadOnlyByteVector TSOT = "TSOT"; // Track Title Sort Frame
|
||||||
|
public static readonly ReadOnlyByteVector TSST = "TSST"; // Set subtitle
|
||||||
public static readonly ReadOnlyByteVector TXXX = "TXXX";
|
public static readonly ReadOnlyByteVector TXXX = "TXXX";
|
||||||
public static readonly ReadOnlyByteVector TYER = "TYER";
|
public static readonly ReadOnlyByteVector TYER = "TYER";
|
||||||
public static readonly ReadOnlyByteVector UFID = "UFID";
|
public static readonly ReadOnlyByteVector UFID = "UFID";
|
||||||
|
|||||||
@@ -1892,6 +1892,78 @@ namespace TagLib.Id3v2 {
|
|||||||
get {return GetUserTextAsString ("MusicBrainz Album Release Country");}
|
get {return GetUserTextAsString ("MusicBrainz Album Release Country");}
|
||||||
set {SetUserTextAsString ("MusicBrainz Album Release Country",value);}
|
set {SetUserTextAsString ("MusicBrainz Album Release Country",value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "TDRL" text.
|
||||||
|
/// </remarks>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get {return GetTextAsString (FrameType.TDRL);}
|
||||||
|
set {SetTextFrame (FrameType.TDRL, value);}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "TPUB" text.
|
||||||
|
/// </remarks>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get {return GetTextAsString (FrameType.TPUB);}
|
||||||
|
set {SetTextFrame (FrameType.TPUB, value);}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "TXXX:CATALOGNUMBER" frame.
|
||||||
|
/// http://musicbrainz.org/doc/PicardTagMapping
|
||||||
|
/// </remarks>
|
||||||
|
public override string CatalogNo {
|
||||||
|
get {return GetUserTextAsString ("CATALOGNUMBER");}
|
||||||
|
set {SetUserTextAsString ("CATALOGNUMBER",value);}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>This is normally a name which identifies the media
|
||||||
|
/// within a set, for example name of a CD within a boxset release.
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
public override string DiscSubtitle {
|
||||||
|
get {return GetTextAsString (FrameType.TSST);}
|
||||||
|
set {SetTextFrame (FrameType.TSST, value);}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
|
|||||||
@@ -631,6 +631,36 @@ namespace TagLib.Matroska
|
|||||||
set { }
|
set { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get { return null; }
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -432,15 +432,20 @@ namespace TagLib.Mpeg4 {
|
|||||||
/// <param name="datastring">String specifying text for data box</param>
|
/// <param name="datastring">String specifying text for data box</param>
|
||||||
public void SetDashBox(string meanstring, string namestring, string datastring)
|
public void SetDashBox(string meanstring, string namestring, string datastring)
|
||||||
{
|
{
|
||||||
AppleDataBox data_box = GetDashAtoms(meanstring, namestring);
|
AppleDataBox data_box = GetDashAtoms(meanstring, namestring);
|
||||||
|
|
||||||
// If we did find a data_box and we have an empty datastring we should
|
if (string.IsNullOrEmpty(datastring))
|
||||||
// remove the entire dash box.
|
{
|
||||||
if (data_box != null && string.IsNullOrEmpty(datastring)) {
|
// If we did find a data_box and we have an empty datastring we should
|
||||||
AppleAnnotationBox dash_box = GetParentDashBox(meanstring, namestring);
|
// remove the entire dash box.
|
||||||
dash_box.ClearChildren();
|
if (data_box != null)
|
||||||
ilst_box.RemoveChild(dash_box);
|
{
|
||||||
return;
|
AppleAnnotationBox dash_box = GetParentDashBox(meanstring, namestring);
|
||||||
|
dash_box.ClearChildren();
|
||||||
|
ilst_box.RemoveChild(dash_box);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data_box != null) {
|
if (data_box != null) {
|
||||||
@@ -1360,6 +1365,78 @@ namespace TagLib.Mpeg4 {
|
|||||||
set {SetDashBox("com.apple.iTunes", "MusicBrainz Album Release Country",value);}
|
set {SetDashBox("com.apple.iTunes", "MusicBrainz Album Release Country",value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "dash"/"----" box type.
|
||||||
|
/// </remarks>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get { return GetDashBox("com.apple.iTunes", "MusicBrainz Album Release Date"); }
|
||||||
|
set { SetDashBox("com.apple.iTunes", "MusicBrainz Album Release Date", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "dash"/"----" box type.
|
||||||
|
/// http://musicbrainz.org/doc/PicardTagMapping
|
||||||
|
/// </remarks>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get { return GetDashBox("com.apple.iTunes", "LABEL"); }
|
||||||
|
set { SetDashBox("com.apple.iTunes", "LABEL", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "dash"/"----" box type.
|
||||||
|
/// http://musicbrainz.org/doc/PicardTagMapping
|
||||||
|
/// </remarks>
|
||||||
|
public override string CatalogNo {
|
||||||
|
get { return GetDashBox("com.apple.iTunes", "CATALOGNUMBER"); }
|
||||||
|
set { SetDashBox("com.apple.iTunes", "CATALOGNUMBER", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "dash"/"----" box type.
|
||||||
|
/// http://musicbrainz.org/doc/PicardTagMapping
|
||||||
|
/// </remarks>
|
||||||
|
public override string DiscSubtitle {
|
||||||
|
get { return GetDashBox("com.apple.iTunes", "DISCSUBTITLE"); }
|
||||||
|
set { SetDashBox("com.apple.iTunes", "DISCSUBTITLE", value); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace TagLib.Mpeg4 {
|
|||||||
else if (type == BoxType.Free || type == BoxType.Skip)
|
else if (type == BoxType.Free || type == BoxType.Skip)
|
||||||
return new IsoFreeSpaceBox (header, file,
|
return new IsoFreeSpaceBox (header, file,
|
||||||
handler);
|
handler);
|
||||||
else if (type == BoxType.Mean || type == BoxType.Name)
|
else if ((type == BoxType.Mean || type == BoxType.Name) && header.DataSize >= 4)
|
||||||
return new AppleAdditionalInfoBox (header, file,
|
return new AppleAdditionalInfoBox (header, file,
|
||||||
handler);
|
handler);
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,11 @@ namespace TagLib.Ogg.Codecs
|
|||||||
data.Add (id);
|
data.Add (id);
|
||||||
data.Add (comment.Render (true));
|
data.Add (comment.Render (true));
|
||||||
if (packets.Count > 1 && PacketType (packets [1]) == 0x03)
|
if (packets.Count > 1 && PacketType (packets [1]) == 0x03)
|
||||||
|
{
|
||||||
|
if (data.Count < packets [1].Count)
|
||||||
|
data.Add (new ByteVector (packets [1].Count - data.Count, 0));
|
||||||
packets [1] = data;
|
packets [1] = data;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
packets.Insert (1, data);
|
packets.Insert (1, data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1208,6 +1208,139 @@ namespace TagLib.Ogg
|
|||||||
set {if (tags.Count > 0) tags [0].MusicBrainzReleaseCountry = value;}
|
set {if (tags.Count > 0) tags [0].MusicBrainzReleaseCountry = value;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child comments are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in the first
|
||||||
|
/// comment.</para>
|
||||||
|
/// </remarks>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get {
|
||||||
|
foreach (XiphComment tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.ReleaseDate;
|
||||||
|
|
||||||
|
if (value != null && value.Length > 0)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
set {if (tags.Count > 0) tags [0].ReleaseDate = value;}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child comments are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in the first
|
||||||
|
/// comment.</para>
|
||||||
|
/// </remarks>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
foreach (XiphComment tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.Publisher;
|
||||||
|
|
||||||
|
if (value != null && value.Length > 0)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
set {if (tags.Count > 0) tags [0].Publisher = value;}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child comments are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in the first
|
||||||
|
/// comment.</para>
|
||||||
|
/// </remarks>
|
||||||
|
public override string CatalogNo {
|
||||||
|
get {
|
||||||
|
foreach (XiphComment tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.CatalogNo;
|
||||||
|
|
||||||
|
if (value != null && value.Length > 0)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
set {if (tags.Count > 0) tags [0].CatalogNo = value;}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>When getting the value, the child comments are looped
|
||||||
|
/// through in order and the first non-<see langword="null" />
|
||||||
|
/// and non-empty value is returned.</para>
|
||||||
|
/// <para>When setting the value, it is stored in the first
|
||||||
|
/// comment.</para>
|
||||||
|
/// </remarks>
|
||||||
|
public override string DiscSubtitle {
|
||||||
|
get {
|
||||||
|
foreach (XiphComment tag in tags) {
|
||||||
|
if (tag == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
string value = tag.DiscSubtitle;
|
||||||
|
|
||||||
|
if (value != null && value.Length > 0)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
set {if (tags.Count > 0) tags [0].DiscSubtitle = value;}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ namespace TagLib.Ogg
|
|||||||
|
|
||||||
return GetField ("ENSEMBLE");
|
return GetField ("ENSEMBLE");
|
||||||
}
|
}
|
||||||
set {SetField ("ALBUMARTIST", value);}
|
set {SetField ("ALBUM ARTIST", value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -741,7 +741,8 @@ namespace TagLib.Ogg
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
SetField ("TRACKTOTAL", TrackCount);
|
// SetField ("TRACKTOTAL", TrackCount);
|
||||||
|
SetField ("TOTALTRACKS", TrackCount);
|
||||||
SetField ("TRACKNUMBER", value);
|
SetField ("TRACKNUMBER", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -769,6 +770,10 @@ namespace TagLib.Ogg
|
|||||||
if ((text = GetFirstField ("TRACKTOTAL")) !=
|
if ((text = GetFirstField ("TRACKTOTAL")) !=
|
||||||
null && uint.TryParse (text, out value))
|
null && uint.TryParse (text, out value))
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
|
if ((text = GetFirstField ("TOTALTRACKS")) !=
|
||||||
|
null && uint.TryParse (text, out value))
|
||||||
|
return value;
|
||||||
|
|
||||||
if ((text = GetFirstField ("TRACKNUMBER")) !=
|
if ((text = GetFirstField ("TRACKNUMBER")) !=
|
||||||
null && (values = text.Split ('/'))
|
null && (values = text.Split ('/'))
|
||||||
@@ -778,7 +783,8 @@ namespace TagLib.Ogg
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
set {SetField ("TRACKTOTAL", value);}
|
//set {SetField ("TRACKTOTAL", value);}
|
||||||
|
set {SetField ("TOTALTRACKS", value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -808,7 +814,8 @@ namespace TagLib.Ogg
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
SetField ("DISCTOTAL", DiscCount);
|
// SetField ("DISCTOTAL", DiscCount);
|
||||||
|
SetField ("TOTALDISCS", DiscCount);
|
||||||
SetField ("DISCNUMBER", value);
|
SetField ("DISCNUMBER", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -836,6 +843,11 @@ namespace TagLib.Ogg
|
|||||||
if ((text = GetFirstField ("DISCTOTAL")) != null
|
if ((text = GetFirstField ("DISCTOTAL")) != null
|
||||||
&& uint.TryParse (text, out value))
|
&& uint.TryParse (text, out value))
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
|
|
||||||
|
if ((text = GetFirstField ("TOTALDISCS")) != null
|
||||||
|
&& uint.TryParse (text, out value))
|
||||||
|
return value;
|
||||||
|
|
||||||
if ((text = GetFirstField ("DISCNUMBER")) !=
|
if ((text = GetFirstField ("DISCNUMBER")) !=
|
||||||
null && (values = text.Split ('/'))
|
null && (values = text.Split ('/'))
|
||||||
@@ -845,7 +857,8 @@ namespace TagLib.Ogg
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
set {SetField ("DISCTOTAL", value);}
|
// set {SetField ("DISCTOTAL", value);}
|
||||||
|
set {SetField ("TOTALDISCS", value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1110,6 +1123,75 @@ namespace TagLib.Ogg
|
|||||||
set {SetField ("RELEASECOUNTRY", value);}
|
set {SetField ("RELEASECOUNTRY", value);}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "RELEASE DATE" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string ReleaseDate {
|
||||||
|
get { return GetFirstField("RELEASE DATE") ?? GetFirstField("RELEASETIME"); }
|
||||||
|
set { SetField("RELEASE DATE", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "PUBLISHER" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string Publisher
|
||||||
|
{
|
||||||
|
get { return GetFirstField("PUBLISHER") ?? GetFirstField("ORGANIZATION") ?? GetFirstField("LABEL"); }
|
||||||
|
set { SetField("PUBLISHER", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "LABELNO" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string CatalogNo {
|
||||||
|
get { return GetFirstField("LABELNO") ?? GetFirstField("CATALOGNUMBER"); }
|
||||||
|
set { SetField("LABELNO", value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// This property is implemented using the "DISCSUBTITLE" field.
|
||||||
|
/// </remarks>
|
||||||
|
public override string DiscSubtitle {
|
||||||
|
get { return GetFirstField("DISCSUBTITLE"); }
|
||||||
|
set { SetField("DISCSUBTITLE", value); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -823,6 +823,84 @@ namespace TagLib {
|
|||||||
set {}
|
set {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Release Date of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the ReleaseDate of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>This field represents the ReleaseDate, that describes
|
||||||
|
/// the year or a more accurate date when this version of an
|
||||||
|
/// album was first released. In case of remastered albums
|
||||||
|
/// this can be a later date than Year. Format can be one of
|
||||||
|
/// yyyy, yyyy-MM, yyyy-MM-dd
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
public virtual string ReleaseDate {
|
||||||
|
get { return null; }
|
||||||
|
set {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the Publisher of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the Publisher of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>This is normally the name of a record label
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
public virtual string Publisher {
|
||||||
|
get { return null; }
|
||||||
|
set {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the CatalogNo of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the catalog number of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>This is normally a unique alphanumeric id, assigned
|
||||||
|
/// to a given release by it's Publisher.
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
public virtual string CatalogNo {
|
||||||
|
get { return null; }
|
||||||
|
set {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and sets the DiscSubtitle of the media represented by
|
||||||
|
/// the current instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// A <see cref="string" /> containing the subtitle of the
|
||||||
|
/// media represented by the current instance or null
|
||||||
|
/// if no value is present.
|
||||||
|
/// </value>
|
||||||
|
/// <remarks>
|
||||||
|
/// <para>This is normally a name which identifies the media
|
||||||
|
/// within a set, for example name of a CD within a boxset release.
|
||||||
|
/// </para>
|
||||||
|
/// </remarks>
|
||||||
|
public virtual string DiscSubtitle {
|
||||||
|
get { return null; }
|
||||||
|
set {}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets and sets a collection of pictures associated with
|
/// Gets and sets a collection of pictures associated with
|
||||||
/// the media represented by the current instance.
|
/// the media represented by the current instance.
|
||||||
|
|||||||
@@ -216,9 +216,29 @@ namespace TagLib.WavPack {
|
|||||||
propertiesStyle == ReadStyle.None)
|
propertiesStyle == ReadStyle.None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Seek (start);
|
// Seek (start);
|
||||||
header_block = ReadBlock (
|
// header_block = ReadBlock (
|
||||||
(int) StreamHeader.Size);
|
// (int) StreamHeader.Size);
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
long position = Find(StreamHeader.FileIdentifier, start);
|
||||||
|
if (position < 0)
|
||||||
|
throw new CorruptFileException(
|
||||||
|
"wvpk header not found");
|
||||||
|
Seek(position);
|
||||||
|
header_block = ReadBlock(
|
||||||
|
(int)StreamHeader.Size);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
new StreamHeader(header_block, header_block.Count);
|
||||||
|
InvariantStartPosition = position;
|
||||||
|
return;
|
||||||
|
} catch (CorruptFileException)
|
||||||
|
{
|
||||||
|
start = position + 4;
|
||||||
|
}
|
||||||
|
} while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -136,6 +136,12 @@ namespace TagLib.WavPack {
|
|||||||
version = data.Mid (8, 2).ToUShort (false);
|
version = data.Mid (8, 2).ToUShort (false);
|
||||||
flags = data.Mid (24, 4).ToUInt (false);
|
flags = data.Mid (24, 4).ToUInt (false);
|
||||||
samples = data.Mid (12, 4).ToUInt (false);
|
samples = data.Mid (12, 4).ToUInt (false);
|
||||||
|
|
||||||
|
if (!(0 == (data[4] & 1) && data[6] < 16 && 0 == data[7] && (data[6] != 0 || data[5] != 0 || data[4] > 24) &&
|
||||||
|
version >= 0x402 && version <= 0x410 &&
|
||||||
|
data[22] < 3 && 0 == data[23]))
|
||||||
|
throw new CorruptFileException(
|
||||||
|
"Not a supported wavpack header");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>..\..\bin\Release\</OutputPath>
|
<OutputPath>..\..\bin\Release\</OutputPath>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
@@ -48,6 +48,8 @@
|
|||||||
<Execution clr-version="Net_2_0" />
|
<Execution clr-version="Net_2_0" />
|
||||||
</Execution>
|
</Execution>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AssemblyInfo.cs" />
|
<Compile Include="AssemblyInfo.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user