Rename GESTrackTitleSource to GESTitleSource

This commit is contained in:
Thibault Saunier 2013-01-26 14:25:14 -03:00
parent 6aa01b594a
commit 8245a6e624
14 changed files with 263 additions and 276 deletions

View file

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

View file

@ -64,7 +64,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<chapter>
<title>Track objects</title>
<xi:include href="xml/ges-uri-source.xml"/>
<xi:include href="xml/ges-track-title-source.xml"/>
<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"/>

View file

@ -738,37 +738,37 @@ GES_IS_AUDIO_TEST_SOURCE_CLASS
</SECTION>
<SECTION>
<FILE>ges-track-title-source</FILE>
<TITLE>GESTrackTitleSource</TITLE>
GESTrackTitleSource
ges_track_title_source_new
ges_track_title_source_set_text
ges_track_title_source_set_font_desc
ges_track_title_source_set_halignment
ges_track_title_source_set_valignment
ges_track_title_source_set_color
ges_track_title_source_set_background
ges_track_title_source_set_xpos
ges_track_title_source_set_ypos
ges_track_title_source_get_text
ges_track_title_source_get_font_desc
ges_track_title_source_get_halignment
ges_track_title_source_get_valignment
ges_track_title_source_get_color
ges_track_title_source_get_background
ges_track_title_source_get_xpos
ges_track_title_source_get_ypos
<FILE>ges-title-source</FILE>
<TITLE>GESTitleSource</TITLE>
GESTitleSource
ges_title_source_new
ges_title_source_set_text
ges_title_source_set_font_desc
ges_title_source_set_halignment
ges_title_source_set_valignment
ges_title_source_set_color
ges_title_source_set_background
ges_title_source_set_xpos
ges_title_source_set_ypos
ges_title_source_get_text
ges_title_source_get_font_desc
ges_title_source_get_halignment
ges_title_source_get_valignment
ges_title_source_get_color
ges_title_source_get_background
ges_title_source_get_xpos
ges_title_source_get_ypos
<SUBSECTION Standard>
GESTrackTitleSourceClass
GESTrackTitleSourcePrivate
ges_track_title_source_get_type
GES_TRACK_TITLE_SOURCE
GES_TRACK_TITLE_SOURCE_CLASS
GES_TRACK_TITLE_SOURCE_GET_CLASS
GESTitleSourceClass
GESTitleSourcePrivate
ges_title_source_get_type
GES_TITLE_SOURCE
GES_TITLE_SOURCE_CLASS
GES_TITLE_SOURCE_GET_CLASS
GES_TYPE_TITLE_CLIP
GES_TYPE_TRACK_TITLE_SOURCE
GES_IS_TRACK_TITLE_SOURCE
GES_IS_TRACK_TITLE_SOURCE_CLASS
GES_TYPE_TITLE_SOURCE
GES_IS_TITLE_SOURCE
GES_IS_TITLE_SOURCE_CLASS
</SECTION>
<SECTION>

View file

@ -32,7 +32,7 @@ ges_effect_get_type
ges_track_operation_get_type
ges_source_get_type
ges_track_text_overlay_get_type
ges_track_title_source_get_type
ges_title_source_get_type
ges_track_transition_get_type
%ges_track_type_get_type
ges_video_test_source_get_type

View file

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

View file

