![]() |
![]() |
![]() |
libgpod Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
Itdb_iTunesDB; Itdb_iTunesDB_Private; enum ItdbFileError; Itdb_iTunesDB * itdb_new (void
); void itdb_free (Itdb_iTunesDB *itdb
); Itdb_iTunesDB * itdb_parse (const gchar *mp
,GError **error
); gboolean itdb_write (Itdb_iTunesDB *itdb
,GError **error
); void itdb_set_mountpoint (Itdb_iTunesDB *itdb
,const gchar *mp
); const gchar * itdb_get_mountpoint (Itdb_iTunesDB *itdb
); gboolean itdb_init_ipod (const gchar *mountpoint
,const gchar *model_number
,const gchar *ipod_name
,GError **error
); guint32 itdb_tracks_number (Itdb_iTunesDB *itdb
); guint32 itdb_tracks_number_nontransferred (Itdb_iTunesDB *itdb
); guint32 itdb_playlists_number (Itdb_iTunesDB *itdb
); void (*ItdbUserDataDestroyFunc) (gpointer userdata
); gpointer (*ItdbUserDataDuplicateFunc) (gpointer userdata
);
typedef struct { GList *tracks; GList *playlists; gchar *filename; Itdb_Device *device; guint32 version; guint64 id; gint32 tzoffset; /* reserved for future use */ gint32 reserved_int2; Itdb_iTunesDB_Private *priv; gpointer reserved2; /* below is for use by application */ guint64 usertype; gpointer userdata; /* functions called to duplicate/free userdata */ ItdbUserDataDuplicateFunc userdata_duplicate; ItdbUserDataDestroyFunc userdata_destroy; } Itdb_iTunesDB;
Structure representing an iTunes database
A list of tracks in the database (Itdb_Track) | |
A list of playlists in the database (Itdb_Playlist) | |
The filename of the iTunesDB | |
Itdb_Device * |
iPod device info (Itdb_Device) |
The version number of the iTunesDB | |
A 64 bit id value for the iTunesDB | |
offset in seconds from UTC | |
Reserved for future use | |
Itdb_iTunesDB_Private * |
Private data |
Reserved for future use | |
For use by application | |
For use by application | |
ItdbUserDataDuplicateFunc |
A function to duplicate userdata |
ItdbUserDataDestroyFunc |
A function to free userdata |
typedef struct { GList *mhsd5_playlists; guint16 platform; guint16 unk_0x22; guint64 id_0x24; guint16 lang; guint64 pid; gint32 unk_0x50; gint32 unk_0x54; gint16 audio_language; gint16 subtitle_language; gint16 unk_0xa4; gint16 unk_0xa6; gint16 unk_0xa8; gchar *genius_cuid; } Itdb_iTunesDB_Private;
typedef enum { ITDB_FILE_ERROR_SEEK, ITDB_FILE_ERROR_CORRUPT, ITDB_FILE_ERROR_NOTFOUND, ITDB_FILE_ERROR_RENAME, ITDB_FILE_ERROR_ITDB_CORRUPT } ItdbFileError;
Error codes for iTunesDB file
Itdb_iTunesDB * itdb_new (void
);
Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable values.
Returns : |
a newly created Itdb_iTunesDB to be freed with itdb_free()
when it's no longer needed
|
void itdb_free (Itdb_iTunesDB *itdb
);
Free the memory taken by itdb
.
|
an Itdb_iTunesDB |
Itdb_iTunesDB * itdb_parse (const gchar *mp
,GError **error
);
Parse the Itdb_iTunesDB of the iPod located at mp
|
mount point of the iPod (eg "/mnt/ipod") in local encoding |
|
return location for a GError or NULL |
Returns : |
a newly allocated Itdb_iTunesDB struct holding the tracks and
the playlists present on the iPod at mp , NULL if mp isn't an iPod mount
point. If non-NULL, the Itdb_iTunesDB is to be freed with itdb_free() when
it's no longer needed
|
gboolean itdb_write (Itdb_iTunesDB *itdb
,GError **error
);
Write out an iTunesDB. It reassigns unique IDs to all tracks. An existing "Play Counts" file is renamed to "Play Counts.bak" if the export was successful. An existing "OTGPlaylistInfo" file is removed if the export was successful.
|
the Itdb_iTunesDB to write to disk |
|
return location for a GError or NULL |
Returns : |
TRUE on success, FALSE on error, in which case error is
set accordingly.
|
void itdb_set_mountpoint (Itdb_iTunesDB *itdb
,const gchar *mp
);
Sets the mountpoint of itdb
. Always use this function to set the
mountpoint of an Itdb_iTunesDB as it will reset the number of
available /iPod_Control/Music/F.. dirs. It doesn't attempt to parse
an iPod database that may be present on the iPod at mp
.
Calling this function removes the artwork in the Itdb_iTunesDB database using this Itdb_Device which was read from the iPod.
.
|
an Itdb_iTunesDB |
|
new mount point |
Since 0.1.3
const gchar * itdb_get_mountpoint (Itdb_iTunesDB *itdb
);
Retrieve a reference to the mountpoint of itdb
|
an Itdb_iTunesDB |
Returns : |
the itdb mountpoint, this string shouldn't be freed
nor modified
|
Since 0.4.0
gboolean itdb_init_ipod (const gchar *mountpoint
,const gchar *model_number
,const gchar *ipod_name
,GError **error
);
Initialise an iPod device from scratch. The function attempts to
create a blank database, complete with master playlist and device
information as well as the directory structure required for the
type of iPod.
model_number
is used to tell libgpod about the exact iPod
model, which is needed for proper artwork writing. model_number
can be
found from the table returned by itdb_device_get_ipod_info_table (for
example). On recent distros with iPods released
in the last few years (starting with the iPod Color), it should be fine
to pass in a NULL model_number
while still getting artwork writing.
|
the iPod mountpoint |
|
the iPod model number, can be NULL |
|
the name to give to the iPod. Will be displayed in gtkpod or itunes |
|
return location for a GError or NULL |
Returns : |
TRUE when successful, FALSE if a failure has occurred. |
Since 0.4.0
guint32 itdb_tracks_number (Itdb_iTunesDB *itdb
);
Counts the number of tracks stored in itdb
|
an Itdb_iTunesDB |
Returns : |
the number of tracks in itdb
|
guint32 itdb_tracks_number_nontransferred (Itdb_iTunesDB *itdb
);
Counts the number of non-transferred tracks in itdb
|
an Itdb_iTunesDB |
Returns : |
the number of tracks in itdb that haven't been transferred
to the iPod yet (ie the number of Itdb_Track in which the transferred field
is false)
|
guint32 itdb_playlists_number (Itdb_iTunesDB *itdb
);
Counts the number of playlists stored in itdb
|
an Itdb_iTunesDB |
Returns : |
the number of playlists in itdb (including the master
playlist)
|
void (*ItdbUserDataDestroyFunc) (gpointer userdata
);
Function called to free userdata
|
A gpointer to user data |