Enlightenment CVS committal

Author  : tsauerbeck
Project : misc
Module  : eplayer

Dir     : misc/eplayer/src


Modified Files:
        callbacks.c playlist.c playlist.h playlist_item.c 
        playlist_item.h track.c 


Log Message:
The UI parts and playlist are now correctly re-initialized after a group switch
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/callbacks.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- callbacks.c 3 Feb 2004 20:21:11 -0000       1.42
+++ callbacks.c 3 Feb 2004 22:01:57 -0000       1.43
@@ -1,5 +1,5 @@
 /*
- * $Id: callbacks.c,v 1.42 2004/02/03 20:21:11 tsauerbeck Exp $
+ * $Id: callbacks.c,v 1.43 2004/02/03 22:01:57 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -285,27 +285,27 @@
 }
 
 EDJE_CB(seek_forward_start) {
-  debug(DEBUG_LEVEL_INFO, "Start Seeking Forward");
-  player->flags.seeking = true;
-  player->flags.seek_dir = 1; 
-  ecore_timer_add(.02, _eplayer_seek_timer, player);
+       debug(DEBUG_LEVEL_INFO, "Start Seeking Forward");
+       player->flags.seeking = true;
+       player->flags.seek_dir = 1; 
+       ecore_timer_add(.02, _eplayer_seek_timer, player);
 }
 
 EDJE_CB(seek_forward_stop) {
-  debug(DEBUG_LEVEL_INFO, "Stop Seeking Forward");
-  player->flags.seeking = false; 
+       debug(DEBUG_LEVEL_INFO, "Stop Seeking Forward");
+       player->flags.seeking = false; 
 }
 
 EDJE_CB(seek_backward_start) {
-  debug(DEBUG_LEVEL_INFO, "Start Seeking Backward");
-  player->flags.seeking = true; 
-  player->flags.seek_dir = -1; 
-  ecore_timer_add(.02, _eplayer_seek_timer, player);
+       debug(DEBUG_LEVEL_INFO, "Start Seeking Backward");
+       player->flags.seeking = true; 
+       player->flags.seek_dir = -1; 
+       ecore_timer_add(.02, _eplayer_seek_timer, player);
 }
 
 EDJE_CB(seek_backward_stop) {
-  debug(DEBUG_LEVEL_INFO, "Stop Seeking Backward");
-  player->flags.seeking = false; 
+       debug(DEBUG_LEVEL_INFO, "Stop Seeking Backward");
+       player->flags.seeking = false; 
 }
 
 EDJE_CB(eplayer_quit) {
@@ -319,6 +319,12 @@
 EDJE_CB(switch_group) {
        ui_deinit_edje(player);
        ui_init_edje(player, src);
+
+       ui_refresh_volume(player);
+       ui_fill_track_info(player);
+
+       playlist_container_set(player->playlist, player->gui.playlist);
+       hilight_current_track(player);
 }
 
 EDJE_CB(update_seeker) {
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- playlist.c  1 Feb 2004 17:34:47 -0000       1.23
+++ playlist.c  3 Feb 2004 22:01:57 -0000       1.24
@@ -1,5 +1,5 @@
 /*
- * $Id: playlist.c,v 1.23 2004/02/01 17:34:47 tsauerbeck Exp $
+ * $Id: playlist.c,v 1.24 2004/02/03 22:01:57 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -36,6 +36,15 @@
        return pl;
 }
 
+void playlist_container_set(PlayList *pl, Evas_Object *container) {
+       Evas_List *l;
+
+       assert(pl);
+
+       for (l = pl->items; l; l = l->next)
+               playlist_item_container_set(l->data, container);
+}
+
 /**
  * Removes all items from a PlayList.
  *
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- playlist.h  1 Feb 2004 13:12:12 -0000       1.14
+++ playlist.h  3 Feb 2004 22:01:57 -0000       1.15
@@ -2,7 +2,7 @@
 #define __PLAYLIST_H
 
 /*
- * $Id: playlist.h,v 1.14 2004/02/01 13:12:12 tsauerbeck Exp $
+ * $Id: playlist.h,v 1.15 2004/02/03 22:01:57 tsauerbeck Exp $
  */
 
 #include <Evas.h>
