aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCody Russell <crussell@canonical.com>2010-07-22 14:21:06 +0200
committerCody Russell <crussell@canonical.com>2010-07-22 14:21:06 +0200
commit47fbcc208c075126fe3e3e8567937dbff71ead9c (patch)
treea71e64026450837b4046580adaa15ddcd06ad9b9 /src
parent91975606424c3926d46344fdf3775eab11529bb2 (diff)
downloadayatana-ido-47fbcc208c075126fe3e3e8567937dbff71ead9c.tar.gz
ayatana-ido-47fbcc208c075126fe3e3e8567937dbff71ead9c.tar.bz2
ayatana-ido-47fbcc208c075126fe3e3e8567937dbff71ead9c.zip
ido_timeline_set_progress()
Diffstat (limited to 'src')
-rw-r--r--src/idotimeline.c21
-rw-r--r--src/idotimeline.h2
2 files changed, 23 insertions, 0 deletions
diff --git a/src/idotimeline.c b/src/idotimeline.c
index bcf875b..e3c32a9 100644
--- a/src/idotimeline.c
+++ b/src/idotimeline.c
@@ -688,6 +688,27 @@ ido_timeline_get_progress (IdoTimeline *timeline)
return priv->progress;
}
+void
+ido_timeline_set_progress (IdoTimeline *timeline, gdouble progress)
+{
+ IdoTimelinePriv *priv;
+
+ g_return_if_fail (IDO_IS_TIMELINE (timeline));
+
+ priv = IDO_TIMELINE_GET_PRIV (timeline);
+
+ if (priv->source_id)
+ {
+ g_timer_stop (priv->timer);
+ g_source_remove (priv->source_id);
+ priv->source_id = 0;
+ }
+
+ priv->progress = progress;
+
+ ido_timeline_start (timeline);
+}
+
gdouble
ido_timeline_calculate_progress (gdouble linear_progress,
IdoTimelineProgressType progress_type)
diff --git a/src/idotimeline.h b/src/idotimeline.h
index 66f96a3..5df6b97 100644
--- a/src/idotimeline.h
+++ b/src/idotimeline.h
@@ -104,6 +104,8 @@ void ido_timeline_set_direction (IdoTimeline
IdoTimelineDirection direction);
gdouble ido_timeline_get_progress (IdoTimeline *timeline);
+void ido_timeline_set_progress (IdoTimeline *timeline,
+ gdouble progress);
gdouble ido_timeline_calculate_progress (gdouble linear_progress,
IdoTimelineProgressType progress_type);