Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : apps/euphoria

Dir     : e17/apps/euphoria/src


Modified Files:
        interface.c playlist_item.c playlist_item.h 


Log Message:
fixed samplerate and bitrate parts
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/interface.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- interface.c 28 Feb 2004 04:52:53 -0000      1.4
+++ interface.c 28 Feb 2004 09:36:26 -0000      1.5
@@ -1,5 +1,5 @@
 /*
- * $Id: interface.c,v 1.4 2004/02/28 04:52:53 atmosphere Exp $
+ * $Id: interface.c,v 1.5 2004/02/28 09:36:26 tsauerbeck Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -180,38 +180,32 @@
 
 void ui_fill_track_info(Euphoria *e, PlayListItem *pli) {
        char *tmp;
-#if 0
        char buf[32];
-#endif
 
        /* XMMS should fill these for us! */
        if (!(tmp = (char *) playlist_item_title_get(pli)))
                tmp = "Unknown";
-       
+
        edje_object_part_text_set(e->gui.edje, "song_name", tmp);
 
        if (!(tmp = (char *) playlist_item_artist_get(pli)))
                tmp = "Unknown";
 
        edje_object_part_text_set(e->gui.edje, "artist_name", tmp);
-       
+
        if (!(tmp = (char *) playlist_item_album_get(pli)))
                tmp = "Unknown";
 
        edje_object_part_text_set(e->gui.edje, "album_name", tmp);
 
        /* sample rate */
-#if 0
        snprintf(buf, sizeof(buf), "%.1f",
-                (float) pli->samplerate / 1000);
-       edje_object_part_text_set(e->gui.edje, "track_samplerate",
-                                 buf);
+                (float) playlist_item_samplerate_get(pli) / 1000);
+       edje_object_part_text_set(e->gui.edje, "track_samplerate", buf);
 
        /* bitrate */
-       snprintf(buf, sizeof(buf), "%i", pli->bitrate / 1000);
-       edje_object_part_text_set(e->gui.edje, "track_bitrate",
-                                 buf);
-#endif
+       snprintf(buf, sizeof(buf), "%i", playlist_item_bitrate_get(pli));
+       edje_object_part_text_set(e->gui.edje, "track_bitrate", buf);
 }
 
 bool ui_init_edje(Euphoria *e, const char *name) {
@@ -251,7 +245,7 @@
 
        setup_playlist(e);
        ui_refresh_volume(e);
-       if(e->playlist && e->playlist->current_item) 
+       if(e->playlist && e->playlist->current_item)
            ui_fill_track_info(e, e->playlist->current_item);
 
        register_callbacks(e);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/playlist_item.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- playlist_item.c     27 Feb 2004 23:15:27 -0000      1.4
+++ playlist_item.c     28 Feb 2004 09:36:26 -0000      1.5
@@ -1,5 +1,5 @@
 /*
- * $Id: playlist_item.c,v 1.4 2004/02/27 23:15:27 tsauerbeck Exp $
+ * $Id: playlist_item.c,v 1.5 2004/02/28 09:36:26 tsauerbeck Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -33,6 +33,24 @@
                return 0;
 }
 
+unsigned int playlist_item_samplerate_get(PlayListItem *pli) {
+       void *tmp;
+
+       if ((tmp = x_hash_lookup(pli->properties, "samplerate")))
+               return atoi(tmp);
+       else
+               return 0;
+}
+
+unsigned int playlist_item_bitrate_get(PlayListItem *pli) {
+       void *tmp;
+
+       if ((tmp = x_hash_lookup(pli->properties, "bitrate")))
+               return atoi(tmp);
+       else
+               return 0;
+}
+
 /**
  * Frees a PlayListItem object.
  *
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/src/playlist_item.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- playlist_item.h     27 Feb 2004 21:55:33 -0000      1.2
+++ playlist_item.h     28 Feb 2004 09:36:26 -0000      1.3
@@ -2,7 +2,7 @@
 #define __PLAYLIST_ITEM_H
 
 /*
- * $Id: playlist_item.h,v 1.2 2004/02/27 21:55:33 tsauerbeck Exp $
+ * $Id: playlist_item.h,v 1.3 2004/02/28 09:36:26 tsauerbeck Exp $
  * vim:noexpandtab:sw=4:sts=4:ts=4
  */
 
@@ -34,5 +34,7 @@
 const char *playlist_item_title_get(PlayListItem *pli);
 const char *playlist_item_album_get(PlayListItem *pli);
 unsigned int playlist_item_duration_get(PlayListItem *pli);
+unsigned int playlist_item_samplerate_get(PlayListItem *pli);
+unsigned int playlist_item_bitrate_get(PlayListItem *pli);
 
 #endif




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