@ -30,7 +30,7 @@
#include "ges-title-clip.h"
#include "ges-source-clip.h"
#include "ges-track-element.h"
#include "ges-track-title-source.h"
#include "ges-title-source.h"
#include <string.h>
G_DEFINE_TYPE (GESTitleClip, ges_title_clip, GES_TYPE_SOURCE_CLIP);
@ -318,8 +318,7 @@ ges_title_clip_set_text (GESTitleClip * self, const gchar * text)
self->priv->text = g_strdup (text);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_text (GES_TRACK_TITLE_SOURCE (tmp->data),
self->priv->text);
ges_title_source_set_text (GES_TITLE_SOURCE (tmp->data), self->priv->text);
}
}
@ -344,7 +343,7 @@ ges_title_clip_set_font_desc (GESTitleClip * self, const gchar * font_desc)
self->priv->font_desc = g_strdup (font_desc);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_font_desc (GES_TRACK_TITLE_SOURCE (tmp->data),
ges_title_source_set_font_desc (GES_TITLE_SOURCE (tmp->data),
self->priv->font_desc);
}
}
@ -367,7 +366,7 @@ ges_title_clip_set_halignment (GESTitleClip * self, GESTextHAlign halign)
self->priv->halign = halign;
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_halignment (GES_TRACK_TITLE_SOURCE (tmp->data),
ges_title_source_set_halignment (GES_TITLE_SOURCE (tmp->data),
self->priv->halign);
}
}
@ -390,7 +389,7 @@ ges_title_clip_set_valignment (GESTitleClip * self, GESTextVAlign valign)
self->priv->valign = valign;
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_valignment (GES_TRACK_TITLE_SOURCE (tmp->data),
ges_title_source_set_valignment (GES_TITLE_SOURCE (tmp->data),
self->priv->valign);
}
}
@ -447,7 +446,7 @@ ges_title_clip_set_color (GESTitleClip * self, guint32 color)
self->priv->color = color;
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_color (GES_TRACK_TITLE_SOURCE (tmp->data),
ges_title_source_set_color (GES_TITLE_SOURCE (tmp->data),
self->priv->color);
}
}
@ -469,7 +468,7 @@ ges_title_clip_set_background (GESTitleClip * self, guint32 background)
self->priv->background = background;
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_background (GES_TRACK_TITLE_SOURCE (tmp->data),
ges_title_source_set_background (GES_TITLE_SOURCE (tmp->data),
self->priv->background);
}
}
@ -494,8 +493,7 @@ ges_title_clip_set_xpos (GESTitleClip * self, gdouble position)
self->priv->xpos = position;
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_xpos (GES_TRACK_TITLE_SOURCE (tmp->data),
self->priv->xpos);
ges_title_source_set_xpos (GES_TITLE_SOURCE (tmp->data), self->priv->xpos);
}
}
@ -518,8 +516,7 @@ ges_title_clip_set_ypos (GESTitleClip * self, gdouble position)
self->priv->ypos = position;
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_title_source_set_ypos (GES_TRACK_TITLE_SOURCE (tmp->data),
self->priv->ypos);
ges_title_source_set_ypos (GES_TITLE_SOURCE (tmp->data), self->priv->ypos);
}
}
@ -667,7 +664,7 @@ ges_title_clip_track_element_released (GESClip * obj,
GESTitleClipPrivate *priv = GES_TITLE_CLIP (obj)->priv;
/* If this is called, we should be sure the trackelement exists */
if (GES_IS_TRACK_TITLE_SOURCE (trackelement)) {
if (GES_IS_TITLE_SOURCE (trackelement)) {
GST_DEBUG_OBJECT (obj, "%p released from %p", trackelement, obj);
priv->track_titles = g_slist_remove (priv->track_titles, trackelement);
g_object_unref (trackelement);
@ -680,7 +677,7 @@ ges_title_clip_track_element_added (GESClip * obj,
{
GESTitleClipPrivate *priv = GES_TITLE_CLIP (obj)->priv;
if (GES_IS_TRACK_TITLE_SOURCE (trackelement)) {
if (GES_IS_TITLE_SOURCE (trackelement)) {
GST_DEBUG_OBJECT (obj, "%p added to %p", trackelement, obj);
priv->track_titles =
g_slist_prepend (priv->track_titles, g_object_ref (trackelement));
@ -694,23 +691,19 @@ ges_title_clip_create_track_element (GESClip * obj, GESTrackType type)
GESTitleClipPrivate *priv = GES_TITLE_CLIP (obj)->priv;
GESTrackElement *res = NULL;
GST_DEBUG_OBJECT (obj, "a GESTrackTitleSource");
GST_DEBUG_OBJECT (obj, "a GESTitleSource");
if (type == GES_TRACK_TYPE_VIDEO) {
res = (GESTrackElement *) ges_track_title_source_new ();
res = (GESTrackElement *) ges_title_source_new ();
GST_DEBUG_OBJECT (obj, "text property");
ges_track_title_source_set_text ((GESTrackTitleSource *) res, priv->text);
ges_track_title_source_set_font_desc ((GESTrackTitleSource *) res,
priv->font_desc);
ges_track_title_source_set_halignment ((GESTrackTitleSource *) res,
priv->halign);
ges_track_title_source_set_valignment ((GESTrackTitleSource *) res,
priv->valign);
ges_track_title_source_set_color ((GESTrackTitleSource *) res, priv->color);
ges_track_title_source_set_background ((GESTrackTitleSource *) res,
priv->background);
ges_track_title_source_set_xpos ((GESTrackTitleSource *) res, priv->xpos);
ges_track_title_source_set_ypos ((GESTrackTitleSource *) res, priv->ypos);
ges_title_source_set_text ((GESTitleSource *) res, priv->text);
ges_title_source_set_font_desc ((GESTitleSource *) res, priv->font_desc);
ges_title_source_set_halignment ((GESTitleSource *) res, priv->halign);
ges_title_source_set_valignment ((GESTitleSource *) res, priv->valign);
ges_title_source_set_color ((GESTitleSource *) res, priv->color);
ges_title_source_set_background ((GESTitleSource *) res, priv->background);
ges_title_source_set_xpos ((GESTitleSource *) res, priv->xpos);
ges_title_source_set_ypos ((GESTitleSource *) res, priv->ypos);
}
return res;

View file

@ -19,19 +19,19 @@
*/
/**
* SECTION:ges-track-title-source
* SECTION:ges-title-source
* @short_description: render stand-alone text titles
*
*/
#include "ges-internal.h"
#include "ges-track-element.h"
#include "ges-track-title-source.h"
#include "ges-title-source.h"
#include "ges-video-test-source.h"
G_DEFINE_TYPE (GESTrackTitleSource, ges_track_title_source, GES_TYPE_SOURCE);
G_DEFINE_TYPE (GESTitleSource, ges_title_source, GES_TYPE_SOURCE);
struct _GESTrackTitleSourcePrivate
struct _GESTitleSourcePrivate
{
gchar *text;
gchar *font_desc;
@ -50,37 +50,36 @@ enum
PROP_0,
};
static void ges_track_title_source_dispose (GObject * object);
static void ges_title_source_dispose (GObject * object);
static void ges_track_title_source_get_property (GObject * object, guint
static void ges_title_source_get_property (GObject * object, guint
property_id, GValue * value, GParamSpec * pspec);
static void ges_track_title_source_set_property (GObject * object, guint
static void ges_title_source_set_property (GObject * object, guint
property_id, const GValue * value, GParamSpec * pspec);
static GstElement *ges_track_title_source_create_element (GESTrackElement *
self);
static GstElement *ges_title_source_create_element (GESTrackElement * self);
static void
ges_track_title_source_class_init (GESTrackTitleSourceClass * klass)
ges_title_source_class_init (GESTitleSourceClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESTrackElementClass *bg_class = GES_TRACK_ELEMENT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTrackTitleSourcePrivate));
g_type_class_add_private (klass, sizeof (GESTitleSourcePrivate));
object_class->get_property = ges_track_title_source_get_property;
object_class->set_property = ges_track_title_source_set_property;
object_class->dispose = ges_track_title_source_dispose;
object_class->get_property = ges_title_source_get_property;
object_class->set_property = ges_title_source_set_property;
object_class->dispose = ges_title_source_dispose;
bg_class->create_element = ges_track_title_source_create_element;
bg_class->create_element = ges_title_source_create_element;
}
static void
ges_track_title_source_init (GESTrackTitleSource * self)
ges_title_source_init (GESTitleSource * self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_TRACK_TITLE_SOURCE, GESTrackTitleSourcePrivate);
GES_TYPE_TITLE_SOURCE, GESTitleSourcePrivate);
self->priv->text = NULL;
self->priv->font_desc = NULL;
@ -95,9 +94,9 @@ ges_track_title_source_init (GESTrackTitleSource * self)
}
static void
ges_track_title_source_dispose (GObject * object)
ges_title_source_dispose (GObject * object)
{
GESTrackTitleSource *self = GES_TRACK_TITLE_SOURCE (object);
GESTitleSource *self = GES_TITLE_SOURCE (object);
if (self->priv->text) {
g_free (self->priv->text);
}
@ -116,11 +115,11 @@ ges_track_title_source_dispose (GObject * object)
self->priv->background_el = NULL;
}
G_OBJECT_CLASS (ges_track_title_source_parent_class)->dispose (object);
G_OBJECT_CLASS (ges_title_source_parent_class)->dispose (object);
}
static void
ges_track_title_source_get_property (GObject * object,
ges_title_source_get_property (GObject * object,
guint property_id, GValue * value, GParamSpec * pspec)
{
switch (property_id) {
@ -130,7 +129,7 @@ ges_track_title_source_get_property (GObject * object,
}
static void
ges_track_title_source_set_property (GObject * object,
ges_title_source_set_property (GObject * object,
guint property_id, const GValue * value, GParamSpec * pspec)
{
switch (property_id) {
@ -140,10 +139,10 @@ ges_track_title_source_set_property (GObject * object,
}
static GstElement *
ges_track_title_source_create_element (GESTrackElement * object)
ges_title_source_create_element (GESTrackElement * object)
{
GESTrackTitleSource *self = GES_TRACK_TITLE_SOURCE (object);
GESTrackTitleSourcePrivate *priv = self->priv;
GESTitleSource *self = GES_TITLE_SOURCE (object);
GESTitleSourcePrivate *priv = self->priv;
GstElement *topbin, *background, *text;
GstPad *src;
@ -186,8 +185,8 @@ ges_track_title_source_create_element (GESTrackElement * object)
}
/**
* ges_track_title_source_set_text:
* @self: the #GESTrackTitleSource* to set text on
* ges_title_source_set_text:
* @self: the #GESTitleSource* to set text on
* @text: the text to render. an internal copy of this text will be
* made.
*
@ -195,7 +194,7 @@ ges_track_title_source_create_element (GESTrackElement * object)
*/
void
ges_track_title_source_set_text (GESTrackTitleSource * self, const gchar * text)
ges_title_source_set_text (GESTitleSource * self, const gchar * text)
{
if (self->priv->text)
g_free (self->priv->text);
@ -208,8 +207,8 @@ ges_track_title_source_set_text (GESTrackTitleSource * self, const gchar * text)
}
/**
* ges_track_title_source_set_font_desc:
* @self: the #GESTrackTitleSource
* ges_title_source_set_font_desc:
* @self: the #GESTitleSource
* @font_desc: the pango font description
*
* Set the pango font description this source will use to render
@ -217,8 +216,7 @@ ges_track_title_source_set_text (GESTrackTitleSource * self, const gchar * text)
*/
void
ges_track_title_source_set_font_desc (GESTrackTitleSource * self,
const gchar * font_desc)
ges_title_source_set_font_desc (GESTitleSource * self, const gchar * font_desc)
{
if (self->priv->font_desc)
g_free (self->priv->font_desc);
@ -231,15 +229,14 @@ ges_track_title_source_set_font_desc (GESTrackTitleSource * self,
}
/**
* ges_track_title_source_set_valignment:
* @self: the #GESTrackTitleSource* to set text on
* ges_title_source_set_valignment:
* @self: the #GESTitleSource* to set text on
* @valign: #GESTextVAlign
*
* Sets the vertical aligment of the text.
*/
void
ges_track_title_source_set_valignment (GESTrackTitleSource * self,
GESTextVAlign valign)
ges_title_source_set_valignment (GESTitleSource * self, GESTextVAlign valign)
{
GST_DEBUG ("self:%p, valign:%d", self, valign);
@ -249,15 +246,14 @@ ges_track_title_source_set_valignment (GESTrackTitleSource * self,
}
/**
* ges_track_title_source_set_halignment:
* @self: the #GESTrackTitleSource* to set text on
* ges_title_source_set_halignment:
* @self: the #GESTitleSource* to set text on
* @halign: #GESTextHAlign
*
* Sets the vertical aligment of the text.
*/
void
ges_track_title_source_set_halignment (GESTrackTitleSource * self,
GESTextHAlign halign)
ges_title_source_set_halignment (GESTitleSource * self, GESTextHAlign halign)
{
GST_DEBUG ("self:%p, halign:%d", self, halign);
@ -267,8 +263,8 @@ ges_track_title_source_set_halignment (GESTrackTitleSource * self,
}
/**
* ges_track_title_source_set_color:
* @self: the #GESTrackTitleSource* to set
* ges_title_source_set_color:
* @self: the #GESTitleSource* to set
* @color: the color @self is being set to
*
* Sets the color of the text.
@ -276,7 +272,7 @@ ges_track_title_source_set_halignment (GESTrackTitleSource * self,
* Since: 0.10.2
*/
void
ges_track_title_source_set_color (GESTrackTitleSource * self, guint32 color)
ges_title_source_set_color (GESTitleSource * self, guint32 color)
{
GST_DEBUG ("self:%p, color:%d", self, color);
@ -286,15 +282,14 @@ ges_track_title_source_set_color (GESTrackTitleSource * self, guint32 color)
}
/**
* ges_track_title_source_set_background:
* @self: the #GESTrackTitleSource* to set
* ges_title_source_set_background:
* @self: the #GESTitleSource* to set
* @color: the color @self is being set to
*
* Sets the color of the background
*/
void
ges_track_title_source_set_background (GESTrackTitleSource * self,
guint32 color)
ges_title_source_set_background (GESTitleSource * self, guint32 color)
{
GST_DEBUG ("self:%p, background color:%d", self, color);
@ -304,8 +299,8 @@ ges_track_title_source_set_background (GESTrackTitleSource * self,
}
/**
* ges_track_title_source_set_xpos:
* @self: the #GESTrackTitleSource* to set
* ges_title_source_set_xpos:
* @self: the #GESTitleSource* to set
* @position: the horizontal position @self is being set to
*
* Sets the horizontal position of the text.
@ -313,7 +308,7 @@ ges_track_title_source_set_background (GESTrackTitleSource * self,
* Since: 0.10.2
*/
void
ges_track_title_source_set_xpos (GESTrackTitleSource * self, gdouble position)
ges_title_source_set_xpos (GESTitleSource * self, gdouble position)
{
GST_DEBUG ("self:%p, xpos:%f", self, position);
@ -323,8 +318,8 @@ ges_track_title_source_set_xpos (GESTrackTitleSource * self, gdouble position)
}
/**
* ges_track_title_source_set_ypos:
* @self: the #GESTrackTitleSource* to set
* ges_title_source_set_ypos:
* @self: the #GESTitleSource* to set
* @position: the color @self is being set to
*
* Sets the vertical position of the text.
@ -332,7 +327,7 @@ ges_track_title_source_set_xpos (GESTrackTitleSource * self, gdouble position)
* Since: 0.10.2
*/
void
ges_track_title_source_set_ypos (GESTrackTitleSource * self, gdouble position)
ges_title_source_set_ypos (GESTitleSource * self, gdouble position)
{
GST_DEBUG ("self:%p, ypos:%f", self, position);
@ -342,22 +337,22 @@ ges_track_title_source_set_ypos (GESTrackTitleSource * self, gdouble position)
}
/**
* ges_track_title_source_get_text:
* @source: a #GESTrackTitleSource
* ges_title_source_get_text:
* @source: a #GESTitleSource
*
* Get the text currently set on the @source.
*
* Returns: (transfer none): The text currently set on the @source.
*/
const gchar *
ges_track_title_source_get_text (GESTrackTitleSource * source)
ges_title_source_get_text (GESTitleSource * source)
{
return source->priv->text;
}
/**
* ges_track_title_source_get_font_desc:
* @source: a #GESTrackTitleSource
* ges_title_source_get_font_desc:
* @source: a #GESTitleSource
*
* Get the pango font description used by @source.
*
@ -365,42 +360,42 @@ ges_track_title_source_get_text (GESTrackTitleSource * source)
* @source.
*/
const gchar *
ges_track_title_source_get_font_desc (GESTrackTitleSource * source)
ges_title_source_get_font_desc (GESTitleSource * source)
{
return source->priv->font_desc;
}
/**
* ges_track_title_source_get_halignment:
* @source: a #GESTrackTitleSource
* ges_title_source_get_halignment:
* @source: a #GESTitleSource
*
* Get the horizontal aligment used by @source.
*
* Returns: The horizontal aligment used by @source.
*/
GESTextHAlign
ges_track_title_source_get_halignment (GESTrackTitleSource * source)
ges_title_source_get_halignment (GESTitleSource * source)
{
return source->priv->halign;
}
/**
* ges_track_title_source_get_valignment:
* @source: a #GESTrackTitleSource
* ges_title_source_get_valignment:
* @source: a #GESTitleSource
*
* Get the vertical aligment used by @source.
*
* Returns: The vertical aligment used by @source.
*/
GESTextVAlign
ges_track_title_source_get_valignment (GESTrackTitleSource * source)
ges_title_source_get_valignment (GESTitleSource * source)
{
return source->priv->valign;
}
/**
* ges_track_title_source_get_color:
* @source: a #GESTrackTitleSource
* ges_title_source_get_color:
* @source: a #GESTitleSource
*
* Get the color used by @source.
*
@ -409,28 +404,28 @@ ges_track_title_source_get_valignment (GESTrackTitleSource * source)
* Since: 0.10.2
*/
const guint32
ges_track_title_source_get_color (GESTrackTitleSource * source)
ges_title_source_get_color (GESTitleSource * source)
{
return source->priv->color;
}
/**
* ges_track_title_source_get_background:
* @source: a #GESTrackTitleSource
* ges_title_source_get_background:
* @source: a #GESTitleSource
*
* Get the background used by @source.
*
* Returns: The background used by @source.
*/
const guint32
ges_track_title_source_get_background (GESTrackTitleSource * source)
ges_title_source_get_background (GESTitleSource * source)
{
return source->priv->background;
}
/**
* ges_track_title_source_get_xpos:
* @source: a #GESTrackTitleSource
* ges_title_source_get_xpos:
* @source: a #GESTitleSource
*
* Get the horizontal position used by @source.
*
@ -439,14 +434,14 @@ ges_track_title_source_get_background (GESTrackTitleSource * source)
* Since: 0.10.2
*/
const gdouble
ges_track_title_source_get_xpos (GESTrackTitleSource * source)
ges_title_source_get_xpos (GESTitleSource * source)
{
return source->priv->xpos;
}
/**
* ges_track_title_source_get_ypos:
* @source: a #GESTrackTitleSource
* ges_title_source_get_ypos:
* @source: a #GESTitleSource
*
* Get the vertical position used by @source.
*
@ -455,22 +450,22 @@ ges_track_title_source_get_xpos (GESTrackTitleSource * source)
* Since: 0.10.2
*/
const gdouble
ges_track_title_source_get_ypos (GESTrackTitleSource * source)
ges_title_source_get_ypos (GESTitleSource * source)
{
return source->priv->ypos;
}
/**
* ges_track_title_source_new:
* ges_title_source_new:
*
* Creates a new #GESTrackTitleSource.
* Creates a new #GESTitleSource.
*
* Returns: The newly created #GESTrackTitleSource, or %NULL if there was an
* Returns: The newly created #GESTitleSource, or %NULL if there was an
* error.
*/
GESTrackTitleSource *
ges_track_title_source_new (void)
GESTitleSource *
ges_title_source_new (void)
{
return g_object_new (GES_TYPE_TRACK_TITLE_SOURCE, "track-type",
return g_object_new (GES_TYPE_TITLE_SOURCE, "track-type",
GES_TRACK_TYPE_VIDEO, NULL);
}

114
ges/ges-title-source.h Normal file
View file

@ -0,0 +1,114 @@
/* 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_TITLE_SOURCE
#define _GES_TITLE_SOURCE
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-source.h>
G_BEGIN_DECLS
#define GES_TYPE_TITLE_SOURCE ges_title_source_get_type()
#define GES_TITLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TITLE_SOURCE, GESTitleSource))
#define GES_TITLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TITLE_SOURCE, GESTitleSourceClass))
#define GES_IS_TITLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TITLE_SOURCE))
#define GES_IS_TITLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TITLE_SOURCE))
#define GES_TITLE_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TITLE_SOURCE, GESTitleSourceClass))
typedef struct _GESTitleSourcePrivate GESTitleSourcePrivate;
/**
* GESTitleSource:
*
*/
struct _GESTitleSource {
GESSource parent;
/*< private >*/
GESTitleSourcePrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
/**
* GESTitleSourceClass:
* @parent_class: parent class
*/
struct _GESTitleSourceClass {
GESSourceClass parent_class;
/*< private >*/
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_title_source_get_type (void);
void ges_title_source_set_text (GESTitleSource *self,
const gchar *text);
void ges_title_source_set_font_desc (GESTitleSource *self,
const gchar *font_desc);
void ges_title_source_set_halignment (GESTitleSource *self,
GESTextHAlign halign);
void ges_title_source_set_valignment (GESTitleSource *self,
GESTextVAlign valign);
void ges_title_source_set_color (GESTitleSource *self,
guint32 color);
void ges_title_source_set_background (GESTitleSource *self,
guint32 color);
void ges_title_source_set_xpos (GESTitleSource *self,
gdouble position);
void ges_title_source_set_ypos (GESTitleSource *self,
gdouble position);
const gchar *ges_title_source_get_text (GESTitleSource *source);
const gchar *ges_title_source_get_font_desc (GESTitleSource *source);
GESTextHAlign ges_title_source_get_halignment (GESTitleSource *source);
GESTextVAlign ges_title_source_get_valignment (GESTitleSource *source);
const guint32 ges_title_source_get_color (GESTitleSource *source);
const guint32 ges_title_source_get_background (GESTitleSource *source);
const gdouble ges_title_source_get_xpos (GESTitleSource *source);
const gdouble ges_title_source_get_ypos (GESTitleSource *source);
GESTitleSource* ges_title_source_new (void);
G_END_DECLS
#endif /* _GES_TITLE_SOURCE */

View file

@ -27,7 +27,7 @@
#include "ges-internal.h"
#include "ges-track-element.h"
#include "ges-track-title-source.h"
#include "ges-title-source.h"
#include "ges-track-text-overlay.h"
G_DEFINE_TYPE (GESTrackTextOverlay, ges_track_text_overlay,

View file

@ -23,7 +23,7 @@
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-track-title-source.h>
#include <ges/ges-title-source.h>
#include <ges/ges-track-operation.h>
G_BEGIN_DECLS

View file

@ -1,114 +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_TITLE_SOURCE
#define _GES_TRACK_TITLE_SOURCE
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-source.h>
G_BEGIN_DECLS
#define GES_TYPE_TRACK_TITLE_SOURCE ges_track_title_source_get_type()
#define GES_TRACK_TITLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TRACK_TITLE_SOURCE, GESTrackTitleSource))
#define GES_TRACK_TITLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TRACK_TITLE_SOURCE, GESTrackTitleSourceClass))
#define GES_IS_TRACK_TITLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TRACK_TITLE_SOURCE))
#define GES_IS_TRACK_TITLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TRACK_TITLE_SOURCE))
#define GES_TRACK_TITLE_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_TITLE_SOURCE, GESTrackTitleSourceClass))
typedef struct _GESTrackTitleSourcePrivate GESTrackTitleSourcePrivate;
/**
* GESTrackTitleSource:
*
*/
struct _GESTrackTitleSource {
GESSource parent;
/*< private >*/
GESTrackTitleSourcePrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
/**
* GESTrackTitleSourceClass:
* @parent_class: parent class
*/
struct _GESTrackTitleSourceClass {
GESSourceClass parent_class;
/*< private >*/
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_track_title_source_get_type (void);
void ges_track_title_source_set_text (GESTrackTitleSource *self,
const gchar *text);
void ges_track_title_source_set_font_desc (GESTrackTitleSource *self,
const gchar *font_desc);
void ges_track_title_source_set_halignment (GESTrackTitleSource *self,
GESTextHAlign halign);
void ges_track_title_source_set_valignment (GESTrackTitleSource *self,
GESTextVAlign valign);
void ges_track_title_source_set_color (GESTrackTitleSource *self,
guint32 color);
void ges_track_title_source_set_background (GESTrackTitleSource *self,
guint32 color);
void ges_track_title_source_set_xpos (GESTrackTitleSource *self,
gdouble position);
void ges_track_title_source_set_ypos (GESTrackTitleSource *self,
gdouble position);
const gchar *ges_track_title_source_get_text (GESTrackTitleSource *source);
const gchar *ges_track_title_source_get_font_desc (GESTrackTitleSource *source);
GESTextHAlign ges_track_title_source_get_halignment (GESTrackTitleSource *source);
GESTextVAlign ges_track_title_source_get_valignment (GESTrackTitleSource *source);
const guint32 ges_track_title_source_get_color (GESTrackTitleSource *source);
const guint32 ges_track_title_source_get_background (GESTrackTitleSource *source);
const gdouble ges_track_title_source_get_xpos (GESTrackTitleSource *source);
const gdouble ges_track_title_source_get_ypos (GESTrackTitleSource *source);
GESTrackTitleSource* ges_track_title_source_new (void);
G_END_DECLS
#endif /* _GES_TRACK_TITLE_SOURCE */

View file

@ -126,9 +126,9 @@ typedef struct _GESAudioTestSource GESAudioTestSource;
typedef struct _GESAudioTestSourceClass
GESAudioTestSourceClass;
typedef struct _GESTrackTitleSource GESTrackTitleSource;
typedef struct _GESTrackTitleSourceClass
GESTrackTitleSourceClass;
typedef struct _GESTitleSource GESTitleSource;
typedef struct _GESTitleSourceClass
GESTitleSourceClass;
typedef struct _GESTrackTextOverlay GESTrackTextOverlay;
typedef struct _GESTrackTextOverlayClass

View file

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

View file

@ -129,11 +129,10 @@ GST_START_TEST (test_title_source_in_layer)
g_free (text);
trobj =
ges_clip_find_track_element (GES_CLIP (source), v,
GES_TYPE_TRACK_TITLE_SOURCE);
ges_clip_find_track_element (GES_CLIP (source), v, GES_TYPE_TITLE_SOURCE);
/* Check the text is still the same */
assert_equals_string (ges_track_title_source_get_text (GES_TRACK_TITLE_SOURCE
assert_equals_string (ges_title_source_get_text (GES_TITLE_SOURCE
(trobj)), "some text");
/* test the font-desc property */
@ -143,7 +142,7 @@ GST_START_TEST (test_title_source_in_layer)
g_free (text);
assert_equals_string ("sans 72",
ges_track_title_source_get_font_desc (GES_TRACK_TITLE_SOURCE (trobj)));
ges_title_source_get_font_desc (GES_TITLE_SOURCE (trobj)));
/* test halign and valign */
g_object_set (source, "halignment", (gint)
@ -152,17 +151,17 @@ GST_START_TEST (test_title_source_in_layer)
assert_equals_int (halign, GES_TEXT_HALIGN_LEFT);
assert_equals_int (valign, GES_TEXT_VALIGN_TOP);
assert_equals_int (ges_track_title_source_get_halignment
(GES_TRACK_TITLE_SOURCE (trobj)), GES_TEXT_HALIGN_LEFT);
assert_equals_int (ges_track_title_source_get_valignment
(GES_TRACK_TITLE_SOURCE (trobj)), GES_TEXT_VALIGN_TOP);
assert_equals_int (ges_title_source_get_halignment
(GES_TITLE_SOURCE (trobj)), GES_TEXT_HALIGN_LEFT);
assert_equals_int (ges_title_source_get_valignment
(GES_TITLE_SOURCE (trobj)), GES_TEXT_VALIGN_TOP);
/* test color */
g_object_set (source, "color", (gint) 2147483647, NULL);
g_object_get (source, "color", &color, NULL);
assert_equals_int (color, 2147483647);
color = ges_track_title_source_get_color (GES_TRACK_TITLE_SOURCE (trobj));
color = ges_title_source_get_color (GES_TITLE_SOURCE (trobj));
assert_equals_int (color, 2147483647);
/* test xpos */
@ -170,7 +169,7 @@ GST_START_TEST (test_title_source_in_layer)
g_object_get (source, "xpos", &xpos, NULL);
assert_equals_float (xpos, 0.25);
xpos = ges_track_title_source_get_xpos (GES_TRACK_TITLE_SOURCE (trobj));
xpos = ges_title_source_get_xpos (GES_TITLE_SOURCE (trobj));
assert_equals_float (xpos, 0.25);
/* test ypos */
@ -178,7 +177,7 @@ GST_START_TEST (test_title_source_in_layer)
g_object_get (source, "ypos", &ypos, NULL);
assert_equals_float (ypos, 0.66);
xpos = ges_track_title_source_get_xpos (GES_TRACK_TITLE_SOURCE (trobj));
xpos = ges_title_source_get_xpos (GES_TITLE_SOURCE (trobj));
assert_equals_float (ypos, 0.66);
GST_DEBUG ("removing the source");