Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : apps/euphoria

Dir     : e17/apps/euphoria/src


Modified Files:
        callbacks.c callbacks.h euphoria.c playlist_item.c 


Log Message:
add edje signal to shuffle playlist, add xmms signal handler to reorder playlist on 
shuffle received, small bugfix where plyalist item properties was null in 
duration_get()
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/callbacks.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- callbacks.c 28 Feb 2004 08:40:05 -0000      1.12
+++ callbacks.c 29 Feb 2004 14:52:07 -0000      1.13
@@ -1,5 +1,5 @@
 /*
- * $Id: callbacks.c,v 1.12 2004/02/28 08:40:05 tsauerbeck Exp $
+ * $Id: callbacks.c,v 1.13 2004/02/29 14:52:07 atmosphere Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -477,6 +477,10 @@
        if (e->playlist->current_item)
                remove_playlist_item(e, e->playlist->current_item);
 }
+EDJE_CB(playlist_shuffle) {
+    assert(e->xmms);
+    xmmsc_playlist_shuffle(e->xmms);
+}
 
 XMMS_CB(playback_status) {
        PlaybackState state;
@@ -596,3 +600,19 @@
        playlist_remove_all(e->playlist);
        /* FIXME: Set the text in the player to the default */
 }
+XMMS_CB(playlist_shuffle) {
+       int i, id, *ids = NULL;
+       PlayListItem *pli = NULL;
+
+       if ((ids = xmmscs_playlist_list(e->xmms))) {
+           for(i = 0; ids[i]; i++) {
+               if((pli = playlist_item_find_by_id(e->playlist, ids[i]))) {
+                   e_container_element_remove(pli->container, pli->edje);
+                   e_container_element_append(pli->container, pli->edje);
+               }
+               else {
+                   fprintf(stderr, "Unable to find %d: %d\n", i, ids[i]);
+               }
+           }
+       }
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/callbacks.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- callbacks.h 27 Feb 2004 23:11:28 -0000      1.4
+++ callbacks.h 29 Feb 2004 14:52:07 -0000      1.5
@@ -2,7 +2,7 @@
 #define __CALLBACKS_H
 
 /*
- * $Id: callbacks.h,v 1.4 2004/02/27 23:11:28 atmosphere Exp $
+ * $Id: callbacks.h,v 1.5 2004/02/29 14:52:07 atmosphere Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -57,6 +57,7 @@
 
 EDJE_CB(playlist_add);
 EDJE_CB(playlist_del);
+EDJE_CB(playlist_shuffle);
 
 void cb_key_press(void *data, Evas *e, Evas_Object *obj, void *event_info);
 void cb_key_release(void *data, Evas *e, Evas_Object *obj, void *event_info);
@@ -70,6 +71,7 @@
 XMMS_CB(playlist_add);
 XMMS_CB(playlist_remove);
 XMMS_CB(playlist_clear);
+XMMS_CB(playlist_shuffle);
 
 #endif
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/euphoria.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- euphoria.c  29 Feb 2004 13:38:13 -0000      1.7
+++ euphoria.c  29 Feb 2004 14:52:07 -0000      1.8
@@ -1,5 +1,5 @@
 /*
- * $Id: euphoria.c,v 1.7 2004/02/29 13:38:13 tsauerbeck Exp $
+ * $Id: euphoria.c,v 1.8 2004/02/29 14:52:07 atmosphere Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -104,6 +104,8 @@
                           (XmmsCb) on_xmms_playlist_remove, e);
        xmmsc_set_callback(e->xmms, XMMS_SIGNAL_PLAYLIST_CLEAR,
                           (XmmsCb) on_xmms_playlist_clear, e);
+       xmmsc_set_callback(e->xmms, XMMS_SIGNAL_PLAYLIST_SHUFFLE,
+                          (XmmsCb) on_xmms_playlist_shuffle, e);
 
        return true;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/playlist_item.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- playlist_item.c     29 Feb 2004 13:52:05 -0000      1.6
+++ playlist_item.c     29 Feb 2004 14:52:07 -0000      1.7
@@ -1,5 +1,5 @@
 /*
- * $Id: playlist_item.c,v 1.6 2004/02/29 13:52:05 tsauerbeck Exp $
+ * $Id: playlist_item.c,v 1.7 2004/02/29 14:52:07 atmosphere Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -42,7 +42,8 @@
 
 unsigned int playlist_item_duration_get(PlayListItem *pli) {
        void *tmp;
-
+       
+       if (!pli->properties) return 0;
        if ((tmp = x_hash_lookup(pli->properties, "duration")))
                return atoi(tmp) / 1000;
        else




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to