Commit 004746d2 authored by Thomas Guillem's avatar Thomas Guillem

playback_service: add get_time/get_pos

parent b612a933
......@@ -421,7 +421,7 @@ playback_service_is_playing(playback_service *p_ps)
}
double
playback_service_get_pos(playback_service *p_ps)
playback_service_get_time(playback_service *p_ps)
{
if (!p_ps->b_started)
return 0.0;
......@@ -429,6 +429,17 @@ playback_service_get_pos(playback_service *p_ps)
return emotion_object_position_get(p_ps->p_e);
}
double
playback_service_get_pos(playback_service *p_ps)
{
if (!p_ps->b_started)
return 0.0;
double i_time = emotion_object_position_get(p_ps->p_e);
double i_len = emotion_object_play_length_get(p_ps->p_e);
return (i_time > 0.0 && i_len > 0.0) ? i_time / i_len : 0.0;
}
double
playback_service_get_len(playback_service *p_ps)
{
......
......@@ -91,6 +91,9 @@ playback_service_pause(playback_service *p_ps);
bool
playback_service_is_playing(playback_service *p_ps);
double
playback_service_get_time(playback_service *p_ps);
double
playback_service_get_pos(playback_service *p_ps);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment