Author: bnickel
Date: 2007-05-25 16:20:09 -0400 (Fri, 25 May 2007)
New Revision: 77970
Modified:
trunk/taglib-sharp/ChangeLog
trunk/taglib-sharp/configure.ac
trunk/taglib-sharp/docs/Makefile.am
trunk/taglib-sharp/docs/en/TagLib.Asf/File.xml
trunk/taglib-sharp/docs/en/TagLib.Flac/File.xml
trunk/taglib-sharp/docs/en/TagLib.Mpeg/AudioFile.xml
trunk/taglib-sharp/docs/en/TagLib.Mpeg/File.xml
trunk/taglib-sharp/docs/en/TagLib.Mpeg4/File.xml
trunk/taglib-sharp/docs/en/TagLib.MusePack/File.xml
trunk/taglib-sharp/docs/en/TagLib.Ogg/File.xml
trunk/taglib-sharp/docs/en/TagLib.Riff/File.xml
trunk/taglib-sharp/docs/en/TagLib.WavPack/File.xml
trunk/taglib-sharp/docs/en/index.xml
trunk/taglib-sharp/src/TagLib/Mpeg/AudioHeader.cs
trunk/taglib-sharp/src/TagLib/TagLib.sources
trunk/taglib-sharp/taglib-sharp.csproj
Log:
2007-05-25 Brian Nickel <[EMAIL PROTECTED]>
+-------------+
| VERSON BUMP |
| 1.9.99994 |
+-------------+
* src/TagLib/TagLib.sources: Remove debugger.
* src/TagLib/Mpeg/AudioHeader.cs: Compile on Windows.
* docs/en/TagLib.Riff/File.xml:
* docs/en/TagLib.Mpeg/AudioFile.xml:
* docs/en/TagLib.Mpeg/File.xml:
* docs/en/TagLib.WavPack/File.xml:
* docs/en/index.xml:
* docs/en/TagLib.Flac/File.xml:
* docs/en/TagLib.MusePack/File.xml:
* docs/en/TagLib.Asf/File.xml:
* docs/en/TagLib.Ogg/File.xml:
* docs/en/TagLib.Mpeg4/File.xml: Fixed tpos.
* docs/Makefile.am: Change target.
* configure.ac: Version bump.
* taglib-sharp.csproj: Add missing files.
Modified: trunk/taglib-sharp/ChangeLog
===================================================================
--- trunk/taglib-sharp/ChangeLog 2007-05-25 19:09:47 UTC (rev 77969)
+++ trunk/taglib-sharp/ChangeLog 2007-05-25 20:20:09 UTC (rev 77970)
@@ -1,5 +1,28 @@
2007-05-25 Brian Nickel <[EMAIL PROTECTED]>
+ +-------------+
+ | VERSON BUMP |
+ | 1.9.99994 |
+ +-------------+
+
+ * src/TagLib/TagLib.sources: Remove debugger.
+ * src/TagLib/Mpeg/AudioHeader.cs: Compile on Windows.
+ * docs/en/TagLib.Riff/File.xml:
+ * docs/en/TagLib.Mpeg/AudioFile.xml:
+ * docs/en/TagLib.Mpeg/File.xml:
+ * docs/en/TagLib.WavPack/File.xml:
+ * docs/en/index.xml:
+ * docs/en/TagLib.Flac/File.xml:
+ * docs/en/TagLib.MusePack/File.xml:
+ * docs/en/TagLib.Asf/File.xml:
+ * docs/en/TagLib.Ogg/File.xml:
+ * docs/en/TagLib.Mpeg4/File.xml: Fixed tpos.
+ * docs/Makefile.am: Change target.
+ * configure.ac: Version bump.
+ * taglib-sharp.csproj: Add missing files.
+
+2007-05-25 Brian Nickel <[EMAIL PROTECTED]>
+
There were changes to 153 files in the last three days. I can't vouch for
everything that happened, as I may have blacked out for some portions, but tags
now have an abstract Tag.TagTypes property, Everything that should be a struct
Modified: trunk/taglib-sharp/configure.ac
===================================================================
--- trunk/taglib-sharp/configure.ac 2007-05-25 19:09:47 UTC (rev 77969)
+++ trunk/taglib-sharp/configure.ac 2007-05-25 20:20:09 UTC (rev 77970)
@@ -3,7 +3,7 @@
MAJOR_VERSION=1
MINOR_VERSION=9
-PATCH_VERSION=99993
+PATCH_VERSION=99994
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
ASM_VERSION="$MAJOR_VERSION.$MINOR_VERSION.0.0"
Modified: trunk/taglib-sharp/docs/Makefile.am
===================================================================
--- trunk/taglib-sharp/docs/Makefile.am 2007-05-25 19:09:47 UTC (rev 77969)
+++ trunk/taglib-sharp/docs/Makefile.am 2007-05-25 20:20:09 UTC (rev 77970)
@@ -32,7 +32,7 @@
$(DOC_ASSEMBLER) $(srcdir)/en
install-data-hook:
- $(MONO) $(top_builddir)/docs/MonodocNodeConfig.exe --insert "TagLib
Libraries" classlib-taglib-sharp $(DOCDIR)/../monodoc.xml
+ $(MONO) $(top_builddir)/docs/MonodocNodeConfig.exe --insert "TagLib#"
classlib-taglib-sharp $(DOCDIR)/../monodoc.xml
uninstall-hook:
$(MONO) $(top_builddir)/docs/MonodocNodeConfig.exe --remove
classlib-taglib-sharp $(DOCDIR)/../monodoc.xml
Modified: trunk/taglib-sharp/docs/en/TagLib.Asf/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Asf/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Asf/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -37,7 +37,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Asf.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -49,7 +49,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Asf.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName="ReadDWord">
Modified: trunk/taglib-sharp/docs/en/TagLib.Flac/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Flac/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Flac/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -34,7 +34,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Flac.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -46,7 +46,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Flac.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
</Members>
Modified: trunk/taglib-sharp/docs/en/TagLib.Mpeg/AudioFile.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Mpeg/AudioFile.xml 2007-05-25
19:09:47 UTC (rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Mpeg/AudioFile.xml 2007-05-25
20:20:09 UTC (rev 77970)
@@ -46,7 +46,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Mpeg.AudioFile" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -58,7 +58,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Mpeg.AudioFile" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
</Members>
Modified: trunk/taglib-sharp/docs/en/TagLib.Mpeg/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Mpeg/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Mpeg/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -40,7 +40,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Mpeg.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -52,7 +52,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Mpeg.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName="GetMarker">
Modified: trunk/taglib-sharp/docs/en/TagLib.Mpeg4/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Mpeg4/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Mpeg4/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -46,7 +46,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Mpeg4.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -58,7 +58,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Mpeg4.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
</Members>
Modified: trunk/taglib-sharp/docs/en/TagLib.MusePack/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.MusePack/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.MusePack/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -29,7 +29,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.MusePack.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -43,7 +43,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.MusePack.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
</Members>
Modified: trunk/taglib-sharp/docs/en/TagLib.Ogg/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Ogg/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Ogg/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -46,7 +46,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Ogg.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -58,7 +58,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Ogg.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
</Members>
Modified: trunk/taglib-sharp/docs/en/TagLib.Riff/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.Riff/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.Riff/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -55,7 +55,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Riff.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -67,7 +67,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.Riff.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName="FileIdentifier">
Modified: trunk/taglib-sharp/docs/en/TagLib.WavPack/File.xml
===================================================================
--- trunk/taglib-sharp/docs/en/TagLib.WavPack/File.xml 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/docs/en/TagLib.WavPack/File.xml 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -28,7 +28,7 @@
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<param name="properties_style">A <see cref="T:TagLib.ReadStyle" />
specifying how to read media properties from the file.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.WavPack.File" /> for a given filename and read style.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String,TagLib.ReadStyle)" /> rather than
through format specific constructors.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
@@ -40,7 +40,7 @@
<Docs>
<param name="file">A file name relevant to the current <see
cref="T:TagLib.File+FileAbstractionCreator" />. By default this is a standard
operating system path.</param>
<summary>Constructs and initializes a new instance of <see
cref="T:TagLib.WavPack.File" /> for a given filename.</summary>
- <remarks>Files should be created using <see
cref="T:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
+ <remarks>Files should be created using <see
cref="M:TagLib.File.Create(System.String)" /> rather than through format
specific constructors.</remarks>
</Docs>
</Member>
</Members>
Modified: trunk/taglib-sharp/docs/en/index.xml
===================================================================
--- trunk/taglib-sharp/docs/en/index.xml 2007-05-25 19:09:47 UTC (rev
77969)
+++ trunk/taglib-sharp/docs/en/index.xml 2007-05-25 20:20:09 UTC (rev
77970)
@@ -123,8 +123,6 @@
<Type Name="SynchedTextType" />
<Type Name="PlayCountFrame" />
</Namespace>
- <Namespace Name="TagLib.Mpc">
- </Namespace>
<Namespace Name="TagLib.Mpeg">
<Type Name="File" />
<Type Name="AudioHeader" />
Modified: trunk/taglib-sharp/src/TagLib/Mpeg/AudioHeader.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Mpeg/AudioHeader.cs 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/src/TagLib/Mpeg/AudioHeader.cs 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -1,291 +1,291 @@
-/***************************************************************************
- copyright : (C) 2005 by Brian Nickel
- email : [EMAIL PROTECTED]
- based on : mpegheader.cpp from TagLib
- ***************************************************************************/
-
-/***************************************************************************
- * This library is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU Lesser General Public License version *
- * 2.1 as published by the Free Software Foundation. *
- * *
- * This library is distributed in the hope that it will be useful, but *
- * WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this library; if not, write to the Free Software *
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
- * USA *
- ***************************************************************************/
-
-using System.Collections;
-using System;
-
-namespace TagLib.Mpeg
-{
-#region Enums
- public enum Version
- {
- Unknown = -1,
- Version1 = 0, // MPEG Version 1
- Version2 = 1, // MPEG Version 2
- Version2_5 = 2 // MPEG Version 2.5
- }
-
- public enum ChannelMode
- {
- Stereo = 0, // Stereo
- JointStereo = 1, // Stereo
- DualChannel = 2, // Dual Mono
- SingleChannel = 3 // Mono
- };
-#endregion
-
- public struct AudioHeader : IAudioCodec
- {
- #region Private Static Value Arrays
- private static readonly int [,] sample_rates = new int [3,4] {
- { 44100, 48000, 32000, 0 }, // Version 1
- { 22050, 24000, 16000, 0 }, // Version 2
- { 11025, 12000, 8000, 0 } // Version 2.5
- };
-
- private static readonly int [,] block_size = new int [3,4] {
- { 0, 384, 1152, 1152 }, // Version 1
- { 0, 384, 1152, 576 }, // Version 2
- { 0, 384, 1152, 576 } // Version 2.5
- };
-
- private static readonly int [,,] bitrates = new int [2,3,16] {
- { // Version 1
- { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416,
448, -1 }, // layer 1
- { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,
384, -1 }, // layer 2
- { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256,
320, -1 } // layer 3
- },
- { // Version 2 or 2.5
- { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224,
256, -1 }, // layer 1
- { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144,
160, -1 }, // layer 2
- { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144,
160, -1 } // layer 3
- }
- };
- #endregion
-
- #region Private Properties
- private uint flags;
- private long position;
- private long stream_length;
- private XingHeader xing_header;
- #endregion
-
- public static readonly AudioHeader Unknown = new AudioHeader
(0,0,0,XingHeader.Unknown);
-
- #region Constructors
- private AudioHeader (uint flags, long position, long stream_length,
XingHeader xing_header)
- {
- this.flags = flags;
- this.position = position;
- this.stream_length = stream_length;
- this.xing_header = xing_header;
- }
-
- private AudioHeader (ByteVector data, TagLib.File file, long offset)
- {
- position = offset;
- stream_length = 0;
- if (data.Count < 4)
- throw new CorruptFileException ("Insufficient header length.");
-
- if (data [0] != 0xFF)
- throw new CorruptFileException ("First byte did not match MPEG
synch.");
-
- if (data [1] < 0xE0)
- throw new CorruptFileException ("Second byte did not match MPEG
synch.");
-
- flags = data.ToUInt ();
-
- if (AudioBitrate < 0)
- throw new CorruptFileException ("Header uses invalid bitrate
index.");
-
- if (AudioSampleRate == 0)
- throw new CorruptFileException ("Invalid sample rate.");
-
- try
- {
- // Check for a Xing header that will help us in gathering
- // information about a VBR stream.
- file.Seek (offset + XingHeader.XingHeaderOffset (Version,
ChannelMode));
- xing_header = new XingHeader (file.ReadBlock (16));
- }
- catch
- {
- xing_header = XingHeader.Unknown;
- }
- }
-#endregion
-
-#region Public Properties
- public Version Version
- {
- get
- {
- switch ((flags >> 19) & 0x03)
- {
- case 0: return Version.Version2_5;
- case 2: return Version.Version2;
- default: return Version.Version1;
- }
- }
- }
-
- public int AudioLayer
- {
- get
- {
- switch ((flags >> 17) & 0x03)
- {
- case 1: return 3;
- case 2: return 2;
- default: return 1;
- }
- }
- }
-
- public int AudioBitrate
- {
- get
- {
- if (xing_header.TotalSize > 0)
- return (int) (Duration > TimeSpan.Zero ? ((XingHeader.TotalSize
* 8L) / Duration.TotalSeconds) / 1000 : 0);
-
- int version_index = Version == Version.Version1 ? 0 : 1;
- int layer_index = AudioLayer > 0 ? AudioLayer - 1 : 0;
- int bitrate_index = (int) (flags >> 12) & 0x0F;
- return bitrates [version_index, layer_index, bitrate_index];
- }
- }
-
- public int AudioSampleRate
- {
- get
- {
- return sample_rates [(int) Version, (int) (flags >> 10) & 0x03];
- }
- }
-
- public int AudioFrameLength
- {
- get
- {
- // Calculate the frame length
- switch (AudioLayer)
- {
- case 1: return (((12000 * AudioBitrate) / AudioSampleRate) +
(IsPadded ? 1 : 0))*4;
- case 2: return (144000 * AudioBitrate) / AudioSampleRate +
(IsPadded ? 1 : 0);
- case 3: return (((144000 * AudioBitrate) / AudioSampleRate) /
(Version == Version.Version1 ? 1 : 2)) + (IsPadded ? 1 : 0);
- default: return 0;
- }
- }
- }
-
- public TimeSpan Duration
- {
- get
- {
- if (xing_header.TotalFrames > 0)
- {
- // Read the length and the bitrate from the Xing header.
- double time_per_frame = (double) block_size [(int) Version,
AudioLayer] / (double) AudioSampleRate;
- return TimeSpan.FromSeconds (time_per_frame *
XingHeader.TotalFrames);
- }
-
- if (AudioFrameLength > 0 && AudioBitrate > 0)
- {
- // Since there was no valid Xing header found, we hope that
we're
- // in a constant bitrate file.
- int frames = (int) ((stream_length - position) /
AudioFrameLength + 1);
- return TimeSpan.FromSeconds ((double) (AudioFrameLength *
frames) / (double) (AudioBitrate * 125) + 0.5);
- }
-
- return TimeSpan.Zero;
- }
- }
-
- public string Description
- {
- get
- {
- System.Text.StringBuilder builder = new System.Text.StringBuilder
();
- builder.Append ("MPEG Version ");
- switch (Version)
- {
- case Version.Version1: builder.Append ("1"); break;
- case Version.Version2: builder.Append ("2"); break;
- case Version.Version2_5: builder.Append ("2.5"); break;
- }
- builder.Append (" Audio, Layer ");
- builder.Append (AudioLayer);
-
- return builder.ToString ();
- }
- }
-
- public bool IsProtected {get {return ((flags >>16) & 1) == 0;}}
- public bool IsPadded {get {return ((flags >> 9) & 1) == 1;}}
- public bool IsCopyrighted {get {return ((flags >> 3) & 1) == 1;}}
- public bool IsOriginal {get {return ((flags >> 2) & 1) == 1;}}
- public int AudioChannels {get {return ChannelMode ==
ChannelMode.SingleChannel ? 1 : 2;}}
- public ChannelMode ChannelMode {get {return (ChannelMode) ((flags >>
14) & 0x03);}}
- public MediaTypes MediaTypes {get {return MediaTypes.Audio;}}
- public XingHeader XingHeader {get {return xing_header;}}
-#endregion
-
-#region Public Methods
- public void SetStreamLength (long stream_length)
- {
- this.stream_length = stream_length;
- }
-#endregion
-
-#region Public Static Methods
- public static bool Find (out AudioHeader header, TagLib.File file, long
position, int length)
- {
- long end = position + length;
-
- header = AudioHeader.Unknown;
-
- file.Seek (position);
- ByteVector buffer = file.ReadBlock (3);
-
- if (buffer.Count < 3)
- return false;
-
- do
- {
- file.Seek (position + 3);
- buffer = buffer.Mid (buffer.Count - 3);
- buffer.Add (file.ReadBlock ((int) File.BufferSize));
-
- for (int i = 0; i < buffer.Count - 3 && (length < 0 || position +
i < end); i++)
- if (buffer [i] == 0xFF && buffer [i + 1] > 0xE0)
- try
- {
- header = new AudioHeader (buffer.Mid (i, 4), file,
position + i);
- return true;
- } catch {}
-
- position += File.BufferSize;
- }
- while (buffer.Count > 3 && (length < 0 || position < end));
-
- return false;
- }
-
- public static bool Find (out AudioHeader header, TagLib.File file, long
position)
- {
- return Find (out header, file, position, -1);
- }
-#endregion
- }
-}
+/***************************************************************************
+ copyright : (C) 2005 by Brian Nickel
+ email : [EMAIL PROTECTED]
+ based on : mpegheader.cpp from TagLib
+ ***************************************************************************/
+
+/***************************************************************************
+ * This library is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Lesser General Public License version *
+ * 2.1 as published by the Free Software Foundation. *
+ * *
+ * This library is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library; if not, write to the Free Software *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
+ * USA *
+ ***************************************************************************/
+
+using System.Collections;
+using System;
+
+namespace TagLib.Mpeg
+{
+#region Enums
+ public enum Version
+ {
+ Unknown = -1,
+ Version1 = 0, // MPEG Version 1
+ Version2 = 1, // MPEG Version 2
+ Version2_5 = 2 // MPEG Version 2.5
+ }
+
+ public enum ChannelMode
+ {
+ Stereo = 0, // Stereo
+ JointStereo = 1, // Stereo
+ DualChannel = 2, // Dual Mono
+ SingleChannel = 3 // Mono
+ };
+#endregion
+
+ public struct AudioHeader : IAudioCodec
+ {
+ #region Private Static Value Arrays
+ private static readonly int [,] sample_rates = new int [3,4] {
+ { 44100, 48000, 32000, 0 }, // Version 1
+ { 22050, 24000, 16000, 0 }, // Version 2
+ { 11025, 12000, 8000, 0 } // Version 2.5
+ };
+
+ private static readonly int [,] block_size = new int [3,4] {
+ { 0, 384, 1152, 1152 }, // Version 1
+ { 0, 384, 1152, 576 }, // Version 2
+ { 0, 384, 1152, 576 } // Version 2.5
+ };
+
+ private static readonly int [,,] bitrates = new int [2,3,16] {
+ { // Version 1
+ { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416,
448, -1 }, // layer 1
+ { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,
384, -1 }, // layer 2
+ { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256,
320, -1 } // layer 3
+ },
+ { // Version 2 or 2.5
+ { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224,
256, -1 }, // layer 1
+ { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144,
160, -1 }, // layer 2
+ { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144,
160, -1 } // layer 3
+ }
+ };
+ #endregion
+
+ #region Private Properties
+ private uint flags;
+ private long position;
+ private long stream_length;
+ private XingHeader xing_header;
+ #endregion
+
+ public static readonly AudioHeader Unknown = new AudioHeader
(0,0,0,XingHeader.Unknown);
+
+ #region Constructors
+ private AudioHeader (uint flags, long position, long stream_length,
XingHeader xing_header)
+ {
+ this.flags = flags;
+ this.position = position;
+ this.stream_length = stream_length;
+ this.xing_header = xing_header;
+ }
+
+ private AudioHeader (ByteVector data, TagLib.File file, long offset)
+ {
+ position = offset;
+ stream_length = 0;
+ if (data.Count < 4)
+ throw new CorruptFileException ("Insufficient header length.");
+
+ if (data [0] != 0xFF)
+ throw new CorruptFileException ("First byte did not match MPEG
synch.");
+
+ if (data [1] < 0xE0)
+ throw new CorruptFileException ("Second byte did not match MPEG
synch.");
+
+ flags = data.ToUInt ();
+ xing_header = XingHeader.Unknown;
+
+ if (AudioBitrate < 0)
+ throw new CorruptFileException ("Header uses invalid bitrate
index.");
+
+ if (AudioSampleRate == 0)
+ throw new CorruptFileException ("Invalid sample rate.");
+
+ try
+ {
+ // Check for a Xing header that will help us in gathering
+ // information about a VBR stream.
+ file.Seek (offset + XingHeader.XingHeaderOffset (Version,
ChannelMode));
+ xing_header = new XingHeader (file.ReadBlock (16));
+ }
+ catch
+ {
+ }
+ }
+#endregion
+
+#region Public Properties
+ public Version Version
+ {
+ get
+ {
+ switch ((flags >> 19) & 0x03)
+ {
+ case 0: return Version.Version2_5;
+ case 2: return Version.Version2;
+ default: return Version.Version1;
+ }
+ }
+ }
+
+ public int AudioLayer
+ {
+ get
+ {
+ switch ((flags >> 17) & 0x03)
+ {
+ case 1: return 3;
+ case 2: return 2;
+ default: return 1;
+ }
+ }
+ }
+
+ public int AudioBitrate
+ {
+ get
+ {
+ if (xing_header.TotalSize > 0)
+ return (int) (Duration > TimeSpan.Zero ? ((XingHeader.TotalSize
* 8L) / Duration.TotalSeconds) / 1000 : 0);
+
+ int version_index = Version == Version.Version1 ? 0 : 1;
+ int layer_index = AudioLayer > 0 ? AudioLayer - 1 : 0;
+ int bitrate_index = (int) (flags >> 12) & 0x0F;
+ return bitrates [version_index, layer_index, bitrate_index];
+ }
+ }
+
+ public int AudioSampleRate
+ {
+ get
+ {
+ return sample_rates [(int) Version, (int) (flags >> 10) & 0x03];
+ }
+ }
+
+ public int AudioFrameLength
+ {
+ get
+ {
+ // Calculate the frame length
+ switch (AudioLayer)
+ {
+ case 1: return (((12000 * AudioBitrate) / AudioSampleRate) +
(IsPadded ? 1 : 0))*4;
+ case 2: return (144000 * AudioBitrate) / AudioSampleRate +
(IsPadded ? 1 : 0);
+ case 3: return (((144000 * AudioBitrate) / AudioSampleRate) /
(Version == Version.Version1 ? 1 : 2)) + (IsPadded ? 1 : 0);
+ default: return 0;
+ }
+ }
+ }
+
+ public TimeSpan Duration
+ {
+ get
+ {
+ if (xing_header.TotalFrames > 0)
+ {
+ // Read the length and the bitrate from the Xing header.
+ double time_per_frame = (double) block_size [(int) Version,
AudioLayer] / (double) AudioSampleRate;
+ return TimeSpan.FromSeconds (time_per_frame *
XingHeader.TotalFrames);
+ }
+
+ if (AudioFrameLength > 0 && AudioBitrate > 0)
+ {
+ // Since there was no valid Xing header found, we hope that
we're
+ // in a constant bitrate file.
+ int frames = (int) ((stream_length - position) /
AudioFrameLength + 1);
+ return TimeSpan.FromSeconds ((double) (AudioFrameLength *
frames) / (double) (AudioBitrate * 125) + 0.5);
+ }
+
+ return TimeSpan.Zero;
+ }
+ }
+
+ public string Description
+ {
+ get
+ {
+ System.Text.StringBuilder builder = new System.Text.StringBuilder
();
+ builder.Append ("MPEG Version ");
+ switch (Version)
+ {
+ case Version.Version1: builder.Append ("1"); break;
+ case Version.Version2: builder.Append ("2"); break;
+ case Version.Version2_5: builder.Append ("2.5"); break;
+ }
+ builder.Append (" Audio, Layer ");
+ builder.Append (AudioLayer);
+
+ return builder.ToString ();
+ }
+ }
+
+ public bool IsProtected {get {return ((flags >>16) & 1) == 0;}}
+ public bool IsPadded {get {return ((flags >> 9) & 1) == 1;}}
+ public bool IsCopyrighted {get {return ((flags >> 3) & 1) == 1;}}
+ public bool IsOriginal {get {return ((flags >> 2) & 1) == 1;}}
+ public int AudioChannels {get {return ChannelMode ==
ChannelMode.SingleChannel ? 1 : 2;}}
+ public ChannelMode ChannelMode {get {return (ChannelMode) ((flags >>
14) & 0x03);}}
+ public MediaTypes MediaTypes {get {return MediaTypes.Audio;}}
+ public XingHeader XingHeader {get {return xing_header;}}
+#endregion
+
+#region Public Methods
+ public void SetStreamLength (long stream_length)
+ {
+ this.stream_length = stream_length;
+ }
+#endregion
+
+#region Public Static Methods
+ public static bool Find (out AudioHeader header, TagLib.File file, long
position, int length)
+ {
+ long end = position + length;
+
+ header = AudioHeader.Unknown;
+
+ file.Seek (position);
+ ByteVector buffer = file.ReadBlock (3);
+
+ if (buffer.Count < 3)
+ return false;
+
+ do
+ {
+ file.Seek (position + 3);
+ buffer = buffer.Mid (buffer.Count - 3);
+ buffer.Add (file.ReadBlock ((int) File.BufferSize));
+
+ for (int i = 0; i < buffer.Count - 3 && (length < 0 || position +
i < end); i++)
+ if (buffer [i] == 0xFF && buffer [i + 1] > 0xE0)
+ try
+ {
+ header = new AudioHeader (buffer.Mid (i, 4), file,
position + i);
+ return true;
+ } catch {}
+
+ position += File.BufferSize;
+ }
+ while (buffer.Count > 3 && (length < 0 || position < end));
+
+ return false;
+ }
+
+ public static bool Find (out AudioHeader header, TagLib.File file, long
position)
+ {
+ return Find (out header, file, position, -1);
+ }
+#endregion
+ }
+}
Modified: trunk/taglib-sharp/src/TagLib/TagLib.sources
===================================================================
--- trunk/taglib-sharp/src/TagLib/TagLib.sources 2007-05-25 19:09:47 UTC
(rev 77969)
+++ trunk/taglib-sharp/src/TagLib/TagLib.sources 2007-05-25 20:20:09 UTC
(rev 77970)
@@ -106,7 +106,6 @@
$(srcdir)/TagLib/ByteVectorList.cs \
$(srcdir)/TagLib/ByteVector.cs \
$(srcdir)/TagLib/CombinedTag.cs \
- $(srcdir)/TagLib/Debugger.cs \
$(srcdir)/TagLib/Genres.cs \
$(srcdir)/TagLib/Properties.cs \
$(srcdir)/TagLib/File.cs \
Modified: trunk/taglib-sharp/taglib-sharp.csproj
===================================================================
--- trunk/taglib-sharp/taglib-sharp.csproj 2007-05-25 19:09:47 UTC (rev
77969)
+++ trunk/taglib-sharp/taglib-sharp.csproj 2007-05-25 20:20:09 UTC (rev
77970)
@@ -45,7 +45,6 @@
<Compile Include="src\TagLib\ByteVector.cs" />
<Compile Include="src\TagLib\ByteVectorList.cs" />
<Compile Include="src\TagLib\CombinedTag.cs" />
- <Compile Include="src\TagLib\Debugger.cs" />
<Compile Include="src\TagLib\File.cs" />
<Compile Include="src\TagLib\IntList.cs" />
<Compile Include="src\TagLib\StringList.cs" />
@@ -146,18 +145,19 @@
<Compile Include="src\TagLib\Ogg\GroupedComment.cs" />
<Compile Include="src\TagLib\Ogg\Paginator.cs" />
<Compile Include="src\TagLib\Ogg\Codecs\Theora.cs" />
- <Compile Include="src\TagLib\Riff\File.cs" />
- <Compile Include="src\TagLib\Riff\DivXTag.cs" />
- <Compile Include="src\TagLib\Riff\ListTag.cs" />
- <Compile Include="src\TagLib\Riff\InfoTag.cs" />
- <Compile Include="src\TagLib\Genres.cs" />
- <Compile Include="src\TagLib\Riff\MovieIdTag.cs" />
- <Compile Include="src\TagLib\Riff\List.cs" />
- <Compile Include="src\TagLib\Riff\AviHeaderList.cs" />
- <Compile Include="src\TagLib\Riff\AviStream.cs" />
- <Compile Include="src\TagLib\Riff\WaveFormatEx.cs" />
- <Compile Include="src\TagLib\Riff\BitmapInfoHeader.cs" />
- <Compile Include="src\TagLib\ICodec.cs" />
+ <Compile Include="src\TagLib\Riff\File.cs" />
+ <Compile Include="src\TagLib\Riff\DivXTag.cs" />
+ <Compile Include="src\TagLib\Riff\ListTag.cs" />
+ <Compile Include="src\TagLib\Riff\InfoTag.cs" />
+ <Compile Include="src\TagLib\Genres.cs" />
+ <Compile Include="src\TagLib\Riff\MovieIdTag.cs" />
+ <Compile Include="src\TagLib\Riff\List.cs" />
+ <Compile Include="src\TagLib\Riff\AviHeaderList.cs" />
+ <Compile Include="src\TagLib\Riff\AviStream.cs" />
+ <Compile Include="src\TagLib\Riff\WaveFormatEx.cs" />
+ <Compile Include="src\TagLib\Riff\BitmapInfoHeader.cs" />
+ <Compile Include="src\TagLib\ICodec.cs" />
+ <Compile Include="src\TagLib\Id3v2\Frames\PlayCountFrame.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="src" />
@@ -178,4 +178,4 @@
<Content Include="taglib-sharp.snk" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
-</Project>
+</Project>
\ No newline at end of file
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches