? Util/entagged-sharp
Index: Filters/FilterApe.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterApe.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterApe.cs
--- Filters/FilterApe.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterApe.cs	8 Feb 2005 13:45:10 -0000
@@ -1,10 +1,7 @@
 //
 // FilterApe.cs : Register for reading of ape (Monkey audio) files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -29,7 +26,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Ape.Util;
 
 namespace Beagle.Filters {
 
@@ -44,6 +42,7 @@
 		
 		protected override void RegisterSupportedTypes ()
 		{
+			//FIXME: Does this really works ??
 			AddSupportedExtension (".ape");
 		}
 	}
Index: Filters/FilterFlac.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterFlac.cs,v
retrieving revision 1.2
diff -u -r1.2 FilterFlac.cs
--- Filters/FilterFlac.cs	10 Dec 2004 18:20:17 -0000	1.2
+++ Filters/FilterFlac.cs	8 Feb 2005 13:45:10 -0000
@@ -1,10 +1,7 @@
 //
 // FilterFlac.cs : Register for reading of flac files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 // Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,8 +25,8 @@
 
 using System;
 using System.IO;
-
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Flac.Util;
 
 namespace Beagle.Filters {
 
Index: Filters/FilterMp3.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterMp3.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterMp3.cs
--- Filters/FilterMp3.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterMp3.cs	8 Feb 2005 13:45:10 -0000
@@ -2,10 +2,7 @@
 // FilterMp3.cs : Register for reading of mp3 files, id3v2 is read, then missing
 //                 infos are filled with id3v1 values.
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -30,7 +27,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Mp3.Util;
 
 namespace Beagle.Filters {
 
@@ -42,10 +40,28 @@
 		
 		protected override Tag GetTag(Stream s)
 		{
-			Tag v2 = Id3v2Reader.Read ((FileStream)s);
-			Tag v1 = Id3v1Reader.Read ((FileStream)s);
+			//We will try to read both tags, then complete
+			//missing v2 fields from v1. if v2 does not
+			//exists, use v1, and vice versa.
+			
+			Tag v2 = null,v1 = null;
+			try {
+				v2 = Id3v2Reader.Read(s);
+			} catch(Exception e) {}
+			
+			try {
+				v1 = Id3v1Reader.Read(s);
+			} catch(Exception e) {}
+
+			if(v1 == null && v2 == null)
+				throw new Exception("There is no id3 (v1 or v2) tag in this file");
+			
+			if(v2 == null)
+				return v1;
+			
+			if(v1 != null)
+				v2.Merge( v1 );
 			
-			v2.Merge (v1);
 			return v2;
 		}
 		
Index: Filters/FilterMpc.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterMpc.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterMpc.cs
--- Filters/FilterMpc.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterMpc.cs	8 Feb 2005 13:45:10 -0000
@@ -1,10 +1,7 @@
 //
 // FilterMpc.cs : Register for reading of mpc (Musepack) files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -29,7 +26,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Ape.Util;
 
 namespace Beagle.Filters {
 
@@ -44,6 +42,7 @@
 		
 		protected override void RegisterSupportedTypes ()
 		{
+			//FIXME: Does this really works ??
 			AddSupportedExtension (".mpc");
 		}
 	}
Index: Filters/FilterMusic.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterMusic.cs,v
retrieving revision 1.9
diff -u -r1.9 FilterMusic.cs
--- Filters/FilterMusic.cs	22 Jan 2005 23:43:54 -0000	1.9
+++ Filters/FilterMusic.cs	8 Feb 2005 13:45:10 -0000
@@ -3,10 +3,7 @@
 //                  It will retreive the tag from the subclass, then fill the
 //                  beagle property as needed.
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -31,7 +28,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Generic;
 
 namespace Beagle.Filters {
 
@@ -61,35 +59,35 @@
 			
 			log.Debug ("{0}", tag);
 			
-			//FIXME: Do we need to check for non-null empty values ?
-			//This should be done in Beagle.Property.New I think..
-			
-			if (tag.Artist.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:artist",  tag.Artist));
-
-			if (tag.Album.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:album",   tag.Album));
-			
-			if (tag.Title.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:title",    tag.Title));
-
-			if (tag.Comment.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:comment", tag.Comment));
-
-			if (tag.Track.Length > 0)
-				AddProperty (Beagle.Property.NewKeyword ("fixme:tracknumber", tag.Track));
-
-			if (tag.Year.Length > 0)
-				AddProperty (Beagle.Property.NewKeyword ("fixme:year",  tag.Year));
-
-			if (tag.Genre.Length > 0)
-				AddProperty (Beagle.Property.NewKeyword ("fixme:genre", tag.Genre));
-			
-			/* TBA
-			if (info.HasPicture)
--                               AddProperty (Beagle.Property.NewBool ("fixme:haspicture", true));
-			*/
-			
+			//If there are no values for a given field, it will simply be ignored.
+			foreach(TagTextField field in tag.Artist)
+				AddProperty (Beagle.Property.New ("fixme:artist",  field.Content));
+
+			foreach(TagTextField field in tag.Album)
+				AddProperty (Beagle.Property.New ("fixme:album",  field.Content));
+			
+			foreach(TagTextField field in tag.Title)
+				AddProperty (Beagle.Property.New ("fixme:title",    field.Content));
+
+			foreach(TagTextField field in tag.Comment)
+				AddProperty (Beagle.Property.New ("fixme:comment", field.Content));
+
+			foreach(TagTextField field in tag.Track)
+				AddProperty (Beagle.Property.NewKeyword ("fixme:tracknumber", field.Content));
+
+			foreach(TagTextField field in tag.Year)
+				AddProperty (Beagle.Property.NewKeyword ("fixme:year",  field.Content));
+
+			foreach(TagTextField field in tag.Genre)
+				AddProperty (Beagle.Property.NewKeyword ("fixme:genre", field.Content));
+			
+			//Adds miscellaneous metadata for that file
+			//could really be anything that is text, should be used only 
+			//for indexing purpose...
+			foreach(TagField field in tag)
+				if(! field.IsCommon && field is TagTextField)
+					AddProperty (Beagle.Property.NewKeyword ("fixme:musicinfo", (field as TagTextField).Content));
+				
 			Finished ();
 		}
 	}
Index: Filters/FilterOgg.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterOgg.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterOgg.cs
--- Filters/FilterOgg.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterOgg.cs	8 Feb 2005 13:45:10 -0000
@@ -1,10 +1,7 @@
 //
 // FilterOgg.cs : Register for reading of ogg files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -29,7 +26,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Ogg.Util;
 
 namespace Beagle.Filters {
 
Index: Util/Makefile.am
===================================================================
RCS file: /cvs/gnome/beagle/Util/Makefile.am,v
retrieving revision 1.42
diff -u -r1.42 Makefile.am
--- Util/Makefile.am	27 Jan 2005 20:24:06 -0000	1.42
+++ Util/Makefile.am	8 Feb 2005 13:45:11 -0000
@@ -10,7 +10,40 @@
 
 $(GOOGLE_CS): $(GOOGLE_WSDL)
 	wsdl -namespace:Beagle.Util -out:$@ $^
+	
+AUDIOFORMATS_CSFILES =   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagBinaryField.cs   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagField.cs   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagTextField.cs   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagReader.cs   \
+	$(srcdir)/entagged-sharp/ape/ApeTag.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v2TagSynchronizer.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v23TagReader.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/Id3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/TextId3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/CommId3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/GenericId3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v1TagReader.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v2TagReader.cs   \
+	$(srcdir)/entagged-sharp/mp3/Id3v1Tag.cs   \
+	$(srcdir)/entagged-sharp/mp3/Id3v2Tag.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/OggTagField.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/VorbisTagReader.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/OggPageHeader.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/OggTagReader.cs   \
+	$(srcdir)/entagged-sharp/ogg/OggTag.cs   \
+	$(srcdir)/entagged-sharp/flac/util/FlacTagReader.cs   \
+	$(srcdir)/entagged-sharp/flac/util/MetadataBlockHeader.cs   \
+	$(srcdir)/entagged-sharp/Tag.cs   \
+	$(srcdir)/entagged-sharp/generic/TagTextField.cs   \
+	$(srcdir)/entagged-sharp/generic/AbstractTag.cs   \
+	$(srcdir)/entagged-sharp/generic/Utils.cs   \
+	$(srcdir)/entagged-sharp/generic/GenericTag.cs   \
+	$(srcdir)/entagged-sharp/generic/ByteBuffer.cs   \
+	$(srcdir)/entagged-sharp/generic/TagField.cs   \
+	$(srcdir)/entagged-sharp/exceptions/CannotReadException.cs
 
+	
 CSFILES = 			        	\
 	$(srcdir)/camel.cs              	\
 	$(srcdir)/FileAdvise.cs			\
@@ -44,13 +77,10 @@
 	$(srcdir)/Vfs.cs                        \
 	$(srcdir)/XKeybinder.cs
 
+
 if ! ENABLE_GST_SHARP
 CSFILES +=					\
-	$(srcdir)/ApeReader.cs			\
-	$(srcdir)/Mp3Reader.cs			\
-	$(srcdir)/FlacReader.cs			\
-	$(srcdir)/OggReader.cs			\
-	$(srcdir)/Tag.cs			
+	$(AUDIOFORMATS_CSFILES)
 endif
 
 ASSEMBLIES =					\
