? cclicenselib
? data/images/cc-attribution.png
? data/images/cc-no-derivs.png
? data/images/cc-noncommercial.png
? data/images/cc-public-domain.png
? data/images/cc-share-alike.png
? src/LicenseRenderer.cs
? src/Banshee.Base/Base32.cs
? src/Banshee.Base/CreativeCommons.cs
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/banshee/src/Makefile.am,v
retrieving revision 1.98
diff -u -p -r1.98 Makefile.am
--- src/Makefile.am	21 Jun 2006 17:51:33 -0000	1.98
+++ src/Makefile.am	15 Jul 2006 21:00:35 -0000
@@ -48,6 +48,7 @@ banshee_sources = \
 	IPlaybackModel.cs \
 	RemotePlayer.cs \
 	RatingRenderer.cs \
+	LicenseRenderer.cs \
 	ExceptionDialog.cs \
 	VersionInformationDialog.cs \
 	LogCoreViewer.cs \
@@ -103,6 +104,11 @@ banshee_resources = \
 	data/images/cd-action-burn-24.png \
 	data/images/cd-action-burn-32.png \
 	data/images/cd-action-burn-48.png \
+	data/images/cc-attribution.png \
+	data/images/cc-no-derivs.png \
+	data/images/cc-noncommercial.png \
+	data/images/cc-public-domain.png \
+	data/images/cc-share-alike.png \
 	data/images/encode-action-24.png
 
 banshee_resources_build = $(foreach res,$(banshee_resources), $(addprefix -resource:,$(srcdir)/../$(res)),$(notdir $(res)))
Index: src/PlaylistView.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/PlaylistView.cs,v
retrieving revision 1.53
diff -u -p -r1.53 PlaylistView.cs
--- src/PlaylistView.cs	12 Jul 2006 21:12:16 -0000	1.53
+++ src/PlaylistView.cs	15 Jul 2006 21:00:36 -0000
@@ -62,7 +62,8 @@ namespace Banshee
             Time,
             Rating,
             PlayCount,
-            LastPlayed
+            LastPlayed,
+            License
         };
             
         private ArrayList columns;
@@ -77,6 +78,7 @@ namespace Banshee
         public PlaylistColumn RatingColumn;
         public PlaylistColumn PlaysColumn;
         public PlaylistColumn LastPlayedColumn;
+        public PlaylistColumn LicenseColumn;
         
         private class ColumnSorter : IComparer
         {
@@ -115,7 +117,8 @@ namespace Banshee
             
             RatingColumn = new PlaylistColumn(this, 
                 Catalog.GetString("Rating"), "Rating",
-                new TreeCellDataFunc(TrackCellRating), new RatingRenderer(),
+                new TreeCellDataFunc(TrackCellRating),
+                new RatingRenderer(),
                 7, (int)ColumnId.Rating);
             columns.Add(RatingColumn);
             
@@ -132,6 +135,13 @@ namespace Banshee
                 new CellRendererText(),
                 9, (int)ColumnId.LastPlayed);
             columns.Add(LastPlayedColumn);
+        	
+        	LicenseColumn = new PlaylistColumn(this, 
+                Catalog.GetString("License"), "License",
+                new TreeCellDataFunc(TrackCellLicense),
+                new LicenseRenderer(),
+                10, (int)ColumnId.License);
+            columns.Add(LicenseColumn);
             
             columns.Sort(new ColumnSorter());
             
@@ -190,7 +200,7 @@ namespace Banshee
             Selection.Mode = SelectionMode.Multiple;
             
             model.SetSortFunc((int)ColumnId.Track, 
-                    new TreeIterCompareFunc(TrackTreeIterCompareFunc));
+                new TreeIterCompareFunc(TrackTreeIterCompareFunc));
             model.SetSortFunc((int)ColumnId.Artist, 
                 new TreeIterCompareFunc(ArtistTreeIterCompareFunc));
             model.SetSortFunc((int)ColumnId.Title, 
@@ -209,6 +219,8 @@ namespace Banshee
                 new TreeIterCompareFunc(PlayCountTreeIterCompareFunc));
             model.SetSortFunc((int)ColumnId.LastPlayed, 
                 new TreeIterCompareFunc(LastPlayedTreeIterCompareFunc));
