group {
name, "elm/gengrid/item/style.gallery/default";
data.item, "focus_highlight" "on";
- data.item, "text" "part.thumb.text";
+ data.item, "texts" "part.thumb.text";
data.item, "contents" "part.thumb.icon part.thumb.play.icon";
parts {
part {
static char *_text_get(void *data, Evas_Object *obj, const char *part)
{
app_media *am;
+ int duration, h, m, s, sec;
+ char str[SIZE_STR];
if (!data) {
_ERR("Data is NULL.");
}
am = data;
- return strdup(get_media_name(am));
+ if (get_media_type(am) != MEDIA_CONTENT_TYPE_VIDEO)
+ return NULL;
+
+ duration = get_media_duration(am);
+
+ sec = duration / 1000;
+ h = sec / 3600;
+ m = (sec % 3600) / 60;
+ s = sec % 60;
+
+ if (h)
+ snprintf(str, sizeof(str), "%d:%02d:%02d", h, m, s);
+ else
+ snprintf(str, sizeof(str), "%d:%02d", m, s);
+
+ return strdup(str);
}
static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part)
{
app_media *am;
- Evas_Object *icon, *img;
- char *thumbnail;
+ Evas_Object *img;
+ char *img_path;
if (!data || !obj) {
_ERR("Invalid argument.");
am = data;
if (!strcmp(part, PART_THUMB_ICON)) {
- thumbnail = get_media_thumbnail(am);
-
- if (!thumbnail) {
- icon = elm_icon_add(obj);
- if (!icon) {
- _ERR("elm_icon_add failed.");
- return NULL;
- }
-
- elm_icon_thumb_set(icon, get_media_path(am), NULL);
- elm_image_aspect_fixed_set(icon, EINA_FALSE);
-
- return icon;
- }
+ img_path = get_media_thumbnail(am);
+ if (!img_path)
+ img_path = DEFAULT_IMAGE_PNG;
img = elm_image_add(obj);
if (!img) {
return NULL;
}
- elm_image_file_set(img, thumbnail, NULL);
+ elm_image_file_set(img, img_path, NULL);
elm_image_aspect_fixed_set(img, EINA_FALSE);
evas_object_show(img);