iPodInfo.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef _IPOD_INFO_H_
  2. #define _IPOD_INFO_H_
  3. #define RGB_565 0
  4. #define RGB_555 1
  5. #define RGB_555_REC 2
  6. typedef enum {
  7. THUMB_INVALID = -1,
  8. THUMB_COVER_SMALL,
  9. THUMB_COVER_MEDIUM1,
  10. THUMB_COVER_MEDIUM2,
  11. THUMB_COVER_MEDIUM3,
  12. THUMB_COVER_MEDIUM4,
  13. THUMB_COVER_LARGE,
  14. THUMB_PHOTO_SMALL,
  15. THUMB_PHOTO_LARGE,
  16. THUMB_PHOTO_FULL_SCREEN,
  17. THUMB_PHOTO_TV_SCREEN,
  18. } ThumbType;
  19. typedef enum {
  20. IPOD_COLOR_WHITE,
  21. IPOD_COLOR_BLACK,
  22. IPOD_COLOR_SILVER,
  23. IPOD_COLOR_BLUE,
  24. IPOD_COLOR_PINK,
  25. IPOD_COLOR_GREEN,
  26. IPOD_COLOR_ORANGE,
  27. IPOD_COLOR_GOLD,
  28. IPOD_COLOR_RED,
  29. IPOD_COLOR_U2,
  30. } iPodColor;
  31. typedef enum {
  32. IPOD_MODEL_INVALID=0,
  33. IPOD_MODEL_COLOR=1,
  34. IPOD_MODEL_REGULAR=2,
  35. IPOD_MODEL_MINI=3,
  36. IPOD_MODEL_SHUFFLE=4,
  37. IPOD_MODEL_VIDEO=5,
  38. IPOD_MODEL_NANO=6,
  39. IPOD_MODEL_CLASSIC=7,
  40. IPOD_MODEL_FATNANO=8,
  41. IPOD_MODEL_TOUCH=9,
  42. } iPodModel;
  43. typedef struct {
  44. ThumbType type;
  45. int width;
  46. int height;
  47. int correlation_id;
  48. int format;
  49. int row_align;
  50. int image_align;
  51. } ArtworkFormat;
  52. struct iPodModelInfo
  53. {
  54. // model_number is abbreviated: if the first character is not numeric, it is ommited. e.g. "MA350 -> A350", "M9829 -> 9829"
  55. const wchar_t *model_number;
  56. iPodModel model;
  57. iPodColor color;
  58. int image16;
  59. int image160;
  60. };
  61. class iPodInfo
  62. {
  63. public:
  64. iPodInfo(const iPodModelInfo *model);
  65. ~iPodInfo();
  66. void SetFWID(const uint8_t *new_fwid);
  67. int family_id;
  68. wchar_t *model_number;
  69. iPodModel model;
  70. iPodColor color;
  71. int image16;
  72. int image160;
  73. // Store the supported artwork formats if we
  74. // can dynamically read it from the extended sysinfo xml
  75. ArtworkFormat* supportedArtworkFormats;
  76. size_t numberOfSupportedFormats;
  77. unsigned char *fwid;
  78. unsigned int shadow_db_version;
  79. };
  80. struct _iPodSerialToModel {
  81. const wchar_t *serial;
  82. const wchar_t *model_number;
  83. };
  84. typedef struct _iPodSerialToModel iPodSerialToModel;
  85. iPodInfo *GetiPodInfo(wchar_t drive);
  86. const ArtworkFormat* GetArtworkFormats(const iPodInfo* info);
  87. #endif //_IPOD_INFO_H_