summaryrefslogtreecommitdiffstats
path: root/docs/reference/tmpl/itunesdb-db.sgml
blob: b80b5b32b202f7f111e80374487c3791b6581be4 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!-- ##### SECTION Title ##### -->
iPod database reading/writing

<!-- ##### SECTION Short_Description ##### -->
Functions to create, read, write the iPod database

<!-- ##### SECTION Long_Description ##### -->
<para>
These functions are for creating, reading, writing, and deleting the iPod
database and getting the total number of tracks and playlists.
</para>
<para>
Overview of using the iPod database:
</para>
<para>
itdb_parse(): read the iTunesDB and ArtworkDB
</para>
<para>
itdb_write(): write the iTunesDB and ArtworkDB
</para>
<para>
itdb_parse() will return a #Itdb_iTunesDB structure with GLists
containing all tracks (each track is represented by a #Itdb_Track
structure) and the playlists (each playlist is represented by a
#Itdb_Playlist structure).
</para>
<para>
A number of functions for adding, removing, duplicating tracks
are available.  Please see
<link linkend="libgpod-Tracks">Tracks</link> for details.
</para>
<para>
In each #Itdb_Playlist structure you can find a GList called
'members' with listing all member tracks. Each track referenced
in a playlist must also be present in the tracks GList of the
iTunesDB.
</para>
<para>
The iPod must contain one master playlist (MPL) containing all
tracks accessible on the iPod through the
Music->Tracks/Albums/Artists... menu. Besides the MPL there can
be a number of normal playlists accessible through the
Music->Playlists menu on the iPod. Tracks that are a member of
one of these normal playlists must also be a member of the MPL.
</para>
<para>
The Podcasts playlist is just another playlist with some
internal flags set differently. Also, member tracks in the
Podcasts playlist are not normally members of the MPL (so on the
iPod they will only show up under the Podcasts menu). All tracks
referenced must be in the tracklist of the #Itdb_iTunesDB,
however.
</para>
<para>
A number of functions to add/remove playlists, or add/remove
tracks are available. Please see
<link linkend="libgpod-Playlists">Playlists</link> for details.
</para>
<para>
Each track can have a thumbnail associated with it. You can
retrieve a GdkPixmap of the thumbnail using
itdb_thumb_get_gdk_pixbuf() (tracks have thumbnails of the
following types associated: @ITDB_THUMB_COVER_SMALL and
@ITDB_THUMB_COVER_LARGE).  You can remove a thumbnail with
itdb_track_remove_thumbnails().  And finally, you can set a
new thumbnail using itdb_track_set_thumbnails().
</para>
<para>
Please note that iTunes additionally stores the artwork as tags
in the original music file. That's also from where the data is
read when artwork is displayed in iTunes, and there can be more
than one piece of artwork. libgpod does not store the artwork as
tags in the original music file. As a consequence, if iTunes
attempts to access the artwork, it will find none, and remove
libgpod's artwork. Luckily, iTunes will only attempt to access
the artwork if you select a track in iTunes. (To work around
this, gtkpod keeps a list of the original filename of all
artwork and silently adds the thumbnails if they were 'lost'.
Your application might want to do something similar, or you can
supply patches for (optionally!) adding tags to the original music
files.)
</para>
<para>
The #Itdb_iTunesDB, #Itdb_Playlist and #Itdb_Track structures each
have a userdata and a usertype field that can be used by the
application to store application-specific additional data. If
userdata is a pointer to an external structure, you can supply a
#ItdbUserDataDuplicateFunc and a #ItdbUserDataDestroyFunc so that
this data can be duplicated or freed automatically with a call
to the library _duplicate()/_free() functions.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT Itdb_iTunesDB ##### -->
<para>

</para>

@tracks: 
@playlists: 
@filename: 
@device: 
@version: 
@id: 
@reserved_int1: 
@reserved_int2: 
@reserved1: 
@reserved2: 
@usertype: 
@userdata: 
@userdata_duplicate: 
@userdata_destroy: 

<!-- ##### USER_FUNCTION ItdbUserDataDestroyFunc ##### -->
<para>

</para>

@userdata: 


<!-- ##### USER_FUNCTION ItdbUserDataDuplicateFunc ##### -->
<para>

</para>

@userdata: 
@Returns: 


<!-- ##### FUNCTION itdb_new ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION itdb_free ##### -->
<para>

</para>

@itdb: 


<!-- ##### FUNCTION itdb_parse ##### -->
<para>

</para>

@mp: 
@error: 
@Returns: 


<!-- ##### FUNCTION itdb_write ##### -->
<para>

</para>

@itdb: 
@error: 
@Returns: 


<!-- ##### FUNCTION itdb_set_mountpoint ##### -->
<para>

</para>

@itdb: 
@mp: 


<!-- ##### FUNCTION itdb_get_mountpoint ##### -->
<para>

</para>

@itdb: 
@Returns: 


<!-- ##### FUNCTION itdb_tracks_number ##### -->
<para>

</para>

@itdb: 
@Returns: 


<!-- ##### FUNCTION itdb_tracks_number_nontransferred ##### -->
<para>

</para>

@itdb: 
@Returns: 


<!-- ##### FUNCTION itdb_playlists_number ##### -->
<para>

</para>

@itdb: 
@Returns: