Author: jwilcox
Date: 2007-10-11 19:40:59 -0400 (Thu, 11 Oct 2007)
New Revision: 87364

Modified:
   trunk/ipod-sharp/src/TrackDatabase.cs
Log:
make the cute little right-side artwork slide show work
on the newer ipods


Modified: trunk/ipod-sharp/src/TrackDatabase.cs
===================================================================
--- trunk/ipod-sharp/src/TrackDatabase.cs       2007-10-11 22:01:23 UTC (rev 
87363)
+++ trunk/ipod-sharp/src/TrackDatabase.cs       2007-10-11 23:40:59 UTC (rev 
87364)
@@ -1059,6 +1059,7 @@
         public int GaplessData;
         public bool GaplessTrackFlag;
         public bool GaplessAlbumFlag;
+        public int RightSideArtworkId;
 
         public ReadOnlyCollection<DetailRecord> Details
         {
@@ -1312,6 +1313,8 @@
                 writer.Write (0);
                 writer.Write (GaplessTrackFlag ? (short) 0 : (short) 1);
                 writer.Write (GaplessAlbumFlag ? (short) 0 : (short) 1);
+                writer.Write (new byte[92]); // more random unknown stuff
+                writer.Write (RightSideArtworkId);
             }
 
             writer.Flush();
@@ -1864,6 +1867,8 @@
             }
         }
 
+        
+
         public override void Save(DatabaseRecord db, BinaryWriter writer)
         {
             ReassignTrackIds();
@@ -2485,9 +2490,23 @@
             }
         }
 
+        private void AssignRightSideArtwork ()
+        {
+            if (artdb == null)
+                return;
+            
+            foreach (TrackRecord track in 
dbrec[DataSetIndex.Library].TrackList.Tracks) {
+                Photo photo = artdb.LookupPhotoByTrackId (track.DatabaseId);
+                if (photo != null) {
+                    track.RightSideArtworkId = photo.Id;
+                }
+            }
+        }
+
         public void Save()
         {
             CheckFreeSpace();
+            AssignRightSideArtwork ();
 
             // make sure all the new tracks have file names, and that they 
exist
             foreach (Track track in tracksToAdd)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to