Enlightenment CVS committal

Author  : moom16
Project : e17
Module  : apps/eclair

Dir     : e17/apps/eclair/src


Modified Files:
        eclair.c eclair_cover.c eclair_media_file.c eclair_playlist.c 
        eclair_utils.c eclair_utils.h 


Log Message:
* Fix the load of urls from a .m3u playlist
* Better support of mrls (e.g. dvd:// or cdda:/1)
* Update the TODO list

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- eclair.c    3 Jul 2005 15:51:06 -0000       1.25
+++ eclair.c    4 Jul 2005 18:33:57 -0000       1.26
@@ -208,7 +208,7 @@
             eclair_all_windows_text_set(eclair, "current_media_name", 
artist_title_string);
             free(artist_title_string);
          }
-         else if (current_file->path && strstr(current_file->path, "://"))
+         else if (current_file->path && 
eclair_utils_uri_is_mrl(current_file->path))
             eclair_all_windows_text_set(eclair, "current_media_name", 
current_file->path);
          else if (current_file->path && (filename = 
ecore_file_get_file(current_file->path)))
             eclair_all_windows_text_set(eclair, "current_media_name", 
filename);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_cover.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- eclair_cover.c      2 Jul 2005 13:04:55 -0000       1.14
+++ eclair_cover.c      4 Jul 2005 18:33:57 -0000       1.15
@@ -669,7 +669,7 @@
       || !(current_file = 
eclair_playlist_current_media_file(&cover_manager->eclair->playlist)))
       return;
 
-   if (strstr(uri, "://"))
+   if (eclair_utils_uri_is_mrl(uri))
    {
       if (!(clean_uri = eclair_utils_remove_uri_special_chars(uri)))
          return;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_media_file.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- eclair_media_file.c 18 Jun 2005 16:00:34 -0000      1.10
+++ eclair_media_file.c 4 Jul 2005 18:33:57 -0000       1.11
@@ -52,7 +52,7 @@
             edje_object_part_text_set(container_object->text, 
"playlist_entry_name", artist_title_string);
             free(artist_title_string);
          }
-         else if (media_file->path && strstr(media_file->path, "://"))
+         else if (media_file->path && 
eclair_utils_uri_is_mrl(media_file->path))
             edje_object_part_text_set(container_object->text, 
"playlist_entry_name", media_file->path);
          else if (media_file->path && (filename = 
ecore_file_get_file(media_file->path)))
             edje_object_part_text_set(container_object->text, 
"playlist_entry_name", filename);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_playlist.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- eclair_playlist.c   3 Jul 2005 15:51:06 -0000       1.18
+++ eclair_playlist.c   4 Jul 2005 18:33:57 -0000       1.19
@@ -70,7 +70,7 @@
 //Set the shuffle mode
 void eclair_playlist_set_shuffle(Eclair_Playlist *playlist, Evas_Bool shuffle)
 {
-   if (!playlist || !playlist->eclair)
+   if (!playlist)
       return;
 
    if (shuffle)
@@ -214,7 +214,7 @@
       for (c = strpbrk(line, "\r\n"); c; c = strpbrk(c, "\r\n"))
          *c = 0;
    
-      if (line[0] == '/')
+      if (eclair_utils_uri_is_mrl(line) || line[0] == '/')
          eclair_playlist_add_uri(playlist, line, 0, autoplay);
       else if (m3u_dir)
       {
@@ -244,7 +244,7 @@
    if (!playlist || !uri || !(eclair = playlist->eclair))
       return 0;
 
-   if (strstr(uri, "://"))
+   if (eclair_utils_uri_is_mrl(uri))
    {
       if (!(clean_uri = eclair_utils_remove_uri_special_chars(uri)))
          return 0;
@@ -260,13 +260,13 @@
    else
       new_path = strdup(uri);
 
-   if (!strstr(new_path, "://") && eclair_playlist_add_dir(playlist, new_path, 
0, autoplay))
+   if (!eclair_utils_uri_is_mrl(new_path) && eclair_playlist_add_dir(playlist, 
new_path, 0, autoplay))
    {
       free(new_path);
       if (update_container)
          eclair_playlist_container_update(eclair->playlist_container);
    }
-   else if (!strstr(new_path, "://") && (ext = 
eclair_utils_file_get_extension(new_path)) && strcmp(ext, "m3u") == 0)
+   else if (!eclair_utils_uri_is_mrl(new_path) && (ext = 
eclair_utils_file_get_extension(new_path)) && strcmp(ext, "m3u") == 0)
    {
       eclair_playlist_add_m3u(playlist, new_path, 0, autoplay);
       free(new_path);
@@ -284,7 +284,7 @@
          if (autoplay)
             eclair_play_current(eclair);
       }
-      if (!strstr(new_media_file->path, "://"))
+      if (!eclair_utils_uri_is_mrl(new_media_file->path))
          eclair_meta_tag_add_file_to_scan(&eclair->meta_tag_manager, 
new_media_file);
    }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_utils.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- eclair_utils.c      2 Jul 2005 23:25:45 -0000       1.9
+++ eclair_utils.c      4 Jul 2005 18:33:57 -0000       1.10
@@ -148,6 +148,21 @@
    return file_without_ext;
 }
 
+//TODO: Do we suppport all the mrl possible?
+//Return 1 if the uri is a mrl (e.g. "dvd://", 
"http://www.domain.com/file.mp3";)
+Evas_Bool eclair_utils_uri_is_mrl(char *uri)
+{
+   if (!uri)
+      return 0;
+
+   if (strstr(uri, "://"))
+      return 1;
+   if (strlen(uri) >= 6 && strncmp(uri, "cdda:/", 6) == 0)
+      return 1;
+
+   return 0;
+}
+
 //Search for a file in the dir root_dir with the name filename, regardless to 
the case
 //Return NULL if no file found, otherwise, the path of the file
 //Returned value has to be freed
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/eclair/src/eclair_utils.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- eclair_utils.h      2 Jul 2005 13:04:55 -0000       1.7
+++ eclair_utils.h      4 Jul 2005 18:33:57 -0000       1.8
@@ -10,6 +10,7 @@
 char *eclair_utils_remove_uri_special_chars(const char *uri);
 char *eclair_utils_file_get_extension(char *file);
 char *eclair_utils_file_get_filename_without_ext(char *file);
+Evas_Bool eclair_utils_uri_is_mrl(char *uri);
 char *eclair_utils_search_file(const char *filename, const char *root_dir);
 int eclair_utils_get_random_int(int min, int max);
 int eclair_utils_get_random_float(float min, float max);




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to