libgpod Reference Manual | ||||
---|---|---|---|---|
gboolean itdb_cp_track_to_ipod (Itdb_Track *track, const gchar *filename, GError **error); void itdb_filename_fs2ipod (gchar *filename); void itdb_filename_ipod2fs (gchar *ipod_file); gchar* itdb_filename_on_ipod (Itdb_Track *track); gint itdb_musicdirs_number (Itdb_iTunesDB *itdb); gboolean itdb_rename_files (const gchar *mp, GError **error);
These functions are for copying, renaming, and retrieving information about the files and directories on the iPod.
gboolean itdb_cp_track_to_ipod (Itdb_Track *track, const gchar *filename, GError **error);
Copy one track to the iPod. The PC filename is filename
and is taken literally.
The mountpoint of the iPod (in local encoding) must have been set
with itdb_set_mountpoint()
(done automatically when reading an
iTunesDB).
If track->transferred
is set to TRUE, nothing is done. Upon
successful transfer track->transferred
is set to TRUE.
For storage, the directories "F00 ... Fnn" will be used randomly.
The filename is constructed as "libgpodrandom_number
" and copied
to track->ipod_path
. If this file already exists, random_number
is adjusted until an unused filename is found.
If track->ipod_path
is already set, this one will be used
instead. If a file with this name already exists, it will be
overwritten.
track->filetype_marker
is set according to the filename extension
|
the Itdb_Track to copy (containing filename metadata)
|
|
the source file |
|
return location for a GError or NULL |
Returns : |
TRUE on success, FALSE on error, in which case error is
set accordingly.
|
void itdb_filename_fs2ipod (gchar *filename);
Convert string from casual PC file name to iPod iTunesDB format
using ':' instead of G_DIR_SEPARATOR_S (i.e. slashes on Unix-like
systems). ipod_file
is modified in place.
|
a 'PC-style' filename (eg /iPod_Control/Music/f00/test.mp3) |
void itdb_filename_ipod2fs (gchar *ipod_file);
Convert string from from iPod iTunesDB format to casual PC file
name using G_DIR_SEPARATOR (ie slashes on Unix-like systems)
instead of ':'. ipod_file
is modified in place.
|
a 'PC-style' filename (eg /iPod_Control/Music/f00/test.mp3) |
gchar* itdb_filename_on_ipod (Itdb_Track *track);
Get the full iPod filename as stored in track
.
itdb_resolve_path()
) and might return a filename with different
case than the original filename. Don't copy it back to track
if
you can avoid it.
|
an Itdb_Track |
Returns : |
full filename to track on the iPod or NULL if no
filename is set in track . Must be freed with g_free() after use.
|
gint itdb_musicdirs_number (Itdb_iTunesDB *itdb);
Determine the number of F.. directories in iPod_Control/Music.
If itdb->musicdirs
is already set, simply return the previously
determined number. Otherwise count the directories first and set
itdb->musicdirs
.
|
an Itdb_iTunesDB |
Returns : |
max number of directories in iPod_Control/Music |
Since 0.1.3
gboolean itdb_rename_files (const gchar *mp, GError **error);
Renames/removes some files on the iPod (Playcounts, OTG semaphore). May have to be called if you write the iTunesDB not directly to the iPod but to some other location and then manually copy the file from there to the iPod.
|
mount point of the iPod |
|
return location for a GError or NULL |
Returns : |
FALSE on error and sets error accordingly
|