+            model.SetSortFunc((int)ColumnId.License, 
+                new TreeIterCompareFunc(LicenseTreeIterCompareFunc));
         }    
 
         private void OnRipToggled(object o, ToggledArgs args)
@@ -290,6 +302,13 @@ namespace Banshee
             return StringFieldCompare(model.IterTrackInfo(a).Genre, 
                 model.IterTrackInfo(b).Genre);
         }
+                
+        public int LicenseTreeIterCompareFunc(TreeModel _model, TreeIter a, 
+            TreeIter b)
+        {
+            return LongFieldCompare(model.IterTrackInfo(a).License, 
+                model.IterTrackInfo(b).License);
+        }  
         
         public int YearTreeIterCompareFunc(TreeModel _model, TreeIter a,
             TreeIter b)
@@ -430,7 +449,7 @@ namespace Banshee
                 toggle.Active = false;
             }
         }
-        
+
         protected void TrackCellTrack(TreeViewColumn tree_column,
             CellRenderer cell, TreeModel tree_model, TreeIter iter)
         {
@@ -482,10 +501,21 @@ namespace Banshee
             if(ti == null) {
                 return;
             }
-            
+
             SetRendererAttributes((CellRendererText)cell, ti.Genre, iter);
         }
-        
+
+        protected void TrackCellLicense(TreeViewColumn tree_column,
+            CellRenderer cell, TreeModel tree_model, TreeIter iter)
+        {
+            TrackInfo ti = model.IterTrackInfo(iter);
+            if(ti == null) {
+                return;
+            }
+            
+            ((LicenseRenderer)cell).Track = ti;
+        }
+
         protected void TrackCellYear(TreeViewColumn tree_column,
             CellRenderer cell, TreeModel tree_model, TreeIter iter)
         {
@@ -549,10 +579,10 @@ namespace Banshee
             if(lastPlayed > DateTime.MinValue) {
                 disp = lastPlayed.ToString();
             }
-            
+
             SetRendererAttributes((CellRendererText)cell, String.Format("{0}", disp), iter);
         }
-        
+
         public void PlayPath(TreePath path)
         {
             model.PlayPath(path);
Index: src/Banshee.Base/Database.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Base/Database.cs,v
retrieving revision 1.7
diff -u -p -r1.7 Database.cs
--- src/Banshee.Base/Database.cs	22 May 2006 17:01:49 -0000	1.7
+++ src/Banshee.Base/Database.cs	15 Jul 2006 21:00:36 -0000
@@ -58,6 +58,12 @@ namespace Banshee.Base
                    	Label TEXT,
                    	Title TEXT,
                    	Genre TEXT,
+                   	
+                   	License TEXT,
+                   	Copyright TEXT,
+                   	LicenseURI TEXT,
+                   	MetadataURI TEXT,
+                   	
                    	Year INTEGER,
                    	
                    	TrackNumber INTEGER,
@@ -127,6 +133,34 @@ namespace Banshee.Base
             } catch(ApplicationException) {
                 LogCore.Instance.PushDebug("Adding new database column", "ViewOrder INTEGER");
                 Execute("ALTER TABLE PlaylistEntries ADD ViewOrder INTEGER NOT NULL DEFAULT 0");
+            }
+            
+            try {
+                QuerySingle("SELECT License FROM Tracks LIMIT 1");
+            } catch(ApplicationException) {
+                LogCore.Instance.PushDebug("Adding new database column", "License TEXT");
+                Execute("ALTER TABLE Tracks ADD License TEXT");
+            }
+  
+            try {
+                QuerySingle("SELECT Copyright FROM Tracks LIMIT 1");
+            } catch(ApplicationException) {
+                LogCore.Instance.PushDebug("Adding new database column", "Copyright TEXT");
+                Execute("ALTER TABLE Tracks ADD Copyright TEXT");
+            }
+  
+            try {
+                QuerySingle("SELECT LicenseURI FROM Tracks LIMIT 1");
+            } catch(ApplicationException) {
+                LogCore.Instance.PushDebug("Adding new database column", "LicenseURI TEXT");
+                Execute("ALTER TABLE Tracks ADD LicenseURI TEXT");
+            }
+
+            try {
+                QuerySingle("SELECT MetadataURI FROM Tracks LIMIT 1");
+            } catch(ApplicationException) {
+                LogCore.Instance.PushDebug("Adding new database column", "MetadataURI TEXT");
+                Execute("ALTER TABLE Tracks ADD MetadataURI TEXT");
             }
         }
     }
