Skip to content

Commit bdbae35

Browse files
authored
Merge pull request #132 from PlatoniusIII/master
Added InitialKey, Publisher, ISRC and RemixedBy to combined tag.
2 parents 3fbd2b8 + 20a69ca commit bdbae35

File tree

13 files changed

+98133
-22
lines changed

13 files changed

+98133
-22
lines changed

src/TagLib/CombinedTag.cs

+174-2
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,180 @@ public override double ReplayGainAlbumPeak {
18381838
if (tag != null)
18391839
tag.ReplayGainAlbumPeak = value;
18401840
}
1841-
}
1842-
1841+
}
1842+
1843+
/// <summary>
1844+
/// Gets and sets the initial key of the media
1845+
/// represented by the current instance.
1846+
/// </summary>
1847+
/// <value>
1848+
/// A <see cref="string" /> object containing the initial
1849+
/// key of the media represented by the current
1850+
/// instance or <see langword="null" /> if no value present.
1851+
/// </value>
1852+
/// <remarks>
1853+
/// <para>When getting the value, the child tags are looped
1854+
/// through in order and the first non-<see langword="null" />
1855+
/// value is returned.</para>
1856+
/// <para>When setting the value, it is stored in each child
1857+
/// tag.</para>
1858+
/// </remarks>
1859+
/// <seealso cref="Tag.InitialKey" />
1860+
public override string InitialKey
1861+
{
1862+
get
1863+
{
1864+
foreach (Tag tag in tags)
1865+
{
1866+
if (tag == null)
1867+
continue;
1868+
1869+
string value = tag.InitialKey;
1870+
1871+
if (value != null)
1872+
return value;
1873+
}
1874+
1875+
return null;
1876+
}
1877+
1878+
set
1879+
{
1880+
foreach (Tag tag in tags)
1881+
if (tag != null)
1882+
tag.InitialKey = value;
1883+
}
1884+
}
1885+
1886+
/// <summary>
1887+
/// Gets and sets the remixer of the media
1888+
/// represented by the current instance.
1889+
/// </summary>
1890+
/// <value>
1891+
/// A <see cref="string" /> object containing the remixer
1892+
/// of the media represented by the current
1893+
/// instance or <see langword="null" /> if no value present.
1894+
/// </value>
1895+
/// <remarks>
1896+
/// <para>When getting the value, the child tags are looped
1897+
/// through in order and the first non-<see langword="null" />
1898+
/// value is returned.</para>
1899+
/// <para>When setting the value, it is stored in each child
1900+
/// tag.</para>
1901+
/// </remarks>
1902+
/// <seealso cref="Tag.RemixedBy" />
1903+
public override string RemixedBy
1904+
{
1905+
get
1906+
{
1907+
foreach (Tag tag in tags)
1908+
{
1909+
if (tag == null)
1910+
continue;
1911+
1912+
string value = tag.RemixedBy;
1913+
1914+
if (value != null)
1915+
return value;
1916+
}
1917+
1918+
return null;
1919+
}
1920+
1921+
set
1922+
{
1923+
foreach (Tag tag in tags)
1924+
if (tag != null)
1925+
tag.RemixedBy = value;
1926+
}
1927+
}
1928+
1929+
/// <summary>
1930+
/// Gets and sets the publisher of the media
1931+
/// represented by the current instance.
1932+
/// </summary>
1933+
/// <value>
1934+
/// A <see cref="string" /> object containing the
1935+
/// publisher of the media represented by the current
1936+
/// instance or <see langword="null" /> if no value present.
1937+
/// </value>
1938+
/// <remarks>
1939+
/// <para>When getting the value, the child tags are looped
1940+
/// through in order and the first non-<see langword="null" />
1941+
/// value is returned.</para>
1942+
/// <para>When setting the value, it is stored in each child
1943+
/// tag.</para>
1944+
/// </remarks>
1945+
/// <seealso cref="Tag.Publisher" />
1946+
public override string Publisher
1947+
{
1948+
get
1949+
{
1950+
foreach (Tag tag in tags)
1951+
{
1952+
if (tag == null)
1953+
continue;
1954+
1955+
string value = tag.Publisher;
1956+
1957+
if (value != null)
1958+
return value;
1959+
}
1960+
1961+
return null;
1962+
}
1963+
1964+
set
1965+
{
1966+
foreach (Tag tag in tags)
1967+
if (tag != null)
1968+
tag.Publisher = value;
1969+
}
1970+
}
1971+
1972+
/// <summary>
1973+
/// Gets and sets the ISRC (International Standard Recording Code)
1974+
/// of the song represented by the current instance.
1975+
/// </summary>
1976+
/// <value>
1977+
/// A <see cref="string" /> object containing the ISRC
1978+
/// of the media represented by the current
1979+
/// instance or <see langword="null" /> if no value present.
1980+
/// </value>
1981+
/// <remarks>
1982+
/// <para>When getting the value, the child tags are looped
1983+
/// through in order and the first non-<see langword="null" />
1984+
/// value is returned.</para>
1985+
/// <para>When setting the value, it is stored in each child
1986+
/// tag.</para>
1987+
/// </remarks>
1988+
/// <seealso cref="Tag.ISRC" />
1989+
public override string ISRC
1990+
{
1991+
get
1992+
{
1993+
foreach (Tag tag in tags)
1994+
{
1995+
if (tag == null)
1996+
continue;
1997+
1998+
string value = tag.ISRC;
1999+
2000+
if (value != null)
2001+
return value;
2002+
}
2003+
2004+
return null;
2005+
}
2006+
2007+
set
2008+
{
2009+
foreach (Tag tag in tags)
2010+
if (tag != null)
2011+
tag.ISRC = value;
2012+
}
2013+
}
2014+
18432015
/// <summary>
18442016
/// Gets whether or not the current instance is empty.
18452017
/// </summary>

