Top | ![]() |
![]() |
![]() |
![]() |
Itdb_Playlist * | itdb_playlist_new () |
void | itdb_playlist_free () |
Itdb_Playlist * | itdb_playlist_duplicate () |
void | itdb_playlist_add () |
void | itdb_playlist_move () |
void | itdb_playlist_remove () |
void | itdb_playlist_unlink () |
void | itdb_playlist_add_track () |
void | itdb_playlist_remove_track () |
gboolean | itdb_playlist_contains_track () |
guint32 | itdb_playlist_contain_track_number () |
guint32 | itdb_playlist_tracks_number () |
Itdb_Playlist * | itdb_playlist_mpl () |
gboolean | itdb_playlist_is_mpl () |
void | itdb_playlist_set_mpl () |
Itdb_Playlist * | itdb_playlist_podcasts () |
gboolean | itdb_playlist_is_podcasts () |
void | itdb_playlist_set_podcasts () |
gboolean | itdb_playlist_exists () |
Itdb_Playlist * | itdb_playlist_by_id () |
Itdb_Playlist * | itdb_playlist_by_nr () |
Itdb_Playlist * | itdb_playlist_by_name () |
void | itdb_playlist_randomize () |
These functions and structures allow for adding and removing playlists, adding and removing tracks from playlists, sorting playlists, finding tracks in a playlist, etc.
Itdb_Playlist * itdb_playlist_new (const gchar *title
,gboolean spl
);
Creates a new playlist. If spl
is TRUE, a smart playlist is
generated. pl->id is set by itdb_playlist_add()
when the playlist
is added to an Itdb_iTunesDB
void
itdb_playlist_free (Itdb_Playlist *pl
);
Frees the memory used by playlist pl
.
Itdb_Playlist *
itdb_playlist_duplicate (Itdb_Playlist *pl
);
Duplicates an existing playlist. pl_dup->id
is set to zero, so
that it will be set to a unique value when adding it to an
Itdb_iTunesDB. The returned playlist won't be associated with an
Itdb_iTunesDB.
a newly allocated Itdb_Playlist that you'll have to
free with itdb_playlist_free()
when you no longer need it.
void itdb_playlist_add (Itdb_iTunesDB *itdb
,Itdb_Playlist *pl
,gint32 pos
);
Adds playlist pl
to the database itdb
at position pos
(-1 for
"append to end"). A unique id is created if pl->id
is equal to
zero. After calling this function, itdb
manages the memory of pl
,
which means you no longer need to explicitly call
itdb_playlist_free()
void itdb_playlist_move (Itdb_Playlist *pl
,gint32 pos
);
Moves playlist pl
to position pos
. -1 will append to the end of the
list.
void
itdb_playlist_remove (Itdb_Playlist *pl
);
Removes pl
from the Itdb_iTunesDB it's associated with
and frees memory
void
itdb_playlist_unlink (Itdb_Playlist *pl
);
Remove pl
from the Itdb_iTunesDB it's associated with but do not
free memory. pl->itdb
is set to NULL after this function returns
void itdb_playlist_add_track (Itdb_Playlist *pl
,Itdb_Track *track
,gint32 pos
);
Adds track
to pl
at position pos
(-1 to append at the end)
void itdb_playlist_remove_track (Itdb_Playlist *pl
,Itdb_Track *track
);
Removes track
from pl
. If pl
is NULL, removes track
from the
master playlist. If track
can't be found in pl
, nothing happens.
If after removing track
, pl
is empty, it's not removed from the
database The memory used by track
isn't freed.
gboolean itdb_playlist_contains_track (Itdb_Playlist *pl
,Itdb_Track *track
);
Checks if track
is in pl
guint32
itdb_playlist_contain_track_number (Itdb_Track *tr
);
Counts the number of playlist track
is a member of (not including
the master playlist)
guint32
itdb_playlist_tracks_number (Itdb_Playlist *pl
);
Counts the number of tracks in pl
Itdb_Playlist *
itdb_playlist_mpl (Itdb_iTunesDB *itdb
);
Gets the master playlist of itdb
gboolean
itdb_playlist_is_mpl (Itdb_Playlist *pl
);
Checks if pl
is the master playlist
Since: 0.1.6
void
itdb_playlist_set_mpl (Itdb_Playlist *pl
);
Sets pl
to be a master playlist
Since: 0.2.0
Itdb_Playlist *
itdb_playlist_podcasts (Itdb_iTunesDB *itdb
);
Gets the podcasts playlist of itdb
Since: 0.1.6
gboolean
itdb_playlist_is_podcasts (Itdb_Playlist *pl
);
Checks if pl
is the podcasts playlist
Since: 0.1.6
void
itdb_playlist_set_podcasts (Itdb_Playlist *pl
);
Set pl
to be a podcasts playlist
Since: 0.2.0
gboolean itdb_playlist_exists (Itdb_iTunesDB *itdb
,Itdb_Playlist *pl
);
Checks if pl
is present in itdb
Itdb_Playlist * itdb_playlist_by_id (Itdb_iTunesDB *itdb
,guint64 id
);
Looks up a playlist whose ID is id
Itdb_Playlist * itdb_playlist_by_nr (Itdb_iTunesDB *itdb
,guint32 num
);
Gets the playlist at the given position in itdb
Itdb_Playlist * itdb_playlist_by_name (Itdb_iTunesDB *itdb
,gchar *name
);
Searches a playlist whose name is name
in itdb
struct Itdb_Playlist { Itdb_iTunesDB *itdb; gchar *name; guint8 type; guint8 flag1; guint8 flag2; guint8 flag3; gint num; GList *members; gboolean is_spl; time_t timestamp; guint64 id; guint32 sortorder; guint32 podcastflag; Itdb_SPLPref splpref; Itdb_SPLRules splrules; gpointer reserved100; gpointer reserved101; /* reserved for future use */ gint32 reserved_int1; gint32 reserved_int2; Itdb_Playlist_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; };
Structure representing an iTunes Playlist
Itdb_iTunesDB * |
A pointer to the Itdb_iTunesDB (for convenience) |
|
The name of the playlist in UTF8 |
||
The playlist type (normal or master) |
||
Unknown, usually set to 0 |
||
Unknown, always set to 0 |
||
Unknown, always set to 0 |
||
The number of tracks in the playlist |
||
A list of tracks in the playlist (Itdb_Track) |
||
True if the playlist is a smart playlist, otherwise false |
||
When the playlist was created |
||
The playlist ID |
||
The playlist sort order (ItdbPlaylistSortOrder) |
||
This is set to 0 on normal playlists and to 1 for the Podcast playlist. If set to 1, the playlist will not be shown under 'Playlists' on the iPod, but as 'Podcasts' under the Music menu. The actual title of the Playlist does not matter. If more than one playlist is set to 1, they don't show up at all. |
||
Itdb_SPLPref |
Smart playlist preferences (Itdb_SPLPref) |
|
Itdb_SPLRules |
Smart playlist rules (Itdb_SPLRules) |
|
Reserved for MHOD100 implementation |
||
Reserved for MHOD100 implementation |
||
Reserved for future use |
||
Reserved for future use |
||
Itdb_Playlist_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 { Itdb_Playlist_Mhsd5_Type mhsd5_type; } Itdb_Playlist_Private;
Playlist Sort Order
Sort by playlist order (manual sort) |
||
Sort by track title |
||
Sort by album |
||
Sort by artist |
||
Sort by bitrate |
||
Sort by genre |
||
Sort by filetype |
||
Sort by date modified |
||
Sort by track number |
||
Sort by track size |
||
Sort by track time |
||
Sort by year |
||
Sort by samplerate |
||
Sort by comments |
||
Sort by date added |
||
Sort by equilizer |
||
Sort by composer |
||
Sort by playcount |
||
Sort by date last played |
||
Sort by disc number |
||
Sort by rating |
||
Sort by release date |
||
Sort by beats per minute |
||
Sort by grouping |
||
Sort by category |
||
Sort by description |
Since: 0.1.3