Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : apps/euphoria

Dir     : e17/apps/euphoria/src


Modified Files:
        callbacks.c 


Log Message:
i bugged tru and he found why we always got an id of 0 on file removal, i've
only tested this with the "current song deletion" callbacks, but it works
ok.

you'll have to resync your xmms2 tree in order for this to function
properly.  he's pushed the changes through to xmms2 and xmms2-ecore


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/callbacks.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- callbacks.c 25 Feb 2004 18:39:08 -0000      1.3
+++ callbacks.c 27 Feb 2004 21:17:28 -0000      1.4
@@ -1,5 +1,5 @@
 /*
- * $Id: callbacks.c,v 1.3 2004/02/25 18:39:08 tsauerbeck Exp $
+ * $Id: callbacks.c,v 1.4 2004/02/27 21:17:28 atmosphere Exp $
  */
 
 #include <config.h>
@@ -189,13 +189,6 @@
        assert(pli);
        
        xmmsc_playlist_remove(e->xmms, pli->id);
-       /* This is all commented out pending xmms feeding us a valid id, on
-        * playlist item removal */
-       /*
-       if(e->playlist->current_item == pli && e->track_current_pos > 0)
-           xmmsc_playback_next(e->xmms);
-       playlist_item_remove(e->playlist, pli);
-        */
 }
 
 EDJE_CB(playlist_item_remove) {
@@ -511,11 +504,14 @@
 
 XMMS_CB(playback_playtime) {
        PlayListItem *pli = e->playlist->current_item;
-       e->track_current_pos = (int) arg / 1000; /* time is in msecs */
 
-       ui_refresh_time(e, e->track_current_pos);
-       ui_refresh_seeker(e, (double) e->track_current_pos /
+       if(pli) {
+           e->track_current_pos = (int) arg / 1000; /* time is in msecs */
+
+           ui_refresh_time(e, e->track_current_pos);
+           ui_refresh_seeker(e, (double) e->track_current_pos /
                          playlist_item_duration_get(pli));
+       }
 }
 
 XMMS_CB(playback_currentid) {
@@ -585,10 +581,11 @@
        PlayListItem *pli = NULL;
        unsigned int id = (unsigned int) arg;
        
-       /* FIXME: I think this is xmms2, id is always 0, stopping segv */
-       if (id < 1)
-           fprintf(stderr, "Is %d what really was removed??? :)\n", id);
-       else {
+       if (id > 0) {
+           if (xmmscs_playback_current_id(e->xmms) == id) {
+               xmmsc_playback_stop(e->xmms);
+               e->playlist->current_item = NULL;
+           }
            pli = playlist_item_find_by_id(e->playlist, id);
            assert(pli);
            playlist_item_remove(e->playlist, pli);




-------------------------------------------------------
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