src/TagLib/Id3v2/FrameTypes.cs

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ internal static class FrameType {
6363
public static readonly ReadOnlyByteVector TIT2 = "TIT2";
6464
public static readonly ReadOnlyByteVector TIT3 = "TIT3";
6565
public static readonly ReadOnlyByteVector TIME = "TIME";
66+
public static readonly ReadOnlyByteVector TKEY = "TKEY";
6667
public static readonly ReadOnlyByteVector TMCL = "TMCL";
6768
public static readonly ReadOnlyByteVector TOLY = "TOLY";
6869
public static readonly ReadOnlyByteVector TOPE = "TOPE";
@@ -71,6 +72,7 @@ internal static class FrameType {
7172
public static readonly ReadOnlyByteVector TPE3 = "TPE3";
7273
public static readonly ReadOnlyByteVector TPE4 = "TPE4";
7374
public static readonly ReadOnlyByteVector TPOS = "TPOS";
75+
public static readonly ReadOnlyByteVector TPUB = "TPUB";
7476
public static readonly ReadOnlyByteVector TRCK = "TRCK";
7577
public static readonly ReadOnlyByteVector TRDA = "TRDA";
7678
public static readonly ReadOnlyByteVector TSIZ = "TSIZ";
@@ -79,6 +81,7 @@ internal static class FrameType {
7981
public static readonly ReadOnlyByteVector TSOC = "TSOC"; // Composer Sort Frame
8082
public static readonly ReadOnlyByteVector TSOP = "TSOP"; // Performer Sort Frame
8183
public static readonly ReadOnlyByteVector TSOT = "TSOT"; // Track Title Sort Frame
84+
public static readonly ReadOnlyByteVector TSRC = "TSRC";
8285
public static readonly ReadOnlyByteVector TXXX = "TXXX";
8386
public static readonly ReadOnlyByteVector TYER = "TYER";
8487
public static readonly ReadOnlyByteVector UFID = "UFID";

src/TagLib/Id3v2/Tag.cs

+62-2
Original file line numberDiff line numberDiff line change
@@ -2353,8 +2353,68 @@ public override double ReplayGainAlbumPeak {
23532353
SetUserTextAsString ("REPLAYGAIN_ALBUM_PEAK", text, false);
23542354
}
23552355
}
2356-
}
2357-
2356+
}
2357+
2358+
/// <summary>
2359+
/// Gets and sets the initial key of the song.
2360+
/// </summary>
2361+
/// <value>
2362+
/// A <see cref="string" /> object containing the initial key of the song.
2363+
/// </value>
2364+
/// <remarks>
2365+
/// This property is implemented using the "TKEY" field.
2366+
/// </remarks>
2367+
public override string InitialKey
2368+
{
2369+
get { return GetTextAsString(FrameType.TKEY); }
2370+
set { SetTextFrame(FrameType.TKEY, value); }
2371+
}
2372+
2373+
/// <summary>
2374+
/// Gets and sets the remixer of the song.
2375+
/// </summary>
2376+
/// <value>
2377+
/// A <see cref="string" /> object containing the remixer of the song.
2378+
/// </value>
2379+
/// <remarks>
2380+
/// This property is implemented using the "TPE4" field.
2381+
/// </remarks>
2382+
public override string RemixedBy
2383+
{
2384+
get { return GetTextAsString(FrameType.TPE4); }
2385+
set { SetTextFrame(FrameType.TPE4, value); }
2386+
}
2387+
2388+
/// <summary>
2389+
/// Gets and sets the publisher of the song.
2390+
/// </summary>
2391+
/// <value>
2392+
/// A <see cref="string" /> object containing the publisher of the song.
2393+
/// </value>
2394+
/// <remarks>
2395+
/// This property is implemented using the "TPUB" field.
2396+
/// </remarks>
2397+
public override string Publisher
2398+
{
2399+
get { return GetTextAsString(FrameType.TPUB); }
2400+
set { SetTextFrame(FrameType.TPUB, value); }
2401+
}
2402+
2403+
/// <summary>
2404+
/// Gets and sets the ISRC (International Standard Recording Code) of the song.
2405+
/// </summary>
2406+
/// <value>
2407+
/// A <see cref="string" /> object containing the ISRC of the song.
2408+
/// </value>
2409+
/// <remarks>
2410+
/// This property is implemented using the "TSRC" field.
2411+
/// </remarks>
2412+
public override string ISRC
2413+
{
2414+
get { return GetTextAsString(FrameType.TSRC); }
2415+
set { SetTextFrame(FrameType.TSRC, value); }
2416+
}
2417+
23582418
/// <summary>
23592419
/// Gets and sets a collection of pictures associated with
23602420
/// the media represented by the current instance.

