albumart - fix albumart display if paths are uri's

@fix
v-0.4.0
Carsten Haitzler 6 years ago
parent 253c1bbcdc
commit 313dda5f2d
  1. 20
      src/bin/video.c
  2. 1
      src/bin/videothumb.c
  3. 58
      src/bin/win.c

@ -86,7 +86,10 @@ _art_check(Evas_Object *obj)
free(thumb);
}
}
else evas_object_hide(sd->o_img);
else
{
evas_object_hide(sd->o_img);
}
}
static void
@ -97,8 +100,16 @@ _cb_vid_frame(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
if (!sd) return;
evas_object_geometry_get(data, &ox, &oy, &ow, &oh);
evas_object_show(sd->o_vid);
evas_object_hide(sd->o_img);
if (!emotion_object_video_handled_get(sd->o_vid))
{
evas_object_hide(sd->o_vid);
evas_object_show(sd->o_img);
}
else
{
evas_object_show(sd->o_vid);
evas_object_hide(sd->o_img);
}
evas_object_show(sd->clip);
_ob_resize(data, ox, oy, ow, oh);
evas_object_smart_callback_call(data, "frame_decode", NULL);
@ -292,7 +303,8 @@ _ob_resize(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coor
sd->pih = sd->ih;
evas_object_smart_callback_call(obj, "frame_resize", NULL);
}
if ((sd->tw > 0) && (sd->th > 0) && (sd->doart))
if ((sd->tw > 0) && (sd->th > 0) && (sd->doart) &&
(!emotion_object_video_handled_get(sd->o_vid)))
{
int iw, ih;

@ -276,6 +276,7 @@ _videothumb_image_load(Evas_Object *obj)
if (sd->poster_mode)
{
artfile = albumart_file_get(sd->realpath);
printf("artfile for %s = %s\n", sd->realpath, artfile);
if (artfile)
{
if (ecore_file_exists(artfile))

@ -185,7 +185,22 @@ _cb_fetched(void *data)
file = video_file_get(inf->vid);
if (file)
{
char *realfile = ecore_file_realpath(file);
char *realfile = NULL;
if (!strncasecmp(file, "file:/", 6))
{
Efreet_Uri *uri = efreet_uri_decode(file);
if (uri)
{
realfile = ecore_file_realpath(uri->path);
efreet_uri_free(uri);
}
}
else if ((!strncasecmp(file, "http:/", 6)) ||
(!strncasecmp(file, "https:/", 7)))
realfile = strdup(file);
else
realfile = ecore_file_realpath(file);
if (realfile)
{
char *path = albumart_file_get(realfile);
@ -617,24 +632,33 @@ win_art(Evas_Object *win, const char *path)
if (inf->artimg)
{
evas_object_del(inf->artimg);
inf->artimg = NULL;
}
inf->artimg = evas_object_image_filled_add(evas_object_evas_get(win));
evas_object_image_file_set(inf->artimg, path, NULL);
evas_object_image_size_get(inf->artimg, &iw, &ih);
if ((iw > 0) && (ih > 0))
{
evas_object_size_hint_aspect_set(inf->artimg,
EVAS_ASPECT_CONTROL_NEITHER,
iw, ih);
elm_object_part_content_set(inf->lay, "rage.art", inf->artimg);
elm_layout_signal_emit(inf->lay, "state,art", "rage");
const char *path2;
evas_object_image_file_get(inf->artimg, &path2, NULL);
if ((!path2) || (strcmp(path, path2)))
{
evas_object_del(inf->artimg);
inf->artimg = NULL;
}
}
else
if (!inf->artimg)
{
evas_object_del(inf->artimg);
inf->artimg = NULL;
inf->artimg = evas_object_image_filled_add(evas_object_evas_get(win));
evas_object_image_file_set(inf->artimg, path, NULL);
evas_object_image_size_get(inf->artimg, &iw, &ih);
if ((iw > 0) && (ih > 0))
{
evas_object_size_hint_aspect_set(inf->artimg,
EVAS_ASPECT_CONTROL_NEITHER,
iw, ih);
elm_object_part_content_set(inf->lay, "rage.art", inf->artimg);
elm_layout_signal_emit(inf->lay, "state,art", "rage");
}
else
{
evas_object_del(inf->artimg);
inf->artimg = NULL;
}
}
}
}

Loading…
Cancel
Save