Rename GESTrackTextOverlay to GESTextOverlay

This commit is contained in:
Thibault Saunier 2013-01-27 12:24:44 -03:00
parent 8245a6e624
commit ac456f74d7
13 changed files with 236 additions and 249 deletions

View file

@ -37,7 +37,7 @@ LOCAL_SRC_FILES := \
ges-video-test-source.c \
ges-audio-test-source.c \
ges-title-source.c \
ges-track-text-overlay.c \
ges-text-overlay.c \
ges-screenshot.c \
ges-formatter.c \
ges-keyfile-formatter.c \

View file

@ -67,7 +67,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<xi:include href="xml/ges-title-source.xml"/>
<xi:include href="xml/ges-audio-test-source.xml"/>
<xi:include href="xml/ges-video-test-source.xml"/>
<xi:include href="xml/ges-track-text-overlay.xml"/>
<xi:include href="xml/ges-text-overlay.xml"/>
<xi:include href="xml/ges-track-transition.xml"/>
<xi:include href="xml/ges-track-video-transition.xml"/>
<xi:include href="xml/ges-track-audio-transition.xml"/>

View file

@ -772,34 +772,34 @@ GES_IS_TITLE_SOURCE_CLASS
</SECTION>
<SECTION>
<FILE>ges-track-text-overlay</FILE>
<TITLE>GESTrackTextOverlay</TITLE>
GESTrackTextOverlay
ges_track_text_overlay_new
ges_track_text_overlay_set_text
ges_track_text_overlay_set_font_desc
ges_track_text_overlay_set_halignment
ges_track_text_overlay_set_valignment
ges_track_text_overlay_set_color
ges_track_text_overlay_set_xpos
ges_track_text_overlay_set_ypos
ges_track_text_overlay_get_text
ges_track_text_overlay_get_font_desc
ges_track_text_overlay_get_halignment
ges_track_text_overlay_get_valignment
ges_track_text_overlay_get_color
ges_track_text_overlay_get_xpos
ges_track_text_overlay_get_ypos
<FILE>ges-text-overlay</FILE>
<TITLE>GESTextOverlay</TITLE>
GESTextOverlay
ges_text_overlay_new
ges_text_overlay_set_text
ges_text_overlay_set_font_desc
ges_text_overlay_set_halignment
ges_text_overlay_set_valignment
ges_text_overlay_set_color
ges_text_overlay_set_xpos
ges_text_overlay_set_ypos
ges_text_overlay_get_text
ges_text_overlay_get_font_desc
ges_text_overlay_get_halignment
ges_text_overlay_get_valignment
ges_text_overlay_get_color
ges_text_overlay_get_xpos
ges_text_overlay_get_ypos
<SUBSECTION Standard>
GESTrackTextOverlayClass
GESTrackTextOverlayPrivate
ges_track_text_overlay_get_type
GES_IS_TRACK_TEXT_OVERLAY
GES_IS_TRACK_TEXT_OVERLAY_CLASS
GES_TRACK_TEXT_OVERLAY
GES_TRACK_TEXT_OVERLAY_CLASS
GES_TRACK_TEXT_OVERLAY_GET_CLASS
GES_TYPE_TRACK_TEXT_OVERLAY
GESTextOverlayClass
GESTextOverlayPrivate
ges_text_overlay_get_type
GES_IS_TEXT_OVERLAY
GES_IS_TEXT_OVERLAY_CLASS
GES_TEXT_OVERLAY
GES_TEXT_OVERLAY_CLASS
GES_TEXT_OVERLAY_GET_CLASS
GES_TYPE_TEXT_OVERLAY
</SECTION>
<SECTION>

View file

@ -31,7 +31,7 @@ ges_base_effect_get_type
ges_effect_get_type
ges_track_operation_get_type
ges_source_get_type
ges_track_text_overlay_get_type
ges_text_overlay_get_type
ges_title_source_get_type
ges_track_transition_get_type
%ges_track_type_get_type

View file

@ -41,7 +41,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-video-test-source.c \
ges-audio-test-source.c \
ges-title-source.c \
ges-track-text-overlay.c \
ges-text-overlay.c \
ges-base-effect.c \
ges-effect.c \
ges-screenshot.c \
@ -97,7 +97,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-video-test-source.h \
ges-audio-test-source.h \
ges-title-source.h \
ges-track-text-overlay.h \
ges-text-overlay.h \
ges-screenshot.h \
ges-formatter.h \
ges-pitivi-formatter.h \

