summaryrefslogtreecommitdiffstats
path: root/src/itdb_device.h
blob: bb02880f25c0ab7d7b9a484c601973cb155f7bb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* Time-stamp: <2006-03-21 17:22:34 jcs>
|
|  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
|  Part of the gtkpod project.
| 
|  URL: http://www.gtkpod.org/
|  URL: http://gtkpod.sourceforge.net/
|
|  Most of the code in this file has been ported from the perl
|  script "mktunes.pl" (part of the gnupod-tools collection) written
|  by Adrian Ulrich <pab at blinkenlights.ch>.
|
|  gnupod-tools: http://www.blinkenlights.ch/cgi-bin/fm.pl?get=ipod
|
|  The code contained in this file is free software; you can redistribute
|  it and/or modify it under the terms of the GNU Lesser General Public
|  License as published by the Free Software Foundation; either version
|  2.1 of the License, or (at your option) any later version.
|
|  This file is distributed in the hope that it will be useful,
|  but WITHOUT ANY WARRANTY; without even the implied warranty of
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
|  Lesser General Public License for more details.
|
|  You should have received a copy of the GNU Lesser General Public
|  License along with this code; if not, write to the Free Software
|  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
|
|  iTunes and iPod are trademarks of Apple
|
|  This product is not supported/written/published by Apple!
|
|  $Id$
*/

#ifndef __ITDB_DEVICE_H__
#define __ITDB_DEVICE_H__

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include "itdb.h"

#include <glib.h>

G_BEGIN_DECLS

typedef struct _Itdb_IpodModel Itdb_IpodModel;
typedef struct _Itdb_ArtworkFormat Itdb_ArtworkFormat;

struct _Itdb_Device
{
    gchar *mountpoint;    /* mountpoint of the iPod */
    gint   musicdirs;     /* number of /iPod_Control/Music/F.. dirs */
    guint  byte_order;    /* G_LITTLE_ENDIAN "regular" endianness 
			   * G_BIG_ENDIAN "reversed" endianness (e.g. mobile
			   * phone iTunesDBs)
			   */
    GHashTable *sysinfo;  /* hash with value/key pairs of all entries
			     in Device/SysInfo */
};

struct _Itdb_ArtworkFormat
{
	gint  type;
	gint16 width;
	gint16 height;
	gint16 correlation_id;
};

struct _Itdb_IpodModel {
	const gchar *model_number;
	const guint64 capacity;
	guint model_type;
	guint generation;
};

typedef enum {
	UNKNOWN_GENERATION,
	FIRST_GENERATION,
	SECOND_GENERATION,
	THIRD_GENERATION,
	FOURTH_GENERATION,
	FIFTH_GENERATION,
	MOBILE_GENERATION
} Itdb_Generation;

typedef enum {
	MODEL_TYPE_INVALID,
	MODEL_TYPE_UNKNOWN,
	MODEL_TYPE_COLOR,
	MODEL_TYPE_COLOR_U2,
	MODEL_TYPE_REGULAR,
	MODEL_TYPE_REGULAR_U2,
	MODEL_TYPE_MINI,
	MODEL_TYPE_MINI_BLUE,
	MODEL_TYPE_MINI_PINK,
	MODEL_TYPE_MINI_GREEN,
	MODEL_TYPE_MINI_GOLD,
	MODEL_TYPE_SHUFFLE,
	MODEL_TYPE_NANO_WHITE,
	MODEL_TYPE_NANO_BLACK,
	MODEL_TYPE_VIDEO_WHITE,
	MODEL_TYPE_VIDEO_BLACK,
	MODEL_TYPE_MOBILE_1
} Itdb_ModelType;


enum { 
	IPOD_COVER_SMALL,
	IPOD_COVER_LARGE,
	IPOD_PHOTO_SMALL,
	IPOD_PHOTO_LARGE,
	IPOD_PHOTO_FULL_SCREEN,
	IPOD_PHOTO_TV_SCREEN
};

G_GNUC_INTERNAL const Itdb_ArtworkFormat *itdb_device_get_artwork_formats (Itdb_Device *device);
G_GNUC_INTERNAL const Itdb_IpodModel *itdb_device_get_ipod_model (Itdb_Device *device);
G_GNUC_INTERNAL gint itdb_device_musicdirs_number (Itdb_Device *device);
G_GNUC_INTERNAL void itdb_device_autodetect_endianess (Itdb_Device *device);


G_END_DECLS

#endif