@@ -24,6 +24,8 @@
                        const char *theme);
 void playlist_free(PlayList *pl);
 
+void playlist_container_set(PlayList *pl, Evas_Object *container);
+
 bool playlist_load_file(PlayList *pl, const char *file, bool append);
 bool playlist_load_dir(PlayList *pl, const char *dir, bool append);
 bool playlist_load_m3u(PlayList *pl, const char *file, bool append);
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist_item.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- playlist_item.c     1 Feb 2004 17:34:47 -0000       1.4
+++ playlist_item.c     3 Feb 2004 22:01:57 -0000       1.5
@@ -1,5 +1,5 @@
 /*
- * $Id: playlist_item.c,v 1.4 2004/02/01 17:34:47 tsauerbeck Exp $
+ * $Id: playlist_item.c,v 1.5 2004/02/03 22:01:57 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -63,7 +63,16 @@
        return NULL;
 }
 
-static bool playlist_item_init(PlayListItem *pli) {
+void playlist_item_container_set(PlayListItem *pli,
+                                 Evas_Object *container) {
+       assert(pli);
+
+       pli->container = container;
+
+       playlist_item_show(pli);
+}
+
+bool playlist_item_show(PlayListItem *pli) {
        char len[32];
        double w = 0, h = 0;
        void *udata;
@@ -98,8 +107,6 @@
        evas_object_data_set(pli->container, "PlaylistFontSize",
                             (void *) (int) h);
 
-       e_container_element_append(pli->container, pli->edje);
-
        udata = evas_object_data_get(pli->container, "ePlayer");
 
        /* add playlist item callbacks */
@@ -114,6 +121,8 @@
        edje_object_signal_callback_add(pli->edje, "PLAYLIST_ITEM_REMOVE", "",
                                        (EdjeCb) cb_playlist_item_remove, udata);
 
+       e_container_element_append(pli->container, pli->edje);
+
        return true;
 }
 
@@ -155,7 +164,7 @@
        pli->container = container;
        pli->theme = theme;
 
-       if (!playlist_item_init(pli)) {
+       if (!playlist_item_show(pli)) {
                playlist_item_free(pli);
                return NULL;
        }
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/playlist_item.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- playlist_item.h     1 Feb 2004 12:03:53 -0000       1.2
+++ playlist_item.h     3 Feb 2004 22:01:57 -0000       1.3
@@ -2,7 +2,7 @@
 #define __PLAYLIST_ITEM_H
 
 /*
- * $Id: playlist_item.h,v 1.2 2004/02/01 12:03:53 tsauerbeck Exp $
+ * $Id: playlist_item.h,v 1.3 2004/02/03 22:01:57 tsauerbeck Exp $
  */
 
 #include <Evas.h>
@@ -36,4 +36,8 @@
                                 const char *theme);
 void playlist_item_free(PlayListItem *pli);
 
+bool playlist_item_show(PlayListItem *pli);
+void playlist_item_container_set(PlayListItem *pli,
+                                 Evas_Object *container);
+
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/track.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- track.c     1 Feb 2004 12:03:53 -0000       1.17
+++ track.c     3 Feb 2004 22:01:57 -0000       1.18
@@ -1,5 +1,5 @@
 /*
- * $Id: track.c,v 1.17 2004/02/01 12:03:53 tsauerbeck Exp $
+ * $Id: track.c,v 1.18 2004/02/03 22:01:57 tsauerbeck Exp $
  */
 
 #include <config.h>
@@ -42,7 +42,6 @@
 int track_update_time(void *udata) {
        ePlayer *player = udata;
        PlayListItem *current_item = playlist_current_item_get(player->playlist);
-       static int old_time = -1;
        int cur_time;
        double song_pos;
 
@@ -52,10 +51,6 @@
        if (player->cfg.time_display == TIME_DISPLAY_LEFT)
                cur_time = current_item->duration - cur_time;
 
-       if (cur_time == old_time) /* value didn't change, so don't update */
-               return 1;
-
-       old_time = cur_time;
        ui_refresh_time(player, cur_time);
        ui_refresh_seeker(player, song_pos);
 




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