Author: jwilcox
Date: 2006-06-16 12:01:54 -0400 (Fri, 16 Jun 2006)
New Revision: 61803
Modified:
trunk/ipod-sharp/ChangeLog
Log:
2006-06-16 James Willcox <snorp (AT) snorp (DOT) net>
* src/PhotoDatabase.cs: read/write the full size image records
Modified: trunk/ipod-sharp/ChangeLog
trunk/ipod-sharp/ChangeLog2006-06-16 14:29:34 UTC (rev 61802)
trunk/ipod-sharp/ChangeLog2006-06-16 16:01:54 UTC (rev 61803)
@@ -1,5 +1,9 @@
2006-06-16 James Willcox <snorp (AT) snorp (DOT) net>
+* src/PhotoDatabase.cs: read/write the full size image records
+
+2006-06-16 James Willcox <snorp (AT) snorp (DOT) net>
+
* Convert more stuff to use generic collections
2006-06-15 James Willcox <snorp (AT) snorp (DOT) net>
Modified:
2006-06-16 14:29:34 UTC (rev 61802)
2006-06-16 16:01:54 UTC (rev 61803)
@@ -452,11 +452,15 @@
this.Name = "mhod";
}
- public PhotoDetailRecord (bool isbe, ImageNameRecord name) : this (isbe) {
+ public PhotoDetailRecord (bool isbe, ImageNameRecord name, PhotoDetailType type) : this (isbe) {
Type = ;
ImageName = name;
+ Type = type;
}
+ public PhotoDetailRecord (bool isbe, PhotoDetailType type) : this (isbe, null, type) {
+ }
+
public override void Read (BinaryReader reader) {
base.Read (reader);
@@ -465,11 +469,10 @@
switch (Type) {
case
+ case
ImageName = new ImageNameRecord (IsBE);
ImageName.Read (reader);
break;
- case
- throw new ApplicationException ("Not implemented yet");
case PhotoDetailType.FileName:
ReadString (reader, true);
break;
@@ -513,10 +516,9 @@
switch (Type) {
case
+ case
SaveChild (ImageName, out childBytes, out childLen);
break;
- case
- throw new ApplicationException ("not implemented yet");
case PhotoDetailType.FileName:
childBytes = Encoding.Unicode.GetBytes (Value);
childLen = 12 + childBytes.Length;
@@ -548,10 +550,9 @@
switch (Type) {
case
+ case
writer.Write (childBytes, 0, childLen);
break;
- case
- throw new ApplicationException ("not implemented yet");
case PhotoDetailType.FileName:
WriteString (writer, childBytes, childPadding, true);
break;
@@ -638,6 +639,7 @@
private int ;
private int unknownTwo;
private int sourceImageSize;
+ private ImageNameRecord fullName;
private List<ImageNameRecordnames = new List<ImageNameRecord();
@@ -683,7 +685,12 @@
for (int i = 0; i < numChildren; i++) {
PhotoDetailRecord detail = new PhotoDetailRecord (IsBE);
detail.Read (reader);
- names.Add (detail.ImageName);
+
+ if (detail.Type == ) {
+ names.Add (detail.ImageName);
+ } else {
+ fullName = detail.ImageName;
+ }
}
}
@@ -694,15 +701,19 @@
List<PhotoDetailRecorddetails = new List<PhotoDetailRecord();
foreach (ImageNameRecord name in names) {
- details.Add (new PhotoDetailRecord (IsBE, name));
+ details.Add (new PhotoDetailRecord (IsBE, name, ));
}
+
+ if (fullName != null) {
+ details.Add (new PhotoDetailRecord (IsBE, fullName, PhotoDetailType.ImageContainer));
+ }
SaveChildren (details, out childBytes, out childLen);
WriteName (writer);
writer.Write (52 + PadLength);
writer.Write (52 + PadLength + childLen);
- writer.Write (names.Count);
+ writer.Write (details.Count);
writer.Write (Id);
writer.Write (TrackId);
writer.Write ();
Mono-patches maillist - Mono-patches (AT) lists (DOT) ximian.com