Esempio n. 1
0
static void
enna_mediaplayer_seek(int value , SEEK_TYPE type)
{
    double new_time, old_time, length;

    enna_log(ENNA_MSG_EVENT, NULL, "Seeking to: %d%c",
             value, type == SEEK_ABS_PERCENT ? '%' : 's');

    if (mp->play_state == PAUSE || mp->play_state == PLAYING)
    {
        Enna_Event_Mediaplayer_Seek_Data *ev;

        ev = calloc(1, sizeof(Enna_Event_Mediaplayer_Seek_Data));
        if (!ev)
            return;

        ev->seek_value = value;
        ev->type       = type;

        if(emotion_object_seekable_get(mp->player))
        {
            if(type == SEEK_ABS_PERCENT)
            {
                length = enna_mediaplayer_length_get();
                new_time = (value * length) / 100.0;
            }
            else if(type == SEEK_ABS_SECONDS)
                new_time = (double)value;
            else if(type == SEEK_REL_SECONDS)
            {
                old_time = enna_mediaplayer_position_get();
                new_time = (double)(value) + old_time;
            }
            else
                new_time = 0;
        ecore_event_add(ENNA_EVENT_MEDIAPLAYER_SEEK, ev, NULL, NULL);
            emotion_object_position_set(mp->player, new_time);
        }
        else
        {
            enna_log(ENNA_MSG_EVENT, NULL, "No Seeking avaible");
        }
    }
}
Esempio n. 2
0
static void
_display_info(Evas_Object *o)
{
   int w, h;
   printf("playing: %d\n", emotion_object_play_get(o));
   printf("meta title: %s\n",
	  emotion_object_meta_info_get(o, EMOTION_META_INFO_TRACK_TITLE));
   printf("seek position: %0.3f\n",
	  emotion_object_position_get(o));
   printf("play length: %0.3f\n",
	  emotion_object_play_length_get(o));
   printf("is seekable: %d\n",
	  emotion_object_seekable_get(o));
   emotion_object_size_get(o, &w, &h);
   printf("video geometry: %dx%d\n", w, h);
   printf("video width / height ratio: %0.3f\n",
	  emotion_object_ratio_get(o));
   printf("\n");
}