src/TagLib/Mpeg4/AppleTag.cs

+70-2
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,76 @@ public override double ReplayGainAlbumPeak
16601660
string text = value.ToString("0.000000", CultureInfo.InvariantCulture);
16611661
SetDashBox("com.apple.iTunes", "REPLAYGAIN_ALBUM_PEAK", text);
16621662
}
1663-
}
1664-
1663+
}
1664+
1665+
/// <summary>
1666+
/// Gets and sets the InitialKey
1667+
/// </summary>
1668+
/// <value>
1669+
/// A <see cref="string" /> containing the InitialKey
1670+
/// for the media described by the current instance,
1671+
/// or null if no value is present.
1672+
/// </value>
1673+
/// <remarks>
1674+
/// This property is implemented using the "dash"/"----" box type.
1675+
/// </remarks>
1676+
public override string InitialKey
1677+
{
1678+
get { return GetDashBox("com.apple.iTunes", "initialkey"); }
1679+
set { SetDashBox("com.apple.iTunes", "initialkey", value); }
1680+
}
1681+
1682+
/// <summary>
1683+
/// Gets and sets the ISRC
1684+
/// </summary>
1685+
/// <value>
1686+
/// A <see cref="string" /> containing the ISRC
1687+
/// for the media described by the current instance,
1688+
/// or null if no value is present.
1689+
/// </value>
1690+
/// <remarks>
1691+
/// This property is implemented using the "dash"/"----" box type.
1692+
/// </remarks>
1693+
public override string ISRC
1694+
{
1695+
get { return GetDashBox("com.apple.iTunes", "ISRC"); }
1696+
set { SetDashBox("com.apple.iTunes", "ISRC", value); }
1697+
}
1698+
1699+
/// <summary>
1700+
/// Gets and sets the Publisher
1701+
/// </summary>
1702+
/// <value>
1703+
/// A <see cref="string" /> containing the Publisher
1704+
/// for the media described by the current instance,
1705+
/// or null if no value is present.
1706+
/// </value>
1707+
/// <remarks>
1708+
/// This property is implemented using the "dash"/"----" box type.
1709+
/// </remarks>
1710+
public override string Publisher
1711+
{
1712+
get { return GetDashBox("com.apple.iTunes", "publisher"); }
1713+
set { SetDashBox("com.apple.iTunes", "publisher", value); }
1714+
}
1715+
1716+
/// <summary>
1717+
/// Gets and sets the Remixer
1718+
/// </summary>
1719+
/// <value>
1720+
/// A <see cref="string" /> containing the Remixer
1721+
/// for the media described by the current instance,
1722+
/// or null if no value is present.
1723+
/// </value>
1724+
/// <remarks>
1725+
/// This property is implemented using the "dash"/"----" box type.
1726+
/// </remarks>
1727+
public override string RemixedBy
1728+
{
1729+
get { return GetDashBox("com.apple.iTunes", "REMIXEDBY"); }
1730+
set { SetDashBox("com.apple.iTunes", "REMIXEDBY", value); }
1731+
}
1732+
16651733
/// <summary>
16661734
/// Gets and sets a collection of pictures associated with
16671735
/// the media represented by the current instance.

0 commit comments

Comments
 (0)