1
/* arch-tag: Header for itunesdb parser, based on code from gtkpod */
2
/* Time-stamp: <2003-11-29 12:08:57 jcs>
4
| Copyright (C) 2002-2003 Jorg Schuler <jcsjcs at users.sourceforge.net>
5
| Part of the gtkpod project.
7
| URL: http://gtkpod.sourceforge.net/
9
| Most of the code in this file has been ported from the perl
10
| script "mktunes.pl" (part of the gnupod-tools collection) written
11
| by Adrian Ulrich <pab at blinkenlights.ch>.
13
| gnupod-tools: http://www.blinkenlights.ch/cgi-bin/fm.pl?get=ipod
15
| The code contained in this file is free software; you can redistribute
16
| it and/or modify it under the terms of the GNU Lesser General Public
17
| License as published by the Free Software Foundation; either version
18
| 2.1 of the License, or (at your option) any later version.
20
| This file is distributed in the hope that it will be useful,
21
| but WITHOUT ANY WARRANTY; without even the implied warranty of
22
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
| Lesser General Public License for more details.
25
| You should have received a copy of the GNU Lesser General Public
26
| License along with this code; if not, write to the Free Software
27
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
| iTunes and iPod are trademarks of Apple
31
| This product is not supported/written/published by Apple!
33
| $Id: itunesdb.h,v 1.1 2004/02/07 20:04:31 walters Exp $
36
#ifndef __ITUNESDB_H__
37
#define __ITUNESDB_H__
41
/* Warning: iPodSong is the same as Track, but iPodPlaylist is different from
47
gchar *album; /* album (utf8) */
48
gchar *artist; /* artist (utf8) */
49
gchar *title; /* title (utf8) */
50
gchar *genre; /* genre (utf8) */
51
gchar *comment; /* comment (utf8) */
52
gchar *composer; /* Composer (utf8) */
53
gchar *fdesc; /* ? (utf8) */
54
gchar *ipod_path; /* name of file on iPod: uses ":" instead of "/"*/
55
gunichar2 *album_utf16; /* album (utf16) */
56
gunichar2 *artist_utf16; /* artist (utf16) */
57
gunichar2 *title_utf16; /* title (utf16) */
58
gunichar2 *genre_utf16; /* genre (utf16) */
59
gunichar2 *comment_utf16; /* comment (utf16) */
60
gunichar2 *composer_utf16; /* Composer (utf16) */
61
gunichar2 *fdesc_utf16; /* ? (utf16) */
62
gunichar2 *ipod_path_utf16;/* name of file on iPod: uses ":" instead of "/"*/
63
gchar *pc_path_utf8; /* PC filename in utf8 encoding */
64
gchar *pc_path_locale; /* PC filename in locale encoding */
65
guint32 ipod_id; /* unique ID of track */
66
gint32 size; /* size of file in bytes */
67
gint32 oldsize; /* used when updating tracks: size on iPod */
68
gint32 tracklen; /* Length of track in ms */
69
gint32 cd_nr; /* CD number */
70
gint32 cds; /* number of CDs */
71
gint32 track_nr; /* track number */
72
gint32 tracks; /* number of tracks */
73
gint32 bitrate; /* bitrate */
74
gint32 year; /* year */
75
gchar *year_str; /* year as string -- always identical to year */
76
gint32 volume; /* volume adjustment between -100 and +100 */
77
guint32 time_played; /* time of last play (Mac type) */
78
guint32 time_modified; /* time of last modification (Mac type) */
79
guint32 rating; /* star rating (stars * RATING_STEP (20)) */
80
guint32 playcount; /* number of times track was played */
81
guint32 recent_playcount; /* times track was played since last sync */
82
gchar *hostname; /* name of host this file has been imported on*/
83
gboolean transferred; /* has file been transferred to iPod? */
84
gchar *md5_hash; /* md5 hash of file (or NULL) */
85
gchar *charset; /* charset used for ID3 tags */
90
gchar *name; /* name of playlist in UTF8 */
91
gunichar2 *name_utf16; /* name of playlist in UTF16 */
92
guint32 type; /* 1: master play list (PL_TYPE_MPL) */
93
GList *song_ids; /* tracks in playlist (IDs of the tracks) */
106
MHOD_ID_COMPOSER = 12,
107
MHOD_ID_PLAYLIST = 100
110
#define ITUNESDB_COPYBLK 65536 /* blocksize for cp () */
117
typedef enum _iPodItemType iPodItemType;
124
typedef struct _iPodItem iPodItem;
127
typedef struct _iPodParser iPodParser;
129
iPodItem *ipod_get_next_item (iPodParser *parser);
130
iPodParser *ipod_parser_new (const gchar *mount_point);
131
void ipod_parser_destroy (iPodParser *parser);
132
void ipod_item_destroy (iPodItem *item);
134
gchar *itunesdb_get_track_name_on_ipod (const gchar *path, iPodSong *s);
136
#ifdef ITUNESDB_WRITE
137
gboolean itunesdb_write (const gchar *path);
138
gboolean itunesdb_write_to_file (const gchar *filename);
139
gboolean itunesdb_copy_track_to_ipod (const gchar *path, Track *track,
140
const gchar *pcfile);
141
gboolean itunesdb_cp (const gchar *from_file, const gchar *to_file);
144
guint32 itunesdb_time_get_mac_time (void);
145
time_t itunesdb_time_mac_to_host (guint32 mactime);
146
guint32 itunesdb_time_host_to_mac (time_t time);