titlesource: use x/yabsolute instead of x/ypos.

This commit is contained in:
Lubosz Sarnecki 2016-03-11 12:45:37 +01:00 committed by Thibault Saunier
parent 61c25a312f
commit c4356db40c
5 changed files with 43 additions and 43 deletions

View file

@ -68,8 +68,8 @@ make_overlay (char *text, guint64 start, guint64 duration, gint priority,
"priority", (guint32) priority, "priority", (guint32) priority,
"in-point", (guint64) 0, "in-point", (guint64) 0,
"color", (guint32) color, "color", (guint32) color,
"valignment", (gint) GES_TEXT_VALIGN_POSITION, "valignment", (gint) GES_TEXT_VALIGN_ABSOLUTE,
"halignment", (gint) GES_TEXT_HALIGN_POSITION, "halignment", (gint) GES_TEXT_HALIGN_ABSOLUTE,
"xpos", (gdouble) xpos, "ypos", (gdouble) ypos, NULL); "xpos", (gdouble) xpos, "ypos", (gdouble) ypos, NULL);
return ret; return ret;

View file

@ -420,8 +420,8 @@ ges_text_valign_get_type (void)
{GES_TEXT_VALIGN_BASELINE, "GES_TEXT_VALIGN_BASELINE", "baseline"}, {GES_TEXT_VALIGN_BASELINE, "GES_TEXT_VALIGN_BASELINE", "baseline"},
{GES_TEXT_VALIGN_BOTTOM, "GES_TEXT_VALIGN_BOTTOM", "bottom"}, {GES_TEXT_VALIGN_BOTTOM, "GES_TEXT_VALIGN_BOTTOM", "bottom"},
{GES_TEXT_VALIGN_TOP, "GES_TEXT_VALIGN_TOP", "top"}, {GES_TEXT_VALIGN_TOP, "GES_TEXT_VALIGN_TOP", "top"},
{GES_TEXT_VALIGN_POSITION, "GES_TEXT_VALIGN_POSITION", "position"},
{GES_TEXT_VALIGN_CENTER, "GES_TEXT_VALIGN_CENTER", "center"}, {GES_TEXT_VALIGN_CENTER, "GES_TEXT_VALIGN_CENTER", "center"},
{GES_TEXT_VALIGN_ABSOLUTE, "GES_TEXT_VALIGN_ABSOLUTE", "absolute"},
{0, NULL, NULL}, {0, NULL, NULL},
}; };
@ -442,7 +442,7 @@ ges_text_halign_get_type (void)
{GES_TEXT_HALIGN_LEFT, "GES_TEXT_HALIGN_LEFT", "left"}, {GES_TEXT_HALIGN_LEFT, "GES_TEXT_HALIGN_LEFT", "left"},
{GES_TEXT_HALIGN_CENTER, "GES_TEXT_HALIGN_CENTER", "center"}, {GES_TEXT_HALIGN_CENTER, "GES_TEXT_HALIGN_CENTER", "center"},
{GES_TEXT_HALIGN_RIGHT, "GES_TEXT_HALIGN_RIGHT", "right"}, {GES_TEXT_HALIGN_RIGHT, "GES_TEXT_HALIGN_RIGHT", "right"},
{GES_TEXT_HALIGN_POSITION, "GES_TEXT_HALIGN_POSITION", "position"}, {GES_TEXT_HALIGN_ABSOLUTE, "GES_TEXT_HALIGN_ABSOLUTE", "absolute"},
{0, NULL, NULL}, {0, NULL, NULL},
}; };

View file

@ -235,11 +235,11 @@ GType ges_video_standard_transition_type_get_type (void);
* Vertical alignment of the text. * Vertical alignment of the text.
*/ */
typedef enum { typedef enum {
GES_TEXT_VALIGN_BASELINE, GES_TEXT_VALIGN_BASELINE = 0,
GES_TEXT_VALIGN_BOTTOM, GES_TEXT_VALIGN_BOTTOM = 1,
GES_TEXT_VALIGN_TOP, GES_TEXT_VALIGN_TOP = 2,
GES_TEXT_VALIGN_POSITION, GES_TEXT_VALIGN_CENTER = 4,
GES_TEXT_VALIGN_CENTER GES_TEXT_VALIGN_ABSOLUTE = 5,
} GESTextVAlign; } GESTextVAlign;
#define DEFAULT_VALIGNMENT GES_TEXT_VALIGN_BASELINE #define DEFAULT_VALIGNMENT GES_TEXT_VALIGN_BASELINE
@ -262,7 +262,7 @@ typedef enum {
GES_TEXT_HALIGN_LEFT = 0, GES_TEXT_HALIGN_LEFT = 0,
GES_TEXT_HALIGN_CENTER = 1, GES_TEXT_HALIGN_CENTER = 1,
GES_TEXT_HALIGN_RIGHT = 2, GES_TEXT_HALIGN_RIGHT = 2,
GES_TEXT_HALIGN_POSITION = 4 GES_TEXT_HALIGN_ABSOLUTE = 5
} GESTextHAlign; } GESTextHAlign;
#define DEFAULT_HALIGNMENT GES_TEXT_HALIGN_CENTER #define DEFAULT_HALIGNMENT GES_TEXT_HALIGN_CENTER

