Enlightenment CVS committal

Author  : tsauerbeck
Project : misc
Module  : eplayer

Dir     : misc/eplayer/src


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


Log Message:
small update for the playlist callback code
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/callbacks.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- callbacks.c 1 Feb 2004 16:58:52 -0000       1.39
+++ callbacks.c 1 Feb 2004 17:34:47 -0000       1.40
@@ -1,5 +1,5 @@
 /*
- * $Id: callbacks.c,v 1.39 2004/02/01 16:58:52 tsauerbeck Exp $
+ * $Id: callbacks.c,v 1.40 2004/02/01 17:34:47 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -219,28 +219,35 @@
                state = PLAYBACK_STATE_PLAYING;
 }
 
+static void remove_playlist_item(ePlayer *player, PlayListItem *pli) {
+       bool ok = false;
+
+       assert(pli);
+
+       if (pli != playlist_current_item_get(player->playlist)) {
+               playlist_remove_item(player->playlist, pli);
+               return;
+       }
+
+       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);
+       else
+               playlist_remove_item(player->playlist, pli);
+}
+
 EDJE_CB(playlist_item_remove) {
-       int ok = 0;
        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);
+       if (pli)
+               remove_playlist_item(player, pli);
 }
 
 EDJE_CB(playlist_item_selected) {
@@ -497,9 +504,9 @@
 }
 
 EDJE_CB(playlist_del) {
-
-/* playlist_item_remove should be the callback to use.. not sure why that one doesn't 
work */
-
+       /* FIXME find the currently selected track and call
+        * remove_playlist_item()
+        */
 }
 
 static void 
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/interface.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- interface.c 1 Feb 2004 16:58:53 -0000       1.46
+++ interface.c 1 Feb 2004 17:34:47 -0000       1.47
@@ -1,5 +1,5 @@
 /*
- * $Id: interface.c,v 1.46 2004/02/01 16:58:53 tsauerbeck Exp $
+ * $Id: interface.c,v 1.47 2004/02/01 17:34:47 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -246,11 +246,10 @@
                 (EdjeCb) cb_switch_group},
                {"SEEKER*", "*",
                 (EdjeCb) cb_update_seeker},
-                {"PLAYLIST_ADD", "*",
-                 (EdjeCb) cb_playlist_add},
-                {"PLAYLIST_DEL", "*",
-                 (EdjeCb) cb_playlist_del}
-       };
+               {"PLAYLIST_ADD", "*",
+                (EdjeCb) cb_playlist_add},
+               {"PLAYLIST_DEL", "*",
+                (EdjeCb) cb_playlist_del}};
 
        for (i = 0; i < sizeof (cb) / sizeof (EdjeCallback); i++)
                edje_object_signal_callback_add(e, cb[i].name, cb[i].src,
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- playlist.c  1 Feb 2004 13:12:12 -0000       1.22
+++ playlist.c  1 Feb 2004 17:34:47 -0000       1.23
@@ -1,5 +1,5 @@
 /*
- * $Id: playlist.c,v 1.22 2004/02/01 13:12:12 tsauerbeck Exp $
+ * $Id: playlist.c,v 1.23 2004/02/01 17:34:47 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -60,9 +60,9 @@
  * @param pli
  */
 void playlist_remove_item(PlayList *pl, PlayListItem *pli) {
-       if (!pl || !pli)
-               return;
-       
+       assert(pl);
+       assert(pli);
+
        pl->num--;
        pl->duration -= pli->duration;
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist_item.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- playlist_item.c     1 Feb 2004 13:12:12 -0000       1.3
+++ playlist_item.c     1 Feb 2004 17:34:47 -0000       1.4
@@ -1,5 +1,5 @@
 /*
- * $Id: playlist_item.c,v 1.3 2004/02/01 13:12:12 tsauerbeck Exp $
+ * $Id: playlist_item.c,v 1.4 2004/02/01 17:34:47 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -39,6 +39,8 @@
 
        pthread_mutex_destroy(&pli->pos_mutex);
 
+       e_container_element_remove(pli->container, pli->edje);
+       
        if (pli->edje)
                evas_object_del(pli->edje);
 




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to