Author: jwilcox
Date: 2007-03-29 15:55:16 -0500 (Thu, 29 Mar 2007)
New Revision: 75173

Modified:
   trunk/ipod-sharp/ChangeLog
   trunk/ipod-sharp/src/TrackDatabase.cs
Log:
2007-03-29  James Willcox  <[EMAIL PROTECTED]>

        * src/TrackDatabase.cs: oops, there are some new mhod types in the
        album list data.  This adds them.



Modified: trunk/ipod-sharp/ChangeLog
===================================================================
--- trunk/ipod-sharp/ChangeLog  2007-03-29 20:11:44 UTC (rev 75172)
+++ trunk/ipod-sharp/ChangeLog  2007-03-29 20:55:16 UTC (rev 75173)
@@ -1,5 +1,10 @@
 2007-03-29  James Willcox  <[EMAIL PROTECTED]>
 
+       * src/TrackDatabase.cs: oops, there are some new mhod types in the
+       album list data.  This adds them.
+
+2007-03-29  James Willcox  <[EMAIL PROTECTED]>
+
        * src/TrackDatabase.cs: parse the new "album list" data set found on
        2nd gen nano and shuffle after being synced with iTunes 7.1.
 

Modified: trunk/ipod-sharp/src/TrackDatabase.cs
===================================================================
--- trunk/ipod-sharp/src/TrackDatabase.cs       2007-03-29 20:11:44 UTC (rev 
75172)
+++ trunk/ipod-sharp/src/TrackDatabase.cs       2007-03-29 20:55:16 UTC (rev 
75173)
@@ -637,7 +637,9 @@
         PlaylistData = 50,
         PlaylistRules = 51,
         LibraryIndex = 52,
-        Misc = 100
+        Misc = 100,
+        AlbumListArtist = 200,
+        AlbumListAlbum = 201,
     }
 
     internal enum IndexType {
@@ -681,13 +683,14 @@
             
             Type = (DetailType) ToInt32 (body, 0);
 
-            if ((int) Type > 50 && Type != DetailType.Misc && Type != 
DetailType.LibraryIndex)
+            if ((int) Type > 50 && Type != DetailType.Misc && Type != 
DetailType.LibraryIndex &&
+                Type != DetailType.AlbumListArtist && Type != 
DetailType.AlbumListAlbum)
                 throw new DatabaseReadException ("Unsupported detail type: " + 
Type);
 
             unknownOne = ToInt32 (body, 4);
             unknownTwo = ToInt32 (body, 8);
             
-            if ((int) Type < 50) {
+            if ((int) Type < 50 || Type == DetailType.AlbumListArtist || Type 
== DetailType.AlbumListAlbum) {
                 if (Type == DetailType.PodcastUrl ||
                     Type == DetailType.PodcastUrl2) {
 
@@ -704,7 +707,7 @@
                     int strlen = 0;
                     //int strenc = 0;
             
-                    if ((int) Type < 50) {
+                    if ((int) Type < 50 || Type == DetailType.AlbumListArtist 
|| Type == DetailType.AlbumListAlbum) {
                         // 'string' mhods       
                         strlen = ToInt32 (body, 16);
                         //strenc = ToInt32 (body, 20); // 0 == UTF16, 1 == UTF8
@@ -754,7 +757,7 @@
 
             byte[] valbytes = null;
 
-            if ((int) Type < 50) {
+            if ((int) Type < 50 || Type == DetailType.AlbumListArtist || Type 
== DetailType.AlbumListAlbum) {
                 if (Type == DetailType.PodcastUrl || Type == 
DetailType.PodcastUrl2) {
                     valbytes = Encoding.UTF8.GetBytes (Value);
                     writer.Write (24 + valbytes.Length);
@@ -1336,9 +1339,9 @@
 
             base.Read (db, reader);
             
-            reader.ReadBytes (this.HeaderOne - 12);
+            byte[] body = reader.ReadBytes (this.HeaderOne - 12);
 
-            int detailCount = this.HeaderTwo;
+            int detailCount = ToInt32 (body, 0);
 
             details.Clear ();
 
@@ -1366,6 +1369,7 @@
             WriteName (writer);
             writer.Write (16);
             writer.Write (16 + childDataLength);
+            writer.Write (details.Count);
             writer.Write (childData, 0, childDataLength);
         }
     }

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

Reply via email to