View file

@ -106,8 +106,8 @@ struct _GESTitleSourcePrivate
GESTextVAlign valign; GESTextVAlign valign;
guint32 color; guint32 color;
guint32 background; guint32 background;
gdouble xpos; gdouble xabsolute;
gdouble ypos; gdouble yabsolute;
GstElement *text_el; GstElement *text_el;
GstElement *background_el; GstElement *background_el;
}; };
@ -181,8 +181,8 @@ ges_title_source_init (GESTitleSource * self)
self->priv->valign = DEFAULT_VALIGNMENT; self->priv->valign = DEFAULT_VALIGNMENT;
self->priv->color = G_MAXUINT32; self->priv->color = G_MAXUINT32;
self->priv->background = G_MAXUINT32; self->priv->background = G_MAXUINT32;
self->priv->xpos = 0.5; self->priv->xabsolute = 0.5;
self->priv->ypos = 0.5; self->priv->yabsolute = 0.5;
self->priv->background_el = NULL; self->priv->background_el = NULL;
} }
@ -241,7 +241,7 @@ ges_title_source_create_source (GESTrackElement * object)
GESTitleSourcePrivate *priv = self->priv; GESTitleSourcePrivate *priv = self->priv;
const gchar *bg_props[] = { "pattern", "foreground-color", NULL }; const gchar *bg_props[] = { "pattern", "foreground-color", NULL };
const gchar *text_props[] = { "text", "font-desc", "valignment", "halignment", const gchar *text_props[] = { "text", "font-desc", "valignment", "halignment",
"color", "xpos", "ypos", "outline-color", "shaded-background", "color", "x-absolute", "y-absolute", "outline-color", "shaded-background",
"text-x", "text-y", "text-width", "text-height", NULL "text-x", "text-y", "text-width", "text-height", NULL
}; };
@ -258,8 +258,8 @@ ges_title_source_create_source (GESTrackElement * object)
g_object_set (text, "valignment", (gint) priv->valign, "halignment", g_object_set (text, "valignment", (gint) priv->valign, "halignment",
(gint) priv->halign, NULL); (gint) priv->halign, NULL);
g_object_set (text, "color", (guint) self->priv->color, NULL); g_object_set (text, "color", (guint) self->priv->color, NULL);
g_object_set (text, "xpos", (gdouble) self->priv->xpos, NULL); g_object_set (text, "x-absolute", (gdouble) self->priv->xabsolute, NULL);
g_object_set (text, "ypos", (gdouble) self->priv->ypos, NULL); g_object_set (text, "y-absolute", (gdouble) self->priv->yabsolute, NULL);
g_object_set (background, "pattern", (gint) GES_VIDEO_TEST_PATTERN_SOLID, g_object_set (background, "pattern", (gint) GES_VIDEO_TEST_PATTERN_SOLID,
@ -406,37 +406,37 @@ ges_title_source_set_background_color (GESTitleSource * self, guint32 color)
} }
/** /**
* ges_title_source_set_xpos: * ges_title_source_set_xabsolute:
* @self: the #GESTitleSource* to set * @self: the #GESTitleSource* to set
* @position: the horizontal position @self is being set to * @position: the horizontal position @self is being set to
* *
* Sets the horizontal position of the text. * Sets the horizontal position of the text.
*/ */
void void
ges_title_source_set_xpos (GESTitleSource * self, gdouble position) ges_title_source_set_xabsolute (GESTitleSource * self, gdouble position)
{ {
GST_DEBUG ("self:%p, xpos:%f", self, position); GST_DEBUG ("self:%p, x-absolute:%f", self, position);
self->priv->xpos = position; self->priv->xabsolute = position;
if (self->priv->text_el) if (self->priv->text_el)
g_object_set (self->priv->text_el, "xpos", position, NULL); g_object_set (self->priv->text_el, "x-absolute", position, NULL);
} }
/** /**
* ges_title_source_set_ypos: * ges_title_source_set_yabsolute:
* @self: the #GESTitleSource* to set * @self: the #GESTitleSource* to set
* @position: the color @self is being set to * @position: the color @self is being set to
* *
* Sets the vertical position of the text. * Sets the vertical position of the text.
*/ */
void void
ges_title_source_set_ypos (GESTitleSource * self, gdouble position) ges_title_source_set_yabsolute (GESTitleSource * self, gdouble position)
{ {
GST_DEBUG ("self:%p, ypos:%f", self, position); GST_DEBUG ("self:%p, y-absolute:%f", self, position);
self->priv->ypos = position; self->priv->yabsolute = position;
if (self->priv->text_el) if (self->priv->text_el)
g_object_set (self->priv->text_el, "ypos", position, NULL); g_object_set (self->priv->text_el, "y-absolute", position, NULL);
} }
/** /**
@ -555,7 +555,7 @@ ges_title_source_get_background_color (GESTitleSource * source)
} }
/** /**
* ges_title_source_get_xpos: * ges_title_source_get_xabsolute:
* @source: a #GESTitleSource * @source: a #GESTitleSource
* *
* Get the horizontal position used by @source. * Get the horizontal position used by @source.
@ -563,18 +563,18 @@ ges_title_source_get_background_color (GESTitleSource * source)
* Returns: The horizontal position used by @source. * Returns: The horizontal position used by @source.
*/ */
const gdouble const gdouble
ges_title_source_get_xpos (GESTitleSource * source) ges_title_source_get_xabsolute (GESTitleSource * source)
{ {
gdouble xpos; gdouble xabsolute;
ges_track_element_get_child_properties (GES_TRACK_ELEMENT (source), "xpos", ges_track_element_get_child_properties (GES_TRACK_ELEMENT (source),
&xpos, NULL); "x-absolute", &xabsolute, NULL);
return xpos; return xabsolute;
} }
/** /**
* ges_title_source_get_ypos: * ges_title_source_get_yabsolute:
* @source: a #GESTitleSource * @source: a #GESTitleSource
* *
* Get the vertical position used by @source. * Get the vertical position used by @source.
@ -582,14 +582,14 @@ ges_title_source_get_xpos (GESTitleSource * source)
* Returns: The vertical position used by @source. * Returns: The vertical position used by @source.
*/ */
const gdouble const gdouble
ges_title_source_get_ypos (GESTitleSource * source) ges_title_source_get_yabsolute (GESTitleSource * source)
{ {
gdouble ypos; gdouble yabsolute;
ges_track_element_get_child_properties (GES_TRACK_ELEMENT (source), "ypos", ges_track_element_get_child_properties (GES_TRACK_ELEMENT (source),
&ypos, NULL); "y-absolute", &yabsolute, NULL);
return ypos; return yabsolute;
} }
/** /**

View file

@ -92,9 +92,9 @@ void ges_title_source_set_text_color (GESTitleSource *self,
guint32 color); guint32 color);
void ges_title_source_set_background_color (GESTitleSource *self, void ges_title_source_set_background_color (GESTitleSource *self,
guint32 color); guint32 color);
void ges_title_source_set_xpos (GESTitleSource *self, void ges_title_source_set_xabsolute (GESTitleSource *self,
gdouble position); gdouble position);
void ges_title_source_set_ypos (GESTitleSource *self, void ges_title_source_set_yabsolute (GESTitleSource *self,
gdouble position); gdouble position);
const gchar *ges_title_source_get_text (GESTitleSource *source); const gchar *ges_title_source_get_text (GESTitleSource *source);
@ -103,8 +103,8 @@ GESTextHAlign ges_title_source_get_halignment (GESTitleSource *source);
GESTextVAlign ges_title_source_get_valignment (GESTitleSource *source); GESTextVAlign ges_title_source_get_valignment (GESTitleSource *source);
const guint32 ges_title_source_get_text_color (GESTitleSource *source); const guint32 ges_title_source_get_text_color (GESTitleSource *source);
const guint32 ges_title_source_get_background_color (GESTitleSource *source); const guint32 ges_title_source_get_background_color (GESTitleSource *source);
const gdouble ges_title_source_get_xpos (GESTitleSource *source); const gdouble ges_title_source_get_xabsolute (GESTitleSource *source);
const gdouble ges_title_source_get_ypos (GESTitleSource *source); const gdouble ges_title_source_get_yabsolute (GESTitleSource *source);
G_END_DECLS G_END_DECLS