Index: src/Banshee.Base/LibraryTrackInfo.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Base/LibraryTrackInfo.cs,v
retrieving revision 1.12
diff -u -p -r1.12 LibraryTrackInfo.cs
--- src/Banshee.Base/LibraryTrackInfo.cs	14 May 2006 03:22:46 -0000	1.12
+++ src/Banshee.Base/LibraryTrackInfo.cs	15 Jul 2006 21:00:37 -0000
@@ -302,6 +302,10 @@ namespace Banshee.Base
                     "Label", label,
                     "Title", title, 
                     "Genre", genre, 
+                    "License", license,
+                    "Copyright", copyright,
+                    "LicenseURI", license_uri,
+                    "MetadataURI", metadata_uri,
                     "Year", year,
                     "DateAddedStamp", DateTimeUtil.FromDateTime(date_added), 
                     "TrackNumber", track_number, 
@@ -326,6 +330,10 @@ namespace Banshee.Base
                     "Label", label,
                     "Title", title, 
                     "Genre", genre, 
+                    "License", license,
+                    "Copyright", copyright,
+                    "LicenseURI", license_uri,
+                    "MetadataURI", metadata_uri,
                     "Year", year,
                     "DateAddedStamp", DateTimeUtil.FromDateTime(date_added), 
                     "TrackNumber", track_number, 
@@ -393,6 +401,12 @@ namespace Banshee.Base
             performer = reader["Performer"] as string;
             title = reader["Title"] as string;
             genre = reader["Genre"] as string;
