Enlightenment CVS committal

Author  : tsauerbeck
Project : misc
Module  : eplayer

Dir     : misc/eplayer/src


Modified Files:
        callbacks.c vorbis.c 


Log Message:
cb_track_next() silently moves to the beginning of the playlist now, without starting 
playback. cb_track_prev() does nothing when it's called on the beginning of the 
playlist. track_open() now initializes the time_text part.
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/callbacks.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- callbacks.c 17 Oct 2003 23:46:20 -0000      1.5
+++ callbacks.c 18 Oct 2003 15:24:30 -0000      1.6
@@ -36,6 +36,15 @@
        paused = !paused;
 }
 
+/**
+ * Moves to the next track and plays it, except when we're going
+ * back to the beginning of the playlist.
+ *
+ * @param player
+ * @param e
+ * @param obj
+ * @param event_info
+ */
 void cb_track_next(ePlayer *player, Evas *e, Evas_Object *obj,
                    void *event_info) {
 #ifdef DEBUG
@@ -44,27 +53,16 @@
 
        eplayer_playback_stop(player, 0);
 
-       /* Get the next list item */
-       player->playlist->cur_item = player->playlist->cur_item->next;
-       
-       if (!player->playlist->cur_item) {
-#ifdef DEBUG
-               printf("\n\nDEBUG: Youve hit the end of the list!!! \n\n");
-#endif
-
-               edje_object_part_text_set(player->gui.edje, "artist_name", 
"*****************************");
-               edje_object_part_text_set(player->gui.edje, "album_name", " END OF THE 
ROAD ");
-               edje_object_part_text_set(player->gui.edje, "song_name", 
"*****************************");
-               edje_object_part_text_set(player->gui.edje, "time_text", "DAS:EN:DE");
-               
-               /* Since we hit the end, start from the beginning. */
+       if (player->playlist->cur_item->next) {
+               player->playlist->cur_item = player->playlist->cur_item->next;
+               eplayer_playback_start(player, 1);
+       } else {
+               /* there's no next item, so move to the beginning again
+                * but don't start playing yet.
+                */
                player->playlist->cur_item = player->playlist->items;
-
-               return;
-       } 
-       
-       /* Start the play loop */
-       eplayer_playback_start(player, 1);
+               track_open(player); /* refresh track info parts */
+       }
 }
 
 void cb_track_prev(ePlayer *player, Evas *e, Evas_Object *obj,
@@ -73,15 +71,15 @@
        printf("DEBUG: Previous File Called\n");
 #endif
 
-       eplayer_playback_stop(player, 0);
-
-       /* Get the previous list item */
+       /* first item on the list: do nothing */
        if (!player->playlist->cur_item->prev)
                return;
 
+       eplayer_playback_stop(player, 0);
+       
+       /* Get the previous list item */
        player->playlist->cur_item = player->playlist->cur_item->prev;
 
-       /* Start the play loop */
        eplayer_playback_start(player, 1);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/eplayer/src/vorbis.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- vorbis.c    17 Oct 2003 23:46:20 -0000      1.8
+++ vorbis.c    18 Oct 2003 15:24:30 -0000      1.9
@@ -110,6 +110,7 @@
        edje_object_part_text_set(player->gui.edje, "song_name", pli->title);
        edje_object_part_text_set(player->gui.edje, "artist_name", pli->artist);
        edje_object_part_text_set(player->gui.edje, "album_name", pli->album);
+       edje_object_part_text_set(player->gui.edje, "time_text", "0:00");
 
        setup_ao(player);
 }




-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to