[gimp/wip/animation: 330/373] plug-ins: save the animation playback proxy ratio.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/animation: 330/373] plug-ins: save the animation playback proxy ratio.
- Date: Sat, 7 Oct 2017 02:22:27 +0000 (UTC)
commit 9bae3824ab2da3711f42f3f61e8a30ea733906d7
Author: Jehan <jehan girinstud io>
Date: Tue May 30 20:46:46 2017 +0200
plug-ins: save the animation playback proxy ratio.
plug-ins/animation-play/core/animation-playback.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/animation-play/core/animation-playback.c
b/plug-ins/animation-play/core/animation-playback.c
index f92d4ec..ac53b2e 100644
--- a/plug-ins/animation-play/core/animation-playback.c
+++ b/plug-ins/animation-play/core/animation-playback.c
@@ -271,12 +271,19 @@ gchar *
animation_playback_serialize (AnimationPlayback *playback)
{
gchar *xml;
+ gchar proxy[6];
+ /* Make sure to have a locale-independent string. Also no need to have
+ * useless precision. This should give 3 digits after the decimal point.
+ * More than enough.
+ */
+ g_ascii_dtostr ((gchar*) &proxy, 6, playback->priv->proxy_ratio);
xml = g_strdup_printf ("<playback position=\"%d\" "
- "start=\"%d\" stop=\"%d\"/>",
+ "start=\"%d\" stop=\"%d\" proxy=\"%s\"/>",
playback->priv->position,
playback->priv->start,
- playback->priv->stop);
+ playback->priv->stop,
+ proxy);
return xml;
}
@@ -852,6 +859,11 @@ animation_playback_start_element (GMarkupParseContext *context,
playback->priv->stop_at_end = (stop == duration - 1);
}
}
+ else if (strcmp (*names, "proxy") == 0 && **values)
+ {
+ gdouble ratio = g_ascii_strtod (*values, NULL);
+ animation_playback_set_proxy (playback, ratio);
+ }
names++;
values++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]