raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=cf2b383f0cba9fb2a84bbe5fabf3da454f8dc2d5

commit cf2b383f0cba9fb2a84bbe5fabf3da454f8dc2d5
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Apr 3 23:36:23 2020 +0100

    fix up album art if it's in the music file itself and not fetched
---
 src/bin/video.c |  1 -
 src/bin/win.c   | 36 +++++++++++++++++++++++++++---------
 src/bin/win.h   |  2 ++
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/src/bin/video.c b/src/bin/video.c
index 581a1a2..03744d4 100644
--- a/src/bin/video.c
+++ b/src/bin/video.c
@@ -666,7 +666,6 @@ video_file_set(Evas_Object *obj, const char *file)
         eina_stringshare_replace(&(sd->artfile), NULL);
         emotion_object_file_set(sd->o_vid, sd->file);
         video_position_set(obj, 0.0);
-        printf("set %p %s %i\n", obj, file, sd->doart);
         if (sd->doart)
           {
              const char *extn = strchr(sd->file, '.');
diff --git a/src/bin/win.c b/src/bin/win.c
index ba4c8cf..5086ec9 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -235,13 +235,13 @@ _local_artwork_get(void *data)
 {
    Evas_Object *win = data;
    Inf *inf = evas_object_data_get(win, "inf");
-   
+
    if (!inf) return EINA_FALSE;
    if (!inf->vid) return EINA_FALSE;
-   
+
    const char *file = NULL;
    const char *filename = video_file_get(inf->vid);
-   
+
    Efreet_Uri *uri = efreet_uri_decode(filename);
    if (uri)
      {
@@ -267,7 +267,7 @@ _local_artwork_get(void *data)
 
              Evas_Object *artwork = video_meta_artwork_get(inf->vid, file, 
EMOTION_ARTWORK_PREVIEW_IMAGE);
              if (!artwork) artwork = video_meta_artwork_get(inf->vid, file, 
EMOTION_ARTWORK_IMAGE);
-            
+
              if (artwork)
                {
                   evas_object_image_save(artwork, path, NULL, NULL);
@@ -281,7 +281,6 @@ _local_artwork_get(void *data)
                }
           }
       }
-  
 
    return EINA_TRUE;
 }
@@ -420,6 +419,7 @@ static void
 _restart_vid(Evas_Object *win, Evas_Object *lay, Evas_Object *vid, const char 
*file, const char *sub)
 {
    const char *extn = strchr(file, '.');
+   win_newfile(win);
    if ((extn) &&
        ((!strcasecmp(extn, ".mp3")) ||
         (!strcasecmp(extn, ".m4a")) ||
@@ -766,6 +766,13 @@ win_art(Evas_Object *win, const char *path)
      }
 }
 
+void
+win_newfile(Evas_Object *win)
+{
+   Inf *inf = evas_object_data_get(win, "inf");
+   inf->newfile = EINA_TRUE;
+}
+
 void
 win_show(Evas_Object *win, int w, int h)
 {
@@ -789,13 +796,24 @@ win_show(Evas_Object *win, int w, int h)
      }
 
    if (!video_has_video_get(inf->vid))
-     elm_layout_signal_emit(inf->lay, "state,novideo", "rage");
+     {
+        if (inf->newfile)
+          elm_layout_signal_emit(inf->lay, "state,novideo", "rage");
+     }
    else
-     elm_layout_signal_emit(inf->lay, "state,video", "rage");
+     {
+        elm_layout_signal_emit(inf->lay, "state,video", "rage");
+     }
    if (!video_has_audio_get(inf->vid))
-     elm_layout_signal_emit(inf->lay, "state,noaudio", "rage");
+     {
+        if (inf->newfile)
+          elm_layout_signal_emit(inf->lay, "state,noaudio", "rage");
+     }
    else
-     elm_layout_signal_emit(inf->lay, "state,audio", "rage");
+     {
+        elm_layout_signal_emit(inf->lay, "state,audio", "rage");
+     }
+   inf->newfile = EINA_FALSE;
 }
 
 void
diff --git a/src/bin/win.h b/src/bin/win.h
index c41ee0e..68a2deb 100644
--- a/src/bin/win.h
+++ b/src/bin/win.h
@@ -27,6 +27,7 @@ struct _Inf
    Eina_Bool dragging : 1;
    Eina_Bool browse_mode : 1;
    Eina_Bool down : 1;
+   Eina_Bool newfile : 1;
 };
 
 // ui high level controls
@@ -49,6 +50,7 @@ Eina_Bool win_video_have_prev(Evas_Object *win);
 Evas_Object *win_add(void);
 void win_focus(Evas_Object *win);
 void win_title_update(Evas_Object *win);
+void win_newfile(Evas_Object *win);
 void win_show(Evas_Object *win, int w, int h);
 void win_art(Evas_Object *win, const char *path);
 void win_aspect_adjust(Evas_Object *win);

-- 


Reply via email to