00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef PLAYLIST_H
00010 #define PLAYLIST_H
00011
00012 #include <gtk/gtk.h>
00013 #include <cybergarage/util/clist.h>
00014 #include <cybergarage/util/cstring.h>
00015
00016 typedef struct _PlaylistEntry
00017 {
00018 BOOL headFlag;
00019 struct _PlaylistEntry* prev;
00020 struct _PlaylistEntry* next;
00021
00022 CgString* trackName;
00023 CgString* trackURI;
00024 CgString* rendererUDN;
00025 CgString* serverUDN;
00026
00027 } PlaylistEntry, Playlist;
00028
00029
00030
00031
00032
00033 Playlist* playlist_new();
00034 void playlist_delete(Playlist* list);
00035
00036 #define playlist_clear(list) \
00037 cg_list_clear((CgList*) list, \
00038 (CG_LIST_DESTRUCTORFUNC) playlist_entry_delete)
00039
00040 #define playlist_size(list) \
00041 cg_list_size((CgList*) list)
00042
00043 #define playlist_gets(list) \
00044 (PlaylistEntry*) cg_list_next((CgList*) list)
00045
00046 #define playlist_add(list, entry) \
00047 cg_list_add((CgList*) list, (CgList*) entry)
00048
00049
00050
00051
00052
00053 PlaylistEntry* playlist_entry_new();
00054 void playlist_entry_delete(PlaylistEntry* entry);
00055
00056 #define playlist_entry_settrackname(entry, value) \
00057 cg_string_setvalue(entry->trackName, value)
00058
00059 #define playlist_entry_gettrackname(entry) \
00060 cg_string_getvalue(entry->trackName)
00061
00062 #define playlist_entry_settrackuri(entry, value) \
00063 cg_string_setvalue(entry->trackURI, value)
00064
00065 #define playlist_entry_gettrackuri(entry) \
00066 cg_string_getvalue(entry->trackURI)
00067
00068 #define playlist_entry_setrendererUDN(entry, value) \
00069 cg_string_setvalue(entry->rendererUDN, value)
00070
00071 #define playlist_entry_getrendererUDN(entry, value) \
00072 cg_string_getvalue(entry->rendererUDN)
00073
00074 #define playlist_entry_setserverUDN(entry, value) \
00075 cg_string_setvalue(entry->serverUDN, value)
00076
00077 #define playlist_entry_getserverUDN(entry, value) \
00078 cg_string_getvalue(entry->serverUDN)
00079
00080 #define playlist_entry_next(entry) \
00081 (PlaylistEntry*) cg_list_next((CgList*) entry)
00082
00083 #define playlist_entry_prev(entry) \
00084 (PlaylistEntry*) cg_list_prev((CgList*) entry)
00085
00086 #endif