+            
+            license = reader["License"] as string;
+            copyright = reader["Copyright"] as string;
+            license_uri = reader["LicenseURI"] as string;
+            metadata_uri = reader["MetadataURI"] as string;
+            
             asin = reader["ASIN"] as string;
             
             if(genre == "Unknown") {
Index: src/Banshee.Base/Makefile.am
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Base/Makefile.am,v
retrieving revision 1.39
diff -u -p -r1.39 Makefile.am
--- src/Banshee.Base/Makefile.am	6 Jul 2006 18:19:58 -0000	1.39
+++ src/Banshee.Base/Makefile.am	15 Jul 2006 21:00:37 -0000
@@ -159,11 +159,13 @@ ASSEMBLY_SOURCES = \
 	$(srcdir)/Catalog.cs \
 	$(srcdir)/Branding.cs \
 	$(srcdir)/BansheeBranding.cs \
+	$(srcdir)/CreativeCommons.cs \
+	$(srcdir)/Base32.cs \
 	$(srcdir)/ComponentInitializer.cs \
 	$(srcdir)/PowerManagement.cs 
 
 $(ASSEMBLY): $(ASSEMBLY_SOURCES) $(srcdir)/../../data/UIManagerLayout.xml
-	$(MCS) $(MCS_FLAGS) -target:library -r:System.Data -r:Mono.Data.SqliteClient -r:$(top_builddir)/entagged-sharp/entagged-sharp.dll -r:$(top_builddir)/src/Banshee.Widgets/Banshee.Widgets.dll -r:$(top_builddir)/burn-sharp/burn-sharp.dll -r:$(top_builddir)/src/MusicBrainz/MusicBrainz.dll -r:$(top_builddir)/hal-sharp/hal-sharp.dll $(GTKSHARP_LIBS) $(DBUSSHARP_LIBS) -r:Mono.Posix $(DAAPSHARP_LIBS) -resource:$(srcdir)/../../data/UIManagerLayout.xml,UIManagerLayout.xml -resource:$(srcdir)/../../data/images/splash.png,splash.png -out:$@ $(ASSEMBLY_SOURCES) $(bansheebase_generated_sources)
+	$(MCS) $(MCS_FLAGS) -target:library -r:System.Data -r:Mono.Data.SqliteClient -r:$(top_builddir)/entagged-sharp/entagged-sharp.dll -r:$(top_builddir)/cclicenselib/CCLicenseLib.dll -r:$(top_builddir)/src/Banshee.Widgets/Banshee.Widgets.dll -r:$(top_builddir)/burn-sharp/burn-sharp.dll -r:$(top_builddir)/src/MusicBrainz/MusicBrainz.dll -r:$(top_builddir)/hal-sharp/hal-sharp.dll $(GTKSHARP_LIBS) $(DBUSSHARP_LIBS) -r:Mono.Posix $(DAAPSHARP_LIBS) -resource:$(srcdir)/../../data/UIManagerLayout.xml,UIManagerLayout.xml -resource:$(srcdir)/../../data/images/splash.png,splash.png -out:$@ $(ASSEMBLY_SOURCES) $(bansheebase_generated_sources)
 
 EXTRA_DIST = $(ASSEMBLY_SOURCES) $(bansheebase_sources_in) $(ASSEMBLY).config.in 
 CLEANFILES = $(ASSEMBLY) *.dll *.exe
Index: src/Banshee.Base/StreamTagger.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Base/StreamTagger.cs,v
retrieving revision 1.2
diff -u -p -r1.2 StreamTagger.cs
--- src/Banshee.Base/StreamTagger.cs	14 May 2006 03:22:46 -0000	1.2
+++ src/Banshee.Base/StreamTagger.cs	15 Jul 2006 21:00:37 -0000
@@ -66,6 +66,10 @@ namespace Banshee.Base
                     case CommonTags.Genre:
                         track.Genre = Choose((string)tag.Value, track.Genre);
                         break;
+                    case CommonTags.Copyright:
+                        track.Copyright = Choose((string)tag.Value, track.Copyright);
+                        CreativeCommons.VerifyLicense(track);
+                        break;
                     case CommonTags.TrackNumber:
                         uint track_number = (uint)tag.Value;
                         track.TrackNumber = track_number == 0 ? track.TrackNumber : track_number;
@@ -83,6 +87,10 @@ namespace Banshee.Base
                     case CommonTags.StreamType:
                         track.MimeType = (string)tag.Value;
                         break;
+                    /* default:
+                    	Console.WriteLine("=== TAG UNMERGED ===");
+                    	Console.WriteLine(tag.ToString());
+                    	break; */
                 }
             } catch {
             }
Index: src/Banshee.Base/TrackInfo.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Base/TrackInfo.cs,v
retrieving revision 1.14
diff -u -p -r1.14 TrackInfo.cs
--- src/Banshee.Base/TrackInfo.cs	6 Jul 2006 19:32:34 -0000	1.14
+++ src/Banshee.Base/TrackInfo.cs	15 Jul 2006 21:00:37 -0000
@@ -58,6 +58,11 @@ namespace Banshee.Base
         protected string genre;
         protected string performer;
 
+        protected string license;       // License name; Empty if unverified
+        protected string copyright;     // License and Verification URIs (TCOP)
+        protected string license_uri;   // License URI (WCOP)
+        protected string metadata_uri;  // Metadata verification URI (WOAF)
+
         protected string asin;
         protected string label;
 
@@ -255,6 +260,50 @@ namespace Banshee.Base
                 genre = value; 
                 WriteUpdate(); 
             } 
+        }
+
+        public string License {
+            get {
+                return license;
+            }
+
+            set {
+                license = value;
+                WriteUpdate();
+            }
+        }
+
+        public string Copyright { 
+            get { 
+                return copyright;
+            }
+
+            set { 
+                copyright = value; 
+                WriteUpdate();
+            } 
+        }
+
+        public string LicenseUri { 
+            get { 
+                return license_uri;
+            }
+
+            set { 
+                license_uri = value; 
+                WriteUpdate();
+            } 
+        }
+
+        public string MetadataUri {
+            get {
+                return metadata_uri;
+            }
+
+            set {
+                metadata_uri = value;
+                WriteUpdate();
+            }
         }
 
         [BansheeTodo("Completely unused, should we even have this?")]
