r691 - trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep

jiang_li at sita.openmoko.org jiang_li at sita.openmoko.org
Tue Feb 6 10:18:29 CET 2007


Author: jiang_li
Date: 2007-02-06 10:18:21 +0100 (Tue, 06 Feb 2007)
New Revision: 691

Modified:
   trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/Makefile.am
   trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/main.c
   trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/mainwin.c
Log:
This commit has done the following things:
1)   change the method of init_image_dir() to fix the bug 158
2)   change the default music folder to "/music"
3)   add a link of stdc++ to the beep/Makefile.am to support id3lib3-3.8 (I meet the link error on mandriva 2007)


Modified: trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/Makefile.am	2007-02-06 08:09:39 UTC (rev 690)
+++ trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/Makefile.am	2007-02-06 09:18:21 UTC (rev 691)
@@ -7,6 +7,7 @@
 
 beep_LDFLAGS = -export-dynamic
 beep_LDADD = -lid3 \
+             -lstdc++\
 	$(X_LIBS) $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) \
 	$(GTK_LIBS)      \
 	$(DBUS_LIBS)      \

Modified: trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/main.c	2007-02-06 08:09:39 UTC (rev 690)
+++ trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/main.c	2007-02-06 09:18:21 UTC (rev 691)
@@ -1089,8 +1089,8 @@
     
     /*added by lijiang*/
     playlist_clear();
-    gchar *audio_path = g_build_filename(g_get_home_dir(), "audio", NULL);
-    playlist_add_dir(audio_path);
+//    gchar *audio_path = g_build_filename(g_get_home_dir(), "audio", NULL);
+    playlist_add_dir("/music");
     g_free(audio_path);
    
     openmoko_mainwin_create();

Modified: trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/mainwin.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/mainwin.c	2007-02-06 08:09:39 UTC (rev 690)
+++ trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/beep/mainwin.c	2007-02-06 09:18:21 UTC (rev 691)
@@ -3658,6 +3658,13 @@
     pos = playlist_get_position();
     filename = playlist_get_filename(pos);
     
+    if(!filename)
+    {
+	openmoko_set_title(NULL);
+	openmoko_set_artist(NULL);
+	return;
+    }
+    
     char* surfix = strrchr(filename, '.');
     if(!strcmp(surfix+1, "mp3"))
     {
@@ -3877,6 +3884,9 @@
 void 
 openmoko_play_pause_action()
 {
+    if(playlist_get_length() == 0)
+	return;
+	
     if(!playorpause)
     {
         mainwin_play_pushed();
@@ -4159,20 +4169,11 @@
 
 void init_image_dir()
 {
-    gchar* skin_path;	
-    ConfigDb* db;
-    db = bmp_cfg_db_open();
-    bmp_cfg_db_get_string(db, "beep", "skin", &skin_path);
-    bmp_cfg_db_close(db); 
-
-    gchar* share_string = g_strrstr(skin_path, "share");
-
-    int len = strlen(skin_path);  
+    gchar* share_string = g_strrstr(DATA_DIR, "share");
+    int len = strlen(DATA_DIR);  
     int len1= strlen(share_string);
-    gchar* prefix = g_strndup(skin_path, len-len1 +5);
-    images_dir = g_strdup(g_strconcat(prefix, "/images", NULL));
-    
-    g_free(skin_path);
+    gchar* prefix = g_strndup(DATA_DIR, len-len1 +5);
+    images_dir = g_build_filename(prefix, "/images", NULL));
     g_free(prefix);
 }
 





More information about the commitlog mailing list