View file

@ -28,7 +28,7 @@
#include "ges-internal.h"
#include "ges-text-overlay-clip.h"
#include "ges-track-element.h"
#include "ges-track-text-overlay.h"
#include "ges-text-overlay.h"
#include <string.h>
G_DEFINE_TYPE (GESTextOverlayClip, ges_overlay_text_clip,
@ -282,7 +282,7 @@ ges_overlay_text_clip_set_text (GESTextOverlayClip * self, const gchar * text)
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_text (GES_TRACK_TEXT_OVERLAY (trackelement),
ges_text_overlay_set_text (GES_TEXT_OVERLAY (trackelement),
self->priv->text);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -318,7 +318,7 @@ ges_overlay_text_clip_set_font_desc (GESTextOverlayClip * self,
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_font_desc (GES_TRACK_TEXT_OVERLAY
ges_text_overlay_set_font_desc (GES_TEXT_OVERLAY
(trackelement), self->priv->font_desc);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -352,7 +352,7 @@ ges_overlay_text_clip_set_halign (GESTextOverlayClip * self,
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_halignment (GES_TRACK_TEXT_OVERLAY
ges_text_overlay_set_halignment (GES_TEXT_OVERLAY
(trackelement), self->priv->halign);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -386,7 +386,7 @@ ges_overlay_text_clip_set_valign (GESTextOverlayClip * self,
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_valignment (GES_TRACK_TEXT_OVERLAY
ges_text_overlay_set_valignment (GES_TEXT_OVERLAY
(trackelement), self->priv->valign);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -420,7 +420,7 @@ ges_overlay_text_clip_set_color (GESTextOverlayClip * self, guint32 color)
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_color (GES_TRACK_TEXT_OVERLAY (trackelement),
ges_text_overlay_set_color (GES_TEXT_OVERLAY (trackelement),
self->priv->color);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -453,7 +453,7 @@ ges_overlay_text_clip_set_xpos (GESTextOverlayClip * self, gdouble position)
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_xpos (GES_TRACK_TEXT_OVERLAY (trackelement),
ges_text_overlay_set_xpos (GES_TEXT_OVERLAY (trackelement),
self->priv->xpos);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -486,7 +486,7 @@ ges_overlay_text_clip_set_ypos (GESTextOverlayClip * self, gdouble position)
if (ges_track_element_get_track (trackelement)->type ==
GES_TRACK_TYPE_VIDEO)
ges_track_text_overlay_set_ypos (GES_TRACK_TEXT_OVERLAY (trackelement),
ges_text_overlay_set_ypos (GES_TEXT_OVERLAY (trackelement),
self->priv->ypos);
g_object_unref (GES_TRACK_ELEMENT (tmp->data));
@ -612,18 +612,15 @@ ges_overlay_text_clip_create_track_element (GESClip * obj, GESTrackType type)
GST_DEBUG ("Creating a GESTrackOverlay");
if (type == GES_TRACK_TYPE_VIDEO) {
res = (GESTrackElement *) ges_track_text_overlay_new ();
res = (GESTrackElement *) ges_text_overlay_new ();
GST_DEBUG ("Setting text property");
ges_track_text_overlay_set_text ((GESTrackTextOverlay *) res, priv->text);
ges_track_text_overlay_set_font_desc ((GESTrackTextOverlay *) res,
priv->font_desc);
ges_track_text_overlay_set_halignment ((GESTrackTextOverlay *) res,
priv->halign);
ges_track_text_overlay_set_valignment ((GESTrackTextOverlay *) res,
priv->valign);
ges_track_text_overlay_set_color ((GESTrackTextOverlay *) res, priv->color);
ges_track_text_overlay_set_xpos ((GESTrackTextOverlay *) res, priv->xpos);
ges_track_text_overlay_set_ypos ((GESTrackTextOverlay *) res, priv->ypos);
ges_text_overlay_set_text ((GESTextOverlay *) res, priv->text);
ges_text_overlay_set_font_desc ((GESTextOverlay *) res, priv->font_desc);
ges_text_overlay_set_halignment ((GESTextOverlay *) res, priv->halign);
ges_text_overlay_set_valignment ((GESTextOverlay *) res, priv->valign);
ges_text_overlay_set_color ((GESTextOverlay *) res, priv->color);
ges_text_overlay_set_xpos ((GESTextOverlay *) res, priv->xpos);
ges_text_overlay_set_ypos ((GESTextOverlay *) res, priv->ypos);
}
return res;

View file

@ -19,7 +19,7 @@
*/
/**
* SECTION:ges-track-text-overlay
* SECTION:ges-text-overlay
* @short_description: render text onto another video stream in a
* #GESTimelineLayer
*
@ -28,12 +28,11 @@
#include "ges-internal.h"
#include "ges-track-element.h"
#include "ges-title-source.h"
#include "ges-track-text-overlay.h"
#include "ges-text-overlay.h"
G_DEFINE_TYPE (GESTrackTextOverlay, ges_track_text_overlay,
GES_TYPE_TRACK_OPERATION);
G_DEFINE_TYPE (GESTextOverlay, ges_text_overlay, GES_TYPE_TRACK_OPERATION);
struct _GESTrackTextOverlayPrivate
struct _GESTextOverlayPrivate
{
gchar *text;
gchar *font_desc;
@ -50,40 +49,39 @@ enum
PROP_0,
};
static void ges_track_text_overlay_dispose (GObject * object);
static void ges_text_overlay_dispose (GObject * object);
static void ges_track_text_overlay_finalize (GObject * object);
static void ges_text_overlay_finalize (GObject * object);
static void ges_track_text_overlay_get_property (GObject * object, guint
static void ges_text_overlay_get_property (GObject * object, guint
property_id, GValue * value, GParamSpec * pspec);
static void ges_track_text_overlay_set_property (GObject * object, guint
static void ges_text_overlay_set_property (GObject * object, guint
property_id, const GValue * value, GParamSpec * pspec);
static GstElement *ges_track_text_overlay_create_element (GESTrackElement
* self);
static GstElement *ges_text_overlay_create_element (GESTrackElement * self);
static void
ges_track_text_overlay_class_init (GESTrackTextOverlayClass * klass)
ges_text_overlay_class_init (GESTextOverlayClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTrackElementClass *bg_class = GES_TRACK_ELEMENT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTrackTextOverlayPrivate));
g_type_class_add_private (klass, sizeof (GESTextOverlayPrivate));
object_class->get_property = ges_track_text_overlay_get_property;
object_class->set_property = ges_track_text_overlay_set_property;
object_class->dispose = ges_track_text_overlay_dispose;
object_class->finalize = ges_track_text_overlay_finalize;
object_class->get_property = ges_text_overlay_get_property;
object_class->set_property = ges_text_overlay_set_property;
object_class->dispose = ges_text_overlay_dispose;
object_class->finalize = ges_text_overlay_finalize;
bg_class->create_element = ges_track_text_overlay_create_element;
bg_class->create_element = ges_text_overlay_create_element;
}
static void
ges_track_text_overlay_init (GESTrackTextOverlay * self)
ges_text_overlay_init (GESTextOverlay * self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_TRACK_TEXT_OVERLAY, GESTrackTextOverlayPrivate);
GES_TYPE_TEXT_OVERLAY, GESTextOverlayPrivate);
self->priv->text = NULL;
self->priv->font_desc = NULL;
@ -96,9 +94,9 @@ ges_track_text_overlay_init (GESTrackTextOverlay * self)
}
static void
ges_track_text_overlay_dispose (GObject * object)
ges_text_overlay_dispose (GObject * object)
{
GESTrackTextOverlay *self = GES_TRACK_TEXT_OVERLAY (object);
GESTextOverlay *self = GES_TEXT_OVERLAY (object);
if (self->priv->text) {
g_free (self->priv->text);
}
@ -112,17 +110,17 @@ ges_track_text_overlay_dispose (GObject * object)
self->priv->text_el = NULL;
}
G_OBJECT_CLASS (ges_track_text_overlay_parent_class)->dispose (object);
G_OBJECT_CLASS (ges_text_overlay_parent_class)->dispose (object);
}
static void
ges_track_text_overlay_finalize (GObject * object)
ges_text_overlay_finalize (GObject * object)
{
G_OBJECT_CLASS (ges_track_text_overlay_parent_class)->finalize (object);
G_OBJECT_CLASS (ges_text_overlay_parent_class)->finalize (object);
}
static void
ges_track_text_overlay_get_property (GObject * object,
ges_text_overlay_get_property (GObject * object,
guint property_id, GValue * value, GParamSpec * pspec)
{
switch (property_id) {
@ -132,7 +130,7 @@ ges_track_text_overlay_get_property (GObject * object,
}
static void
ges_track_text_overlay_set_property (GObject * object,
ges_text_overlay_set_property (GObject * object,
guint property_id, const GValue * value, GParamSpec * pspec)
{
switch (property_id) {
@ -142,12 +140,12 @@ ges_track_text_overlay_set_property (GObject * object,
}
static GstElement *
ges_track_text_overlay_create_element (GESTrackElement * object)
ges_text_overlay_create_element (GESTrackElement * object)
{
GstElement *ret, *text, *iconv, *oconv;
GstPad *src_target, *sink_target;
GstPad *src, *sink;
GESTrackTextOverlay *self = GES_TRACK_TEXT_OVERLAY (object);
GESTextOverlay *self = GES_TEXT_OVERLAY (object);
text = gst_element_factory_make ("textoverlay", NULL);
iconv = gst_element_factory_make ("videoconvert", NULL);
@ -185,8 +183,8 @@ ges_track_text_overlay_create_element (GESTrackElement * object)
}
/**
* ges_track_text_overlay_set_text:
* @self: the #GESTrackTextOverlay* to set text on
* ges_text_overlay_set_text:
* @self: the #GESTextOverlay* to set text on
* @text: the text to render. an internal copy of this text will be
* made.
*
@ -194,7 +192,7 @@ ges_track_text_overlay_create_element (GESTrackElement * object)
*
*/
void
ges_track_text_overlay_set_text (GESTrackTextOverlay * self, const gchar * text)
ges_text_overlay_set_text (GESTextOverlay * self, const gchar * text)
{
GST_DEBUG ("self:%p, text:%s", self, text);
@ -207,8 +205,8 @@ ges_track_text_overlay_set_text (GESTrackTextOverlay * self, const gchar * text)
}
/**
* ges_track_text_overlay_set_font_desc:
* @self: the #GESTrackTextOverlay
* ges_text_overlay_set_font_desc:
* @self: the #GESTextOverlay
* @font_desc: the pango font description
*
* Sets the pango font description of the text this track object
@ -216,8 +214,7 @@ ges_track_text_overlay_set_text (GESTrackTextOverlay * self, const gchar * text)
*
*/
void
ges_track_text_overlay_set_font_desc (GESTrackTextOverlay * self,
const gchar * font_desc)
ges_text_overlay_set_font_desc (GESTextOverlay * self, const gchar * font_desc)
{
GST_DEBUG ("self:%p, font_desc:%s", self, font_desc);
@ -231,8 +228,8 @@ ges_track_text_overlay_set_font_desc (GESTrackTextOverlay * self,
}
/**
* ges_track_text_overlay_set_valignment:
* @self: the #GESTrackTextOverlay* to set text on
* ges_text_overlay_set_valignment:
* @self: the #GESTextOverlay* to set text on
* @valign: The #GESTextVAlign defining the vertical alignment
* of the text render by @self.
*
@ -240,8 +237,7 @@ ges_track_text_overlay_set_font_desc (GESTrackTextOverlay * self,
*
*/
void
ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self,
GESTextVAlign valign)
ges_text_overlay_set_valignment (GESTextOverlay * self, GESTextVAlign valign)
{
GST_DEBUG ("self:%p, halign:%d", self, valign);
@ -251,8 +247,8 @@ ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self,
}
/**
* ges_track_text_overlay_set_halignment:
* @self: the #GESTrackTextOverlay* to set text on
* ges_text_overlay_set_halignment:
* @self: the #GESTextOverlay* to set text on
* @halign: The #GESTextHAlign defining the horizontal alignment
* of the text render by @self.
*
@ -260,8 +256,7 @@ ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self,
*
*/
void
ges_track_text_overlay_set_halignment (GESTrackTextOverlay * self,
GESTextHAlign halign)
ges_text_overlay_set_halignment (GESTextOverlay * self, GESTextHAlign halign)
{
GST_DEBUG ("self:%p, halign:%d", self, halign);
@ -271,8 +266,8 @@ ges_track_text_overlay_set_halignment (GESTrackTextOverlay * self,
}
/**
* ges_track_text_overlay_set_color:
* @self: the #GESTrackTextOverlay* to set
* ges_text_overlay_set_color:
* @self: the #GESTextOverlay* to set
* @color: The color @self is being set to
*
* Sets the color of the text.
@ -280,7 +275,7 @@ ges_track_text_overlay_set_halignment (GESTrackTextOverlay * self,
* Since: 0.10.2
*/
void
ges_track_text_overlay_set_color (GESTrackTextOverlay * self, guint32 color)
ges_text_overlay_set_color (GESTextOverlay * self, guint32 color)
{
GST_DEBUG ("self:%p, color:%d", self, color);
@ -290,8 +285,8 @@ ges_track_text_overlay_set_color (GESTrackTextOverlay * self, guint32 color)
}
/**
* ges_track_text_overlay_set_xpos:
* @self: the #GESTrackTextOverlay* to set
* ges_text_overlay_set_xpos:
* @self: the #GESTextOverlay* to set
* @position: The horizontal position @self is being set to
*
* Sets the horizontal position of the text.
@ -299,7 +294,7 @@ ges_track_text_overlay_set_color (GESTrackTextOverlay * self, guint32 color)
* Since: 0.10.2
*/
void
ges_track_text_overlay_set_xpos (GESTrackTextOverlay * self, gdouble position)
ges_text_overlay_set_xpos (GESTextOverlay * self, gdouble position)
{
GST_DEBUG ("self:%p, xpos:%f", self, position);
@ -309,8 +304,8 @@ ges_track_text_overlay_set_xpos (GESTrackTextOverlay * self, gdouble position)
}
/**
* ges_track_text_overlay_set_ypos:
* @self: the #GESTrackTextOverlay* to set
* ges_text_overlay_set_ypos:
* @self: the #GESTextOverlay* to set
* @position: The vertical position @self is being set to
*
* Sets the vertical position of the text.
@ -318,7 +313,7 @@ ges_track_text_overlay_set_xpos (GESTrackTextOverlay * self, gdouble position)
* Since: 0.10.2
*/
void
ges_track_text_overlay_set_ypos (GESTrackTextOverlay * self, gdouble position)
ges_text_overlay_set_ypos (GESTextOverlay * self, gdouble position)
{
GST_DEBUG ("self:%p, ypos:%f", self, position);
@ -328,64 +323,64 @@ ges_track_text_overlay_set_ypos (GESTrackTextOverlay * self, gdouble position)
}
/**
* ges_track_text_overlay_get_text:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_text:
* @self: a GESTextOverlay
*
* Get the text currently set on @source.
*
* Returns: The text currently set on @source.
*/
const gchar *
ges_track_text_overlay_get_text (GESTrackTextOverlay * self)
ges_text_overlay_get_text (GESTextOverlay * self)
{
return self->priv->text;
}
/**
* ges_track_text_overlay_get_font_desc:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_font_desc:
* @self: a GESTextOverlay
*
* Get the pango font description currently set on @source.
*
* Returns: The pango font description currently set on @source.
*/
const char *
ges_track_text_overlay_get_font_desc (GESTrackTextOverlay * self)
ges_text_overlay_get_font_desc (GESTextOverlay * self)
{
return self->priv->font_desc;
}
/**
* ges_track_text_overlay_get_halignment:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_halignment:
* @self: a GESTextOverlay
*
* Get the horizontal aligment used by @source.
*
* Returns: The horizontal aligment used by @source.
*/
GESTextHAlign
ges_track_text_overlay_get_halignment (GESTrackTextOverlay * self)
ges_text_overlay_get_halignment (GESTextOverlay * self)
{
return self->priv->halign;
}
/**
* ges_track_text_overlay_get_valignment:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_valignment:
* @self: a GESTextOverlay
*
* Get the vertical aligment used by @source.
*
* Returns: The vertical aligment used by @source.
*/
GESTextVAlign
ges_track_text_overlay_get_valignment (GESTrackTextOverlay * self)
ges_text_overlay_get_valignment (GESTextOverlay * self)
{
return self->priv->valign;
}
/**
* ges_track_text_overlay_get_color:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_color:
* @self: a GESTextOverlay
*
* Get the color used by @source.
*
@ -394,14 +389,14 @@ ges_track_text_overlay_get_valignment (GESTrackTextOverlay * self)
* Since: 0.10.2
*/
const guint32
ges_track_text_overlay_get_color (GESTrackTextOverlay * self)
ges_text_overlay_get_color (GESTextOverlay * self)
{
return self->priv->color;
}
/**
* ges_track_text_overlay_get_xpos:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_xpos:
* @self: a GESTextOverlay
*
* Get the horizontal position used by @source.
*
@ -410,14 +405,14 @@ ges_track_text_overlay_get_color (GESTrackTextOverlay * self)
* Since: 0.10.2
*/
const gdouble
ges_track_text_overlay_get_xpos (GESTrackTextOverlay * self)
ges_text_overlay_get_xpos (GESTextOverlay * self)
{
return self->priv->xpos;
}
/**
* ges_track_text_overlay_get_ypos:
* @self: a GESTrackTextOverlay
* ges_text_overlay_get_ypos:
* @self: a GESTextOverlay
*
* Get the vertical position used by @source.
*
@ -426,22 +421,22 @@ ges_track_text_overlay_get_xpos (GESTrackTextOverlay * self)
* Since: 0.10.2
*/
const gdouble
ges_track_text_overlay_get_ypos (GESTrackTextOverlay * self)
ges_text_overlay_get_ypos (GESTextOverlay * self)
{
return self->priv->ypos;
}
/**
* ges_track_text_overlay_new:
* ges_text_overlay_new:
*
* Creates a new #GESTrackTextOverlay.
* Creates a new #GESTextOverlay.
*
* Returns: The newly created #GESTrackTextOverlay or %NULL if something went
* Returns: The newly created #GESTextOverlay or %NULL if something went
* wrong.
*/
GESTrackTextOverlay *
ges_track_text_overlay_new (void)
GESTextOverlay *
ges_text_overlay_new (void)
{
return g_object_new (GES_TYPE_TRACK_TEXT_OVERLAY, "track-type",
return g_object_new (GES_TYPE_TEXT_OVERLAY, "track-type",
GES_TRACK_TYPE_VIDEO, NULL);
}

99
ges/ges-text-overlay.h Normal file
View file

@ -0,0 +1,99 @@
/* GStreamer Editing Services
* Copyright (C) 2010 Brandon Lewis <brandon.lewis@collabora.co.uk>
* 2010 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _GES_TEXT_OVERLAY
#define _GES_TEXT_OVERLAY
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-title-source.h>
#include <ges/ges-track-operation.h>
G_BEGIN_DECLS
#define GES_TYPE_TEXT_OVERLAY ges_text_overlay_get_type()
#define GES_TEXT_OVERLAY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TEXT_OVERLAY, GESTextOverlay))
#define GES_TEXT_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TEXT_OVERLAY, GESTextOverlayClass))
#define GES_IS_TEXT_OVERLAY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TEXT_OVERLAY))
#define GES_IS_TEXT_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TEXT_OVERLAY))
#define GES_TEXT_OVERLAY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TEXT_OVERLAY, GESTextOverlayClass))
typedef struct _GESTextOverlayPrivate GESTextOverlayPrivate;
/**
* GESTextOverlay:
*/
struct _GESTextOverlay
{
GESTrackOperation parent;
/*< private > */
GESTextOverlayPrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
struct _GESTextOverlayClass
{
GESTrackOperationClass parent_class;
/*< private > */
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_text_overlay_get_type (void);
void ges_text_overlay_set_text (GESTextOverlay * self,
const gchar * text);
void ges_text_overlay_set_font_desc (GESTextOverlay * self,
const gchar * font_desc);
void ges_text_overlay_set_halignment (GESTextOverlay * self,
GESTextHAlign halign);
void ges_text_overlay_set_valignment (GESTextOverlay * self,
GESTextVAlign valign);
void ges_text_overlay_set_color (GESTextOverlay * self,
guint32 color);
void ges_text_overlay_set_xpos (GESTextOverlay * self,
gdouble position);
void ges_text_overlay_set_ypos (GESTextOverlay * self,
gdouble position);
const gchar *ges_text_overlay_get_text (GESTextOverlay * self);
const char *ges_text_overlay_get_font_desc (GESTextOverlay * self);
GESTextHAlign ges_text_overlay_get_halignment (GESTextOverlay *
self);
GESTextVAlign ges_text_overlay_get_valignment (GESTextOverlay *
self);
const guint32 ges_text_overlay_get_color (GESTextOverlay * self);
const gdouble ges_text_overlay_get_xpos (GESTextOverlay * self);
const gdouble ges_text_overlay_get_ypos (GESTextOverlay * self);
GESTextOverlay *ges_text_overlay_new (void);
G_END_DECLS
#endif /* _GES_TEXT_OVERLAY */

View file

@ -1,99 +0,0 @@
/* GStreamer Editing Services
* Copyright (C) 2010 Brandon Lewis <brandon.lewis@collabora.co.uk>
* 2010 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _GES_TRACK_TEXT_OVERLAY
#define _GES_TRACK_TEXT_OVERLAY
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-title-source.h>
#include <ges/ges-track-operation.h>
G_BEGIN_DECLS
#define GES_TYPE_TRACK_TEXT_OVERLAY ges_track_text_overlay_get_type()
#define GES_TRACK_TEXT_OVERLAY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TRACK_TEXT_OVERLAY, GESTrackTextOverlay))
#define GES_TRACK_TEXT_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TRACK_TEXT_OVERLAY, GESTrackTextOverlayClass))
#define GES_IS_TRACK_TEXT_OVERLAY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TRACK_TEXT_OVERLAY))
#define GES_IS_TRACK_TEXT_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TRACK_TEXT_OVERLAY))
#define GES_TRACK_TEXT_OVERLAY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_TEXT_OVERLAY, GESTrackTextOverlayClass))
typedef struct _GESTrackTextOverlayPrivate GESTrackTextOverlayPrivate;
/**
* GESTrackTextOverlay:
*/
struct _GESTrackTextOverlay
{
GESTrackOperation parent;
/*< private > */
GESTrackTextOverlayPrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
struct _GESTrackTextOverlayClass
{
GESTrackOperationClass parent_class;
/*< private > */
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_track_text_overlay_get_type (void);
void ges_track_text_overlay_set_text (GESTrackTextOverlay * self,
const gchar * text);
void ges_track_text_overlay_set_font_desc (GESTrackTextOverlay * self,
const gchar * font_desc);
void ges_track_text_overlay_set_halignment (GESTrackTextOverlay * self,
GESTextHAlign halign);
void ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self,
GESTextVAlign valign);
void ges_track_text_overlay_set_color (GESTrackTextOverlay * self,
guint32 color);
void ges_track_text_overlay_set_xpos (GESTrackTextOverlay * self,
gdouble position);
void ges_track_text_overlay_set_ypos (GESTrackTextOverlay * self,
gdouble position);
const gchar *ges_track_text_overlay_get_text (GESTrackTextOverlay * self);
const char *ges_track_text_overlay_get_font_desc (GESTrackTextOverlay * self);
GESTextHAlign ges_track_text_overlay_get_halignment (GESTrackTextOverlay *
self);
GESTextVAlign ges_track_text_overlay_get_valignment (GESTrackTextOverlay *
self);
const guint32 ges_track_text_overlay_get_color (GESTrackTextOverlay * self);
const gdouble ges_track_text_overlay_get_xpos (GESTrackTextOverlay * self);
const gdouble ges_track_text_overlay_get_ypos (GESTrackTextOverlay * self);
GESTrackTextOverlay *ges_track_text_overlay_new (void);
G_END_DECLS
#endif /* _GES_TRACK_TEXT_OVERLAY */

View file

@ -130,9 +130,9 @@ typedef struct _GESTitleSource GESTitleSource;
typedef struct _GESTitleSourceClass
GESTitleSourceClass;
typedef struct _GESTrackTextOverlay GESTrackTextOverlay;
typedef struct _GESTrackTextOverlayClass
GESTrackTextOverlayClass;
typedef struct _GESTextOverlay GESTextOverlay;
typedef struct _GESTextOverlayClass
GESTextOverlayClass;
typedef struct _GESFormatter GESFormatter;
typedef struct _GESFormatterClass GESFormatterClass;

View file

@ -65,7 +65,7 @@
#include <ges/ges-video-test-source.h>
#include <ges/ges-audio-test-source.h>
#include <ges/ges-title-source.h>
#include <ges/ges-track-text-overlay.h>
#include <ges/ges-text-overlay.h>
#include <ges/ges-track-transition.h>
#include <ges/ges-track-video-transition.h>
#include <ges/ges-track-audio-transition.h>

View file

@ -137,7 +137,7 @@ GST_START_TEST (test_overlay_in_layer)
g_free (text);
assert_equals_string ("sans 72",
ges_track_text_overlay_get_font_desc (GES_TRACK_TEXT_OVERLAY (trobj)));
ges_text_overlay_get_font_desc (GES_TEXT_OVERLAY (trobj)));
/* test halign and valign */
g_object_set (source, "halignment", (gint)
@ -146,10 +146,8 @@ GST_START_TEST (test_overlay_in_layer)
assert_equals_int (halign, GES_TEXT_HALIGN_LEFT);
assert_equals_int (valign, GES_TEXT_VALIGN_TOP);
halign =
ges_track_text_overlay_get_halignment (GES_TRACK_TEXT_OVERLAY (trobj));
valign =
ges_track_text_overlay_get_valignment (GES_TRACK_TEXT_OVERLAY (trobj));
halign = ges_text_overlay_get_halignment (GES_TEXT_OVERLAY (trobj));
valign = ges_text_overlay_get_valignment (GES_TEXT_OVERLAY (trobj));
assert_equals_int (halign, GES_TEXT_HALIGN_LEFT);
assert_equals_int (valign, GES_TEXT_VALIGN_TOP);
@ -158,7 +156,7 @@ GST_START_TEST (test_overlay_in_layer)
g_object_get (source, "color", &color, NULL);
assert_equals_int (color, 2147483647);
color = ges_track_text_overlay_get_color (GES_TRACK_TEXT_OVERLAY (trobj));
color = ges_text_overlay_get_color (GES_TEXT_OVERLAY (trobj));
assert_equals_int (color, 2147483647);
/* test xpos */
@ -166,7 +164,7 @@ GST_START_TEST (test_overlay_in_layer)
g_object_get (source, "xpos", &xpos, NULL);
assert_equals_float (xpos, 0.5);
xpos = ges_track_text_overlay_get_xpos (GES_TRACK_TEXT_OVERLAY (trobj));
xpos = ges_text_overlay_get_xpos (GES_TEXT_OVERLAY (trobj));
assert_equals_float (xpos, 0.5);
/* test ypos */
@ -174,7 +172,7 @@ GST_START_TEST (test_overlay_in_layer)
g_object_get (source, "ypos", &ypos, NULL);
assert_equals_float (ypos, 0.33);
ypos = ges_track_text_overlay_get_ypos (GES_TRACK_TEXT_OVERLAY (trobj));
ypos = ges_text_overlay_get_ypos (GES_TEXT_OVERLAY (trobj));
assert_equals_float (ypos, 0.33);
GST_DEBUG ("removing the source");

View file

@ -50,8 +50,7 @@ GST_START_TEST (test_text_properties_in_layer)
(GESClip *) source, 0);
trobj =
ges_clip_find_track_element (GES_CLIP (source), v,
GES_TYPE_TRACK_TEXT_OVERLAY);
ges_clip_find_track_element (GES_CLIP (source), v, GES_TYPE_TEXT_OVERLAY);
fail_unless (trobj != NULL);
assert_equals_int (trobj->active, FALSE);
@ -71,7 +70,7 @@ GST_START_TEST (test_text_properties_in_layer)
g_free (text);
assert_equals_string ("sans 72",
ges_track_text_overlay_get_font_desc (GES_TRACK_TEXT_OVERLAY (trobj)));
ges_text_overlay_get_font_desc (GES_TEXT_OVERLAY (trobj)));
g_object_set (source, "text", (gchar *) NULL, NULL);
assert_equals_int (trobj->active, FALSE);
@ -83,10 +82,8 @@ GST_START_TEST (test_text_properties_in_layer)
assert_equals_int (halign, GES_TEXT_HALIGN_LEFT);
assert_equals_int (valign, GES_TEXT_VALIGN_TOP);
halign =
ges_track_text_overlay_get_halignment (GES_TRACK_TEXT_OVERLAY (trobj));
valign =
ges_track_text_overlay_get_valignment (GES_TRACK_TEXT_OVERLAY (trobj));
halign = ges_text_overlay_get_halignment (GES_TEXT_OVERLAY (trobj));
valign = ges_text_overlay_get_valignment (GES_TEXT_OVERLAY (trobj));
assert_equals_int (halign, GES_TEXT_HALIGN_LEFT);
assert_equals_int (valign, GES_TEXT_VALIGN_TOP);