Author: bnickel
Date: 2007-05-10 17:51:32 -0400 (Thu, 10 May 2007)
New Revision: 77167
Removed:
trunk/taglib-sharp/src/TagLib/Asf/Properties.cs
trunk/taglib-sharp/src/TagLib/Mpeg/Properties.cs
trunk/taglib-sharp/src/TagLib/Mpeg4/Properties.cs
trunk/taglib-sharp/src/TagLib/Ogg/Flac/
trunk/taglib-sharp/src/TagLib/Ogg/Properties.cs
trunk/taglib-sharp/src/TagLib/Ogg/Vorbis/
Modified:
trunk/taglib-sharp/ChangeLog
Log:
2007-05-10 Brian Nickel <[EMAIL PROTECTED]>
* src/TagLib/Mpeg/Properties.cs:
* src/TagLib/Asf/Properties.cs:
* src/TagLib/Ogg/Properties.cs:
* src/TagLib/Ogg/Vorbis/File.cs:
* src/TagLib/Ogg/Flac/File.cs:
* src/TagLib/Mpeg4/Properties.cs: Deleted. I thought MonoDevelop did
this automatically. My bad.
Modified: trunk/taglib-sharp/ChangeLog
===================================================================
--- trunk/taglib-sharp/ChangeLog 2007-05-10 21:48:16 UTC (rev 77166)
+++ trunk/taglib-sharp/ChangeLog 2007-05-10 21:51:32 UTC (rev 77167)
@@ -1,3 +1,13 @@
+2007-05-10 Brian Nickel <[EMAIL PROTECTED]>
+
+ * src/TagLib/Mpeg/Properties.cs:
+ * src/TagLib/Asf/Properties.cs:
+ * src/TagLib/Ogg/Properties.cs:
+ * src/TagLib/Ogg/Vorbis/File.cs:
+ * src/TagLib/Ogg/Flac/File.cs:
+ * src/TagLib/Mpeg4/Properties.cs: Deleted. I thought MonoDevelop did
+ this automatically. My bad.
+
2007-05-09 Brian Nickel <[EMAIL PROTECTED]>
* src/TagLib/Mpeg/AudioFile.cs: Throw a proper CorruptFileException if
Deleted: trunk/taglib-sharp/src/TagLib/Asf/Properties.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Asf/Properties.cs 2007-05-10 21:48:16 UTC
(rev 77166)
+++ trunk/taglib-sharp/src/TagLib/Asf/Properties.cs 2007-05-10 21:51:32 UTC
(rev 77167)
@@ -1,106 +0,0 @@
-/***************************************************************************
- copyright : (C) 2005 by Brian Nickel
- email : [EMAIL PROTECTED]
- based on : mpcproperties.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;
-
-namespace TagLib.Asf
-{
- public class Properties : TagLib.Properties
- {
-
//////////////////////////////////////////////////////////////////////////
- // private properties
-
//////////////////////////////////////////////////////////////////////////
- private TimeSpan duration;
- private uint width;
- private uint height;
- private short codec_id;
- private short channels;
- private uint sample_rate;
- private uint bytes_per_second;
- private short bits_per_pixel;
- private MediaTypes types;
-
-
//////////////////////////////////////////////////////////////////////////
- // public methods
-
//////////////////////////////////////////////////////////////////////////
- public Properties (HeaderObject header, ReadStyle style) : base (style)
- {
- duration = TimeSpan.Zero;
- width = 0;
- height = 0;
- codec_id = 0;
- channels = 0;
- sample_rate = 0;
- bytes_per_second = 0;
- bits_per_pixel = 0;
- types = MediaTypes.Unknown;
-
- foreach (Object obj in header.Children)
- {
- if (obj is FilePropertiesObject)
- duration = ((FilePropertiesObject) obj).PlayDuration;
-
- if (obj is StreamPropertiesObject)
- {
- StreamPropertiesObject stream = obj as StreamPropertiesObject;
-
- if (bytes_per_second == 0 && stream.StreamType.Equals
(Guid.AsfAudioMedia))
- {
- types |= MediaTypes.Audio;
- ByteVector data = stream.TypeSpecificData;
- codec_id = data.Mid (0, 2).ToShort (false);
- channels = data.Mid (2, 2).ToShort (false);
- sample_rate = data.Mid (4, 4).ToUInt (false);
- bytes_per_second = data.Mid (8, 4).ToUInt (false);
- }
- else if (width == 0 && height == 0 && stream.StreamType.Equals
(Guid.AsfVideoMedia))
- {
- types |= MediaTypes.Video;
- ByteVector data = stream.TypeSpecificData;
- width = data.Mid (0, 4).ToUInt (false);
- height = data.Mid (4, 4).ToUInt (false);
- bits_per_pixel = data.Mid (25, 2).ToShort (false);
- }
- }
- }
- }
-
- public Properties (HeaderObject header) : this (header,
ReadStyle.Average)
- {
- }
-
-
-
//////////////////////////////////////////////////////////////////////////
- // public properties
-
//////////////////////////////////////////////////////////////////////////
- public override TimeSpan Duration {get {return duration;}}
- public override int AudioBitrate {get {return (int)
(bytes_per_second * 8 / 1000);}}
- public override int AudioSampleRate {get {return (int)
sample_rate;}}
- public override int AudioChannels {get {return channels;}}
- public override int VideoWidth {get {return (int) width;}}
- public override int VideoHeight {get {return (int) height;}}
- public override MediaTypes MediaTypes {get {return types;}}
-
- public short CodecId {get {return codec_id;}}
- public short BitsPerPixel {get {return bits_per_pixel;}}
- }
-}
Deleted: trunk/taglib-sharp/src/TagLib/Mpeg/Properties.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Mpeg/Properties.cs 2007-05-10 21:48:16 UTC
(rev 77166)
+++ trunk/taglib-sharp/src/TagLib/Mpeg/Properties.cs 2007-05-10 21:51:32 UTC
(rev 77167)
@@ -1,118 +0,0 @@
-/***************************************************************************
- copyright : (C) 2005 by Brian Nickel
- email : [EMAIL PROTECTED]
- based on : mpegproperties.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
-{
- public class Properties : TagLib.Properties
- {
- private Version version;
- private VideoHeader video_header;
- private AudioHeader audio_header;
- private TimeSpan duration;
- private long length;
-
- public Properties (Version version, VideoHeader video_header,
AudioHeader audio_header, double duration, long length, ReadStyle style) : base
(style)
- {
- this.version = version;
- this.video_header = video_header;
- this.audio_header = audio_header;
- this.duration = TimeSpan.FromSeconds (duration);
- this.length = length;
- }
-
- public override TimeSpan Duration
- {
- get
- {
- if (duration <= TimeSpan.Zero && audio_header != null)
- {
- if (audio_header.XingHeader != null)
- {
- // Read the length and the bitrate from the Xing header.
-
- 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
- };
-
- double time_per_frame = (double) block_size [(int)
audio_header.Version, audio_header.Layer] / (double) audio_header.SampleRate;
- duration = TimeSpan.FromSeconds (time_per_frame *
audio_header.XingHeader.TotalFrames);
- }
- else if (audio_header.FrameLength > 0 && audio_header.Bitrate >
0)
- {
- // Since there was no valid Xing header found, we hope that
we're
- // in a constant bitrate file.
- int frames = (int) ((length - audio_header.Position) /
audio_header.FrameLength + 1);
- duration = TimeSpan.FromSeconds ((double)
(audio_header.FrameLength * frames) / (double) (audio_header.Bitrate * 125) +
0.5);
- }
- }
-
- return duration;
- }
- }
-
- public override int AudioBitrate
- {
- get
- {
- if (audio_header == null)
- return 0;
-
- if (audio_header.XingHeader != null)
- return (int) (Duration > TimeSpan.Zero ?
((audio_header.XingHeader.TotalSize * 8L) / Duration.TotalSeconds) / 1000 : 0);
-
-
- return audio_header.Bitrate;
- }
- }
- public override int AudioSampleRate {get {return audio_header
== null ? 0 : audio_header.SampleRate;}}
- public override int AudioChannels {get {return audio_header
== null ? 0 : (audio_header.ChannelMode == ChannelMode.SingleChannel ? 1 : 2);}}
- public int AudioLayer {get {return audio_header
== null ? 0 : audio_header.Layer;}}
- public ChannelMode AudioChannelMode {get {return audio_header
== null ? 0 : audio_header.ChannelMode;}}
- public bool AudioIsCopyrighted {get {return audio_header
== null ? false : audio_header.IsCopyrighted;}}
- public bool AudioIsOriginal {get {return audio_header
== null ? false : audio_header.IsOriginal;}}
-
- public override int VideoWidth {get {return video_header
== null ? 0 : video_header.Width;}}
- public override int VideoHeight {get {return video_header
== null ? 0 : video_header.Height;}}
- public int VideoBitrate {get {return video_header
== null ? 0 : video_header.Bitrate;}}
- public double VideoFrameRate {get {return video_header
== null ? 0 : video_header.FrameRate;}}
-
- public Version Version {get {return version;}}
- public override MediaTypes MediaTypes
- {
- get
- {
- MediaTypes types = MediaTypes.Unknown;
- if (audio_header != null)
- types |= MediaTypes.Audio;
- if (video_header != null)
- types |= MediaTypes.Video;
-
- return types;
- }
- }
- }
-}
Deleted: trunk/taglib-sharp/src/TagLib/Mpeg4/Properties.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Mpeg4/Properties.cs 2007-05-10 21:48:16 UTC
(rev 77166)
+++ trunk/taglib-sharp/src/TagLib/Mpeg4/Properties.cs 2007-05-10 21:51:32 UTC
(rev 77167)
@@ -1,69 +0,0 @@
-/***************************************************************************
- copyright : (C) 2006 by Brian Nickel
- email : [EMAIL PROTECTED]
- ***************************************************************************/
-
-/***************************************************************************
- * 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.Mpeg4
-{
- public class Properties : TagLib.Properties
- {
-
//////////////////////////////////////////////////////////////////////////
- // private properties
-
//////////////////////////////////////////////////////////////////////////
- private IsoMovieHeaderBox mvhd_box;
- private IsoAudioSampleEntry audio_sample_entry;
- private IsoVisualSampleEntry visual_sample_entry;
-
-
//////////////////////////////////////////////////////////////////////////
- // public methods
-
//////////////////////////////////////////////////////////////////////////
- public Properties (IsoMovieHeaderBox mvhd_box, IsoAudioSampleEntry
audio_sample_entry, IsoVisualSampleEntry visual_sample_entry, ReadStyle style)
: base (style)
- {
- this.mvhd_box = mvhd_box;
- this.audio_sample_entry = audio_sample_entry;
- this.visual_sample_entry = visual_sample_entry;
- }
-
-
-
//////////////////////////////////////////////////////////////////////////
- // public properties
-
//////////////////////////////////////////////////////////////////////////
-
-
- public override MediaTypes MediaTypes
- {
- get
- {
- MediaTypes types = MediaTypes.Unknown;
- if (audio_sample_entry != null)
- types |= MediaTypes.Audio;
- if (visual_sample_entry != null)
- types |= MediaTypes.Video;
- return types;
- }
- }
-
- // All additional special info from the Movie Header.
- public double Rate {get {return mvhd_box == null ? 1.0 :
mvhd_box.Rate;}}
- public double Volume {get {return mvhd_box == null ? 1.0 :
mvhd_box.Volume;}}
- }
-}
Deleted: trunk/taglib-sharp/src/TagLib/Ogg/Properties.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Ogg/Properties.cs 2007-05-10 21:48:16 UTC
(rev 77166)
+++ trunk/taglib-sharp/src/TagLib/Ogg/Properties.cs 2007-05-10 21:51:32 UTC
(rev 77167)
@@ -1,77 +0,0 @@
-/***************************************************************************
- copyright : (C) 2006 by Brian Nickel
- email : [EMAIL PROTECTED]
- based on : audioproperties.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.Generic;
-using System;
-
-namespace TagLib.Ogg
-{
- public class Properties : TagLib.Properties
- {
-
//////////////////////////////////////////////////////////////////////////
- // private properties
-
//////////////////////////////////////////////////////////////////////////
- private TimeSpan duration;
- private int bitrate, sample_rate, channels, width, height;
- private MediaTypes types;
-
-
//////////////////////////////////////////////////////////////////////////
- // public methods
-
//////////////////////////////////////////////////////////////////////////
- public Properties (Dictionary<uint,Bitstream> streams, PageHeader
last_header, ReadStyle style) : base (style)
- {
- bitrate = sample_rate = channels = width = height = 0;
- types = MediaTypes.Unknown;
-
- foreach (Bitstream stream in streams.Values)
- {
- types |= stream.Codec.MediaTypes;
-
- if ((stream.Codec.MediaTypes & MediaTypes.Audio) !=
MediaTypes.Unknown)
- {
- bitrate = stream.Codec.AudioBitrate;
- sample_rate = stream.Codec.AudioSampleRate;
- channels = stream.Codec.AudioChannels;
- }
-
- if ((stream.Codec.MediaTypes & MediaTypes.Video) !=
MediaTypes.Unknown)
- {
- width = stream.Codec.VideoWidth;
- height = stream.Codec.VideoHeight;
- }
- }
-
- }
-
-
//////////////////////////////////////////////////////////////////////////
- // public properties
-
//////////////////////////////////////////////////////////////////////////
- public override TimeSpan Duration {get {return duration;}}
- public override int AudioBitrate {get {return bitrate;}}
- public override int AudioSampleRate {get {return sample_rate;}}
- public override int AudioChannels {get {return channels;}}
- public override int VideoWidth {get {return width;}}
- public override int VideoHeight {get {return height;}}
- public override MediaTypes MediaTypes {get {return types;}}
-
- }
-}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches