Enlightenment CVS committal

Author  : tsauerbeck
Project : misc
Module  : eplayer

Dir     : misc/eplayer/src


Modified Files:
        callbacks.c callbacks.h interface.c playlist.c playlist.h 


Log Message:
Applied atmos' PLAYLIST_ITEM_REMOVE patch, added Makefile.am's for benr's streamline 
theme
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/callbacks.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- callbacks.c 9 Dec 2003 18:42:19 -0000       1.22
+++ callbacks.c 28 Dec 2003 09:57:14 -0000      1.23
@@ -216,6 +216,32 @@
        state = PLAYBACK_STATE_PLAYING;
 }
 
+void cb_playlist_item_remove(void *udata, Evas_Object *obj,
+                             const char *emission, const char *src) {
+       int ok = 0;
+       ePlayer *player = udata;
+       PlayListItem *pli = evas_object_data_get(obj, "PlayListItem");
+       
+       e_container_element_remove(player->gui.playlist, obj);
+       evas_object_del(obj);
+       
+       if (pli == playlist_current_item_get(player->playlist))
+       {
+           eplayer_playback_stop(player);
+               
+           if (playlist_current_item_has_next(player->playlist))
+                       ok = playlist_current_item_next(player->playlist);
+               
+           if (!ok && playlist_current_item_has_prev(player->playlist))
+                       ok = playlist_current_item_prev(player->playlist);
+           
+               if (!ok)
+                       playlist_remove_all(player->playlist);
+       }
+
+       playlist_remove_item(player->playlist, pli);
+}
+
 void cb_playlist_item_selected(void *udata, Evas_Object *obj,
                                const char *emission, const char *src) {
        ePlayer *player = udata;
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/callbacks.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- callbacks.h 7 Dec 2003 13:08:48 -0000       1.10
+++ callbacks.h 28 Dec 2003 09:57:14 -0000      1.11
@@ -33,6 +33,8 @@
 
 void cb_playlist_item_play(void *udata, Evas_Object *obj,
                            const char *emission, const char *src);
+void cb_playlist_item_remove(void *udata, Evas_Object *obj,
+                             const char *emission, const char *src);
 void cb_playlist_item_selected(void *udata, Evas_Object *obj,
                                const char *emission, const char *src);
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/interface.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- interface.c 7 Dec 2003 13:08:48 -0000       1.23
+++ interface.c 28 Dec 2003 09:57:14 -0000      1.24
@@ -245,6 +245,8 @@
                                                cb_playlist_item_play, player);
        edje_object_signal_callback_add(o, "PLAYLIST_ITEM_SELECTED", "",
                                        cb_playlist_item_selected, player);
+       edje_object_signal_callback_add(o, "PLAYLIST_ITEM_REMOVE", "",
+                                       cb_playlist_item_remove, player);
 }
 
 void ui_fill_playlist(ePlayer *player) {
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- playlist.c  7 Dec 2003 11:53:09 -0000       1.14
+++ playlist.c  28 Dec 2003 09:57:14 -0000      1.15
@@ -113,6 +113,20 @@
        }
 }
 
+/**
+ * Removes the item from a PlayList.
+ *
+ * @param pl
+ * @param pli
+ */
+void playlist_remove_item(PlayList *pl, PlayListItem *pli) {
+       if (!pl || !pli)
+               return;
+       
+       pl->items = evas_list_remove(pl->items, pli);
+       playlist_item_free(pli);
+}
+
 PlayListItem *playlist_current_item_get(PlayList *pl) {
        return pl ? (pl->cur_item ? pl->cur_item->data : NULL) : NULL;
 }
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- playlist.h  7 Dec 2003 11:53:09 -0000       1.8
+++ playlist.h  28 Dec 2003 09:57:14 -0000      1.9
@@ -44,6 +44,7 @@
 int playlist_load_any(PlayList *pl, const char *path, int append);
 
 void playlist_remove_all(PlayList *pl);
+void playlist_remove_item(PlayList *pl, PlayListItem *pli);
 
 PlayListItem *playlist_current_item_get(PlayList *pl);
 void playlist_current_item_set(PlayList *pl, PlayListItem *pli);




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to