Rename GESTimelineTileSource to GESTitleClip

This commit is contained in:
Thibault Saunier 2013-01-17 00:55:03 -03:00
parent a2f670448e
commit 5da46b7658
14 changed files with 307 additions and 332 deletions

View file

@ -22,7 +22,7 @@ LOCAL_SRC_FILES := \
ges-transition-clip.c \
ges-standard-transition-clip.c \
ges-timeline-test-source.c \
ges-timeline-title-source.c \
ges-title-clip.c \
ges-overlay-clip.c \
ges-text-overlay-clip.c \
ges-track.c \

View file

@ -54,7 +54,7 @@ platform as well as Windows. It is released under the GNU Library General Public
<chapter>
<title>Timeline objects</title>
<xi:include href="xml/ges-timeline-filesource.xml"/>
<xi:include href="xml/ges-timeline-title-source.xml"/>
<xi:include href="xml/ges-title-clip.xml"/>
<xi:include href="xml/ges-timeline-test-source.xml"/>
<xi:include href="xml/ges-text-overlay-clip.xml"/>
<xi:include href="xml/ges-standard-transition-clip.xml"/>

View file

@ -630,37 +630,37 @@ GES_TIMELINE_TEST_SOURCE_GET_CLASS
</SECTION>
<SECTION>
<FILE>ges-timeline-title-source</FILE>
<TITLE>GESTimelineTitleSource</TITLE>
GESTimelineTitleSource
ges_timeline_title_source_new
ges_timeline_title_source_set_text
ges_timeline_title_source_set_font_desc
ges_timeline_title_source_set_halignment
ges_timeline_title_source_set_valignment
ges_timeline_title_source_set_mute
ges_timeline_title_source_set_color
ges_timeline_title_source_set_background
ges_timeline_title_source_set_xpos
ges_timeline_title_source_set_ypos
ges_timeline_title_source_get_text
ges_timeline_title_source_get_font_desc
ges_timeline_title_source_get_valignment
ges_timeline_title_source_get_halignment
ges_timeline_title_source_is_muted
ges_timeline_title_source_get_color
ges_timeline_title_source_get_background
ges_timeline_title_source_get_xpos
ges_timeline_title_source_get_ypos
<FILE>ges-title-clip</FILE>
<TITLE>GESTitleClip</TITLE>
GESTitleClip
ges_title_clip_new
ges_title_clip_set_text
ges_title_clip_set_font_desc
ges_title_clip_set_halignment
ges_title_clip_set_valignment
ges_title_clip_set_mute
ges_title_clip_set_color
ges_title_clip_set_background
ges_title_clip_set_xpos
ges_title_clip_set_ypos
ges_title_clip_get_text
ges_title_clip_get_font_desc
ges_title_clip_get_valignment
ges_title_clip_get_halignment
ges_title_clip_is_muted
ges_title_clip_get_color
ges_title_clip_get_background
ges_title_clip_get_xpos
ges_title_clip_get_ypos
<SUBSECTION Standard>
GESTimelineTitleSourceClass
GESTimelineTitleSourcePrivate
ges_timeline_title_source_get_type
GES_IS_TIMELINE_TITLE_SOURCE
GES_IS_TIMELINE_TITLE_SOURCE_CLASS
GES_TIMELINE_TITLE_SOURCE
GES_TIMELINE_TITLE_SOURCE_CLASS
GES_TIMELINE_TITLE_SOURCE_GET_CLASS
GESTitleClipClass
GESTitleClipPrivate
ges_title_clip_get_type
GES_IS_TITLE_CLIP
GES_IS_TITLE_CLIP_CLASS
GES_TITLE_CLIP
GES_TITLE_CLIP_CLASS
GES_TITLE_CLIP_GET_CLASS
</SECTION>
<SECTION>
@ -762,7 +762,7 @@ ges_track_title_source_get_type
GES_TRACK_TITLE_SOURCE
GES_TRACK_TITLE_SOURCE_CLASS
GES_TRACK_TITLE_SOURCE_GET_CLASS
GES_TYPE_TIMELINE_TITLE_SOURCE
GES_TYPE_TITLE_CLIP
GES_TYPE_TRACK_TITLE_SOURCE
GES_IS_TRACK_TITLE_SOURCE
GES_IS_TRACK_TITLE_SOURCE_CLASS

View file

@ -20,7 +20,7 @@ ges_effect_clip_get_type
ges_standard_effect_clip_get_type
ges_uri_clip_get_type
ges_overlay_text_clip_get_type
ges_timeline_title_source_get_type
ges_title_clip_get_type
ges_track_audio_test_source_get_type
ges_track_audio_transition_get_type
ges_track_filesource_get_type

View file

@ -26,7 +26,7 @@ libges_@GST_API_VERSION@_la_SOURCES = \
ges-transition-clip.c \
ges-standard-transition-clip.c \
ges-timeline-test-source.c \
ges-timeline-title-source.c \
ges-title-clip.c \
ges-overlay-clip.c \
ges-text-overlay-clip.c \
ges-track.c \
@ -80,7 +80,7 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-transition-clip.h \
ges-standard-transition-clip.h \
ges-timeline-test-source.h \
ges-timeline-title-source.h \
ges-title-clip.h \
ges-overlay-clip.h \
ges-text-overlay-clip.h \
ges-track-effect.h \

View file

@ -1,141 +0,0 @@
/* GStreamer Editing Services
* Copyright (C) 2009 Brandon Lewis <brandon.lewis@collabora.co.uk>
* 2009 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_TIMELINE_TITLESOURCE
#define _GES_TIMELINE_TITLESOURCE
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-source-clip.h>
#include <ges/ges-track.h>
G_BEGIN_DECLS
#define GES_TYPE_TIMELINE_TITLE_SOURCE ges_timeline_title_source_get_type()
#define GES_TIMELINE_TITLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TIMELINE_TITLE_SOURCE, GESTimelineTitleSource))
#define GES_TIMELINE_TITLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TIMELINE_TITLE_SOURCE, GESTimelineTitleSourceClass))
#define GES_IS_TIMELINE_TITLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TIMELINE_TITLE_SOURCE))
#define GES_IS_TIMELINE_TITLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TIMELINE_TITLE_SOURCE))
#define GES_TIMELINE_TITLE_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_TITLE_SOURCE, GESTimelineTitleSourceClass))
typedef struct _GESTimelineTitleSourcePrivate GESTimelineTitleSourcePrivate;
/**
* GESTimelineTitleSource:
*
* Render stand-alone titles in GESTimelineLayer.
*/
struct _GESTimelineTitleSource {
GESSourceClip parent;
/*< private >*/
GESTimelineTitleSourcePrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
struct _GESTimelineTitleSourceClass {
/*< private >*/
GESSourceClipClass parent_class;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_timeline_title_source_get_type (void);
void
ges_timeline_title_source_set_mute (GESTimelineTitleSource * self,
gboolean mute);
void
ges_timeline_title_source_set_text( GESTimelineTitleSource * self,
const gchar * text);
void
ges_timeline_title_source_set_font_desc (GESTimelineTitleSource * self,
const gchar * font_desc);
void
ges_timeline_title_source_set_valignment (GESTimelineTitleSource * self,
GESTextVAlign valign);
void
ges_timeline_title_source_set_halignment (GESTimelineTitleSource * self,
GESTextHAlign halign);
void
ges_timeline_title_source_set_color (GESTimelineTitleSource * self,
guint32 color);
void
ges_timeline_title_source_set_background (GESTimelineTitleSource * self,
guint32 background);
void
ges_timeline_title_source_set_xpos (GESTimelineTitleSource * self,
gdouble position);
void
ges_timeline_title_source_set_ypos (GESTimelineTitleSource * self,
gdouble position);
const gchar*
ges_timeline_title_source_get_font_desc (GESTimelineTitleSource * self);
GESTextVAlign
ges_timeline_title_source_get_valignment (GESTimelineTitleSource * self);
GESTextHAlign
ges_timeline_title_source_get_halignment (GESTimelineTitleSource * self);
const guint32
ges_timeline_title_source_get_color (GESTimelineTitleSource * self);
const guint32
ges_timeline_title_source_get_background (GESTimelineTitleSource * self);
const gdouble
ges_timeline_title_source_get_xpos (GESTimelineTitleSource * self);
const gdouble
ges_timeline_title_source_get_ypos (GESTimelineTitleSource * self);
gboolean ges_timeline_title_source_is_muted (GESTimelineTitleSource * self);
const gchar* ges_timeline_title_source_get_text (GESTimelineTitleSource * self);
GESTimelineTitleSource* ges_timeline_title_source_new (void);
G_END_DECLS
#endif /* _GES_TIMELINE_TITLESOURCE */

View file

@ -19,7 +19,7 @@
*/
/**
* SECTION:ges-timeline-title-source
* SECTION:ges-title-clip
* @short_description: Render stand-alone titles in GESTimelineLayer.
*
* Renders the given text in the specified font, at specified position, and
@ -27,21 +27,20 @@
*/
#include "ges-internal.h"
#include "ges-timeline-title-source.h"
#include "ges-title-clip.h"
#include "ges-source-clip.h"
#include "ges-track-object.h"
#include "ges-track-title-source.h"
#include <string.h>
G_DEFINE_TYPE (GESTimelineTitleSource, ges_timeline_title_source,
GES_TYPE_SOURCE_CLIP);
G_DEFINE_TYPE (GESTitleClip, ges_title_clip, GES_TYPE_SOURCE_CLIP);
#define DEFAULT_TEXT ""
#define DEFAULT_FONT_DESC "Serif 36"
#define GES_TIMELINE_TITLE_SOURCE_VALIGN_TYPE (ges_timeline_title_source_valign_get_type())
#define GES_TIMELINE_TITLE_SOURCE_HALIGN_TYPE (ges_timeline_title_source_halign_get_type())
#define GES_TITLE_CLIP_VALIGN_TYPE (ges_title_clip_valign_get_type())
#define GES_TITLE_CLIP_HALIGN_TYPE (ges_title_clip_halign_get_type())
struct _GESTimelineTitleSourcePrivate
struct _GESTitleClipPrivate
{
gboolean mute;
gchar *text;
@ -70,22 +69,18 @@ enum
};
static GESTrackObject
* ges_timeline_title_source_create_track_object (GESClip * obj,
GESTrackType type);
* ges_title_clip_create_track_object (GESClip * obj, GESTrackType type);
static void
ges_timeline_title_source_track_object_added (GESClip * obj,
GESTrackObject * tckobj);
ges_title_clip_track_object_added (GESClip * obj, GESTrackObject * tckobj);
static void
ges_timeline_title_source_track_object_released (GESClip * obj,
GESTrackObject * tckobj);
ges_title_clip_track_object_released (GESClip * obj, GESTrackObject * tckobj);
static void
ges_timeline_title_source_get_property (GObject * object, guint property_id,
ges_title_clip_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
GESTimelineTitleSourcePrivate *priv =
GES_TIMELINE_TITLE_SOURCE (object)->priv;
GESTitleClipPrivate *priv = GES_TITLE_CLIP (object)->priv;
switch (property_id) {
case PROP_MUTE:
@ -121,42 +116,38 @@ ges_timeline_title_source_get_property (GObject * object, guint property_id,
}
static void
ges_timeline_title_source_set_property (GObject * object, guint property_id,
ges_title_clip_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTimelineTitleSource *uriclip = GES_TIMELINE_TITLE_SOURCE (object);
GESTitleClip *uriclip = GES_TITLE_CLIP (object);
switch (property_id) {
case PROP_MUTE:
ges_timeline_title_source_set_mute (uriclip, g_value_get_boolean (value));
ges_title_clip_set_mute (uriclip, g_value_get_boolean (value));
break;
case PROP_TEXT:
ges_timeline_title_source_set_text (uriclip, g_value_get_string (value));
ges_title_clip_set_text (uriclip, g_value_get_string (value));
break;
case PROP_FONT_DESC:
ges_timeline_title_source_set_font_desc (uriclip,
g_value_get_string (value));
ges_title_clip_set_font_desc (uriclip, g_value_get_string (value));
break;
case PROP_HALIGNMENT:
ges_timeline_title_source_set_halignment (uriclip,
g_value_get_enum (value));
ges_title_clip_set_halignment (uriclip, g_value_get_enum (value));
break;
case PROP_VALIGNMENT:
ges_timeline_title_source_set_valignment (uriclip,
g_value_get_enum (value));
ges_title_clip_set_valignment (uriclip, g_value_get_enum (value));
break;
case PROP_COLOR:
ges_timeline_title_source_set_color (uriclip, g_value_get_uint (value));
ges_title_clip_set_color (uriclip, g_value_get_uint (value));
break;
case PROP_BACKGROUND:
ges_timeline_title_source_set_background (uriclip,
g_value_get_uint (value));
ges_title_clip_set_background (uriclip, g_value_get_uint (value));
break;
case PROP_XPOS:
ges_timeline_title_source_set_xpos (uriclip, g_value_get_double (value));
ges_title_clip_set_xpos (uriclip, g_value_get_double (value));
break;
case PROP_YPOS:
ges_timeline_title_source_set_ypos (uriclip, g_value_get_double (value));
ges_title_clip_set_ypos (uriclip, g_value_get_double (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -164,32 +155,32 @@ ges_timeline_title_source_set_property (GObject * object, guint property_id,
}
static void
ges_timeline_title_source_dispose (GObject * object)
ges_title_clip_dispose (GObject * object)
{
GESTimelineTitleSource *self = GES_TIMELINE_TITLE_SOURCE (object);
GESTitleClip *self = GES_TITLE_CLIP (object);
if (self->priv->text)
g_free (self->priv->text);
if (self->priv->font_desc)
g_free (self->priv->font_desc);
G_OBJECT_CLASS (ges_timeline_title_source_parent_class)->dispose (object);
G_OBJECT_CLASS (ges_title_clip_parent_class)->dispose (object);
}
static void
ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
ges_title_clip_class_init (GESTitleClipClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
g_type_class_add_private (klass, sizeof (GESTimelineTitleSourcePrivate));
g_type_class_add_private (klass, sizeof (GESTitleClipPrivate));
object_class->get_property = ges_timeline_title_source_get_property;
object_class->set_property = ges_timeline_title_source_set_property;
object_class->dispose = ges_timeline_title_source_dispose;
object_class->get_property = ges_title_clip_get_property;
object_class->set_property = ges_title_clip_set_property;
object_class->dispose = ges_title_clip_dispose;
/**
* GESTimelineTitleSource:text:
* GESTitleClip:text:
*
* The text to diplay
*/
@ -198,7 +189,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
DEFAULT_TEXT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GESTimelineTitleSource:font-desc:
* GESTitleClip:font-desc:
*
* Pango font description string
*/
@ -210,7 +201,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
/**
* GESTimelineTitleSource:valignment:
* GESTitleClip:valignment:
*
* Vertical alignent of the text
*/
@ -220,7 +211,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
DEFAULT_VALIGNMENT,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
/**
* GESTimelineTitleSource:halignment:
* GESTitleClip:halignment:
*
* Horizontal alignment of the text
*/
@ -230,7 +221,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
GES_TEXT_HALIGN_TYPE, DEFAULT_HALIGNMENT,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
/**
* GESTimelineTitleSource:mute:
* GESTitleClip:mute:
*
* Whether the sound will be played or not.
*/
@ -238,16 +229,13 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
g_param_spec_boolean ("mute", "Mute", "Mute audio track",
FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
timobj_class->create_track_object =
ges_timeline_title_source_create_track_object;
timobj_class->create_track_object = ges_title_clip_create_track_object;
timobj_class->need_fill_track = FALSE;
timobj_class->track_object_added =
ges_timeline_title_source_track_object_added;
timobj_class->track_object_released =
ges_timeline_title_source_track_object_released;
timobj_class->track_object_added = ges_title_clip_track_object_added;
timobj_class->track_object_released = ges_title_clip_track_object_released;
/**
* GESTimelineTitleSource:color:
* GESTitleClip:color:
*
* The color of the text
*/
@ -257,7 +245,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
0, G_MAXUINT32, G_MAXUINT32, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GESTimelineTitleSource:background:
* GESTitleClip:background:
*
* The background of the text
*/
@ -268,7 +256,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GESTimelineTitleSource:xpos:
* GESTitleClip:xpos:
*
* The horizontal position of the text
*/
@ -278,7 +266,7 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
0, 1, 0.5, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
/**
* GESTimelineTitleSource:ypos:
* GESTitleClip:ypos:
*
* The vertical position of the text
*/
@ -289,10 +277,10 @@ ges_timeline_title_source_class_init (GESTimelineTitleSourceClass * klass)
}
static void
ges_timeline_title_source_init (GESTimelineTitleSource * self)
ges_title_clip_init (GESTitleClip * self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_TIMELINE_TITLE_SOURCE, GESTimelineTitleSourcePrivate);
GES_TYPE_TITLE_CLIP, GESTitleClipPrivate);
GES_TIMELINE_ELEMENT (self)->duration = 0;
/* Not 100% required since a new gobject's content will always be memzero'd */
@ -308,8 +296,8 @@ ges_timeline_title_source_init (GESTimelineTitleSource * self)
}
/**
* ges_timeline_title_source_set_text:
* @self: the #GESTimelineTitleSource* to set text on
* ges_title_clip_set_text:
* @self: the #GESTitleClip* to set text on
* @text: the text to render. an internal copy of this text will be
* made.
*
@ -317,8 +305,7 @@ ges_timeline_title_source_init (GESTimelineTitleSource * self)
*
*/
void
ges_timeline_title_source_set_text (GESTimelineTitleSource * self,
const gchar * text)
ges_title_clip_set_text (GESTitleClip * self, const gchar * text)
{
GSList *tmp;
@ -336,16 +323,15 @@ ges_timeline_title_source_set_text (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_font_desc:
* @self: the #GESTimelineTitleSource*
* ges_title_clip_set_font_desc:
* @self: the #GESTitleClip*
* @font_desc: the pango font description
*
* Sets the pango font description of the text.
*
*/
void
ges_timeline_title_source_set_font_desc (GESTimelineTitleSource * self,
const gchar * font_desc)
ges_title_clip_set_font_desc (GESTitleClip * self, const gchar * font_desc)
{
GSList *tmp;
@ -363,16 +349,15 @@ ges_timeline_title_source_set_font_desc (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_halignment:
* @self: the #GESTimelineTitleSource* to set horizontal alignement of text on
* ges_title_clip_set_halignment:
* @self: the #GESTitleClip* to set horizontal alignement of text on
* @halign: #GESTextHAlign
*
* Sets the horizontal aligment of the text.
*
*/
void
ges_timeline_title_source_set_halignment (GESTimelineTitleSource * self,
GESTextHAlign halign)
ges_title_clip_set_halignment (GESTitleClip * self, GESTextHAlign halign)
{
GSList *tmp;
@ -387,16 +372,15 @@ ges_timeline_title_source_set_halignment (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_valignment:
* @self: the #GESTimelineTitleSource* to set vertical alignement of text on
* ges_title_clip_set_valignment:
* @self: the #GESTitleClip* to set vertical alignement of text on
* @valign: #GESTextVAlign
*
* Sets the vertical aligment of the text.
*
*/
void
ges_timeline_title_source_set_valignment (GESTimelineTitleSource * self,
GESTextVAlign valign)
ges_title_clip_set_valignment (GESTitleClip * self, GESTextVAlign valign)
{
GSList *tmp;
@ -411,16 +395,15 @@ ges_timeline_title_source_set_valignment (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_mute:
* @self: the #GESTimelineTitleSource on which to mute or unmute the audio track
* ges_title_clip_set_mute:
* @self: the #GESTitleClip on which to mute or unmute the audio track
* @mute: %TRUE to mute the audio track, %FALSE to unmute it
*
* Sets whether the audio track of this timeline object is muted or not
*
*/
void
ges_timeline_title_source_set_mute (GESTimelineTitleSource * self,
gboolean mute)
ges_title_clip_set_mute (GESTitleClip * self, gboolean mute)
{
GList *tmp, *trackobjects;
GESClip *object = (GESClip *) self;
@ -444,8 +427,8 @@ ges_timeline_title_source_set_mute (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_color:
* @self: the #GESTimelineTitleSource* to set
* ges_title_clip_set_color:
* @self: the #GESTitleClip* to set
* @color: The color @self is being set to
*
* Sets the color of the text.
@ -453,8 +436,7 @@ ges_timeline_title_source_set_mute (GESTimelineTitleSource * self,
* Since: 0.10.2
*/
void
ges_timeline_title_source_set_color (GESTimelineTitleSource * self,
guint32 color)
ges_title_clip_set_color (GESTitleClip * self, guint32 color)
{
GSList *tmp;
@ -469,15 +451,14 @@ ges_timeline_title_source_set_color (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_background:
* @self: the #GESTimelineTitleSource* to set
* ges_title_clip_set_background:
* @self: the #GESTitleClip* to set
* @background: The color @self is being set to
*
* Sets the background of the text.
*/
void
ges_timeline_title_source_set_background (GESTimelineTitleSource * self,
guint32 background)
ges_title_clip_set_background (GESTitleClip * self, guint32 background)
{
GSList *tmp;
@ -493,8 +474,8 @@ ges_timeline_title_source_set_background (GESTimelineTitleSource * self,
/**
* ges_timeline_title_source_set_xpos:
* @self: the #GESTimelineTitleSource* to set
* ges_title_clip_set_xpos:
* @self: the #GESTitleClip* to set
* @position: The horizontal position @self is being set to
*
* Sets the horizontal position of the text.
@ -502,8 +483,7 @@ ges_timeline_title_source_set_background (GESTimelineTitleSource * self,
* Since: 0.10.2
*/
void
ges_timeline_title_source_set_xpos (GESTimelineTitleSource * self,
gdouble position)
ges_title_clip_set_xpos (GESTitleClip * self, gdouble position)
{
GSList *tmp;
@ -518,8 +498,8 @@ ges_timeline_title_source_set_xpos (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_set_ypos:
* @self: the #GESTimelineTitleSource* to set
* ges_title_clip_set_ypos:
* @self: the #GESTitleClip* to set
* @position: The vertical position @self is being set to
*
* Sets the vertical position of the text.
@ -527,8 +507,7 @@ ges_timeline_title_source_set_xpos (GESTimelineTitleSource * self,
* Since: 0.10.2
*/
void
ges_timeline_title_source_set_ypos (GESTimelineTitleSource * self,
gdouble position)
ges_title_clip_set_ypos (GESTitleClip * self, gdouble position)
{
GSList *tmp;
@ -543,8 +522,8 @@ ges_timeline_title_source_set_ypos (GESTimelineTitleSource * self,
}
/**
* ges_timeline_title_source_get_text:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_text:
* @self: a #GESTitleClip
*
* Get the text currently set on @self.
*
@ -552,14 +531,14 @@ ges_timeline_title_source_set_ypos (GESTimelineTitleSource * self,
*
*/
const gchar *
ges_timeline_title_source_get_text (GESTimelineTitleSource * self)
ges_title_clip_get_text (GESTitleClip * self)
{
return self->priv->text;
}
/**
* ges_timeline_title_source_get_font_desc:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_font_desc:
* @self: a #GESTitleClip
*
* Get the pango font description used by @self.
*
@ -567,14 +546,14 @@ ges_timeline_title_source_get_text (GESTimelineTitleSource * self)
*
*/
const char *
ges_timeline_title_source_get_font_desc (GESTimelineTitleSource * self)
ges_title_clip_get_font_desc (GESTitleClip * self)
{
return self->priv->font_desc;
}
/**
* ges_timeline_title_source_get_halignment:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_halignment:
* @self: a #GESTitleClip
*
* Get the horizontal aligment used by @self.
*
@ -582,14 +561,14 @@ ges_timeline_title_source_get_font_desc (GESTimelineTitleSource * self)
*
*/
GESTextHAlign
ges_timeline_title_source_get_halignment (GESTimelineTitleSource * self)
ges_title_clip_get_halignment (GESTitleClip * self)
{
return self->priv->halign;
}
/**
* ges_timeline_title_source_get_valignment:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_valignment:
* @self: a #GESTitleClip
*
* Get the vertical aligment used by @self.
*
@ -597,14 +576,14 @@ ges_timeline_title_source_get_halignment (GESTimelineTitleSource * self)
*
*/
GESTextVAlign
ges_timeline_title_source_get_valignment (GESTimelineTitleSource * self)
ges_title_clip_get_valignment (GESTitleClip * self)
{
return self->priv->valign;
}
/**
* ges_timeline_title_source_is_muted:
* @self: a #GESTimelineTitleSource
* ges_title_clip_is_muted:
* @self: a #GESTitleClip
*
* Let you know if the audio track of @self is muted or not.
*
@ -612,14 +591,14 @@ ges_timeline_title_source_get_valignment (GESTimelineTitleSource * self)
*
*/
gboolean
ges_timeline_title_source_is_muted (GESTimelineTitleSource * self)
ges_title_clip_is_muted (GESTitleClip * self)
{
return self->priv->mute;
}
/**
* ges_timeline_title_source_get_color:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_color:
* @self: a #GESTitleClip
*
* Get the color used by @self.
*
@ -628,28 +607,28 @@ ges_timeline_title_source_is_muted (GESTimelineTitleSource * self)
* Since: 0.10.2
*/
const guint32
ges_timeline_title_source_get_color (GESTimelineTitleSource * self)
ges_title_clip_get_color (GESTitleClip * self)
{
return self->priv->color;
}
/**
* ges_timeline_title_source_get_background:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_background:
* @self: a #GESTitleClip
*
* Get the background used by @self.
*
* Returns: The color used by @self.
*/
const guint32
ges_timeline_title_source_get_background (GESTimelineTitleSource * self)
ges_title_clip_get_background (GESTitleClip * self)
{
return self->priv->background;
}
/**
* ges_timeline_title_source_get_xpos:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_xpos:
* @self: a #GESTitleClip
*
* Get the horizontal position used by @self.
*
@ -658,14 +637,14 @@ ges_timeline_title_source_get_background (GESTimelineTitleSource * self)
* Since: 0.10.2
*/
const gdouble
ges_timeline_title_source_get_xpos (GESTimelineTitleSource * self)
ges_title_clip_get_xpos (GESTitleClip * self)
{
return self->priv->xpos;
}
/**
* ges_timeline_title_source_get_ypos:
* @self: a #GESTimelineTitleSource
* ges_title_clip_get_ypos:
* @self: a #GESTitleClip
*
* Get the vertical position used by @self.
*
@ -674,16 +653,15 @@ ges_timeline_title_source_get_xpos (GESTimelineTitleSource * self)
* Since: 0.10.2
*/
const gdouble
ges_timeline_title_source_get_ypos (GESTimelineTitleSource * self)
ges_title_clip_get_ypos (GESTitleClip * self)
{
return self->priv->ypos;
}
static void
ges_timeline_title_source_track_object_released (GESClip * obj,
GESTrackObject * tckobj)
ges_title_clip_track_object_released (GESClip * obj, GESTrackObject * tckobj)
{
GESTimelineTitleSourcePrivate *priv = GES_TIMELINE_TITLE_SOURCE (obj)->priv;
GESTitleClipPrivate *priv = GES_TITLE_CLIP (obj)->priv;
/* If this is called, we should be sure the tckobj exists */
if (GES_IS_TRACK_TITLE_SOURCE (tckobj)) {
@ -694,10 +672,9 @@ ges_timeline_title_source_track_object_released (GESClip * obj,
}
static void
ges_timeline_title_source_track_object_added (GESClip * obj,
GESTrackObject * tckobj)
ges_title_clip_track_object_added (GESClip * obj, GESTrackObject * tckobj)
{
GESTimelineTitleSourcePrivate *priv = GES_TIMELINE_TITLE_SOURCE (obj)->priv;
GESTitleClipPrivate *priv = GES_TITLE_CLIP (obj)->priv;
if (GES_IS_TRACK_TITLE_SOURCE (tckobj)) {
GST_DEBUG_OBJECT (obj, "%p added to %p", tckobj, obj);
@ -707,10 +684,10 @@ ges_timeline_title_source_track_object_added (GESClip * obj,
}
static GESTrackObject *
ges_timeline_title_source_create_track_object (GESClip * obj, GESTrackType type)
ges_title_clip_create_track_object (GESClip * obj, GESTrackType type)
{
GESTimelineTitleSourcePrivate *priv = GES_TIMELINE_TITLE_SOURCE (obj)->priv;
GESTitleClipPrivate *priv = GES_TITLE_CLIP (obj)->priv;
GESTrackObject *res = NULL;
GST_DEBUG_OBJECT (obj, "a GESTrackTitleSource");
@ -736,16 +713,16 @@ ges_timeline_title_source_create_track_object (GESClip * obj, GESTrackType type)
}
/**
* ges_timeline_title_source_new:
* ges_title_clip_new:
*
* Creates a new #GESTimelineTitleSource
* Creates a new #GESTitleClip
*
* Returns: The newly created #GESTimelineTitleSource, or NULL if there was an
* Returns: The newly created #GESTitleClip, or NULL if there was an
* error.
*/
GESTimelineTitleSource *
ges_timeline_title_source_new (void)
GESTitleClip *
ges_title_clip_new (void)
{
/* FIXME : Check for validity/existence of URI */
return g_object_new (GES_TYPE_TIMELINE_TITLE_SOURCE, NULL);
return g_object_new (GES_TYPE_TITLE_CLIP, NULL);
}

141
ges/ges-title-clip.h Normal file
View file

@ -0,0 +1,141 @@
/* GStreamer Editing Services
* Copyright (C) 2009 Brandon Lewis <brandon.lewis@collabora.co.uk>
* 2009 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_TIMELINE_TITLESOURCE
#define _GES_TIMELINE_TITLESOURCE
#include <glib-object.h>
#include <ges/ges-types.h>
#include <ges/ges-source-clip.h>
#include <ges/ges-track.h>
G_BEGIN_DECLS
#define GES_TYPE_TITLE_CLIP ges_title_clip_get_type()
#define GES_TITLE_CLIP(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TITLE_CLIP, GESTitleClip))
#define GES_TITLE_CLIP_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TITLE_CLIP, GESTitleClipClass))
#define GES_IS_TITLE_CLIP(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TITLE_CLIP))
#define GES_IS_TITLE_CLIP_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TITLE_CLIP))
#define GES_TITLE_CLIP_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TITLE_CLIP, GESTitleClipClass))
typedef struct _GESTitleClipPrivate GESTitleClipPrivate;
/**
* GESTitleClip:
*
* Render stand-alone titles in GESTimelineLayer.
*/
struct _GESTitleClip {
GESSourceClip parent;
/*< private >*/
GESTitleClipPrivate *priv;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
struct _GESTitleClipClass {
/*< private >*/
GESSourceClipClass parent_class;
/* Padding for API extension */
gpointer _ges_reserved[GES_PADDING];
};
GType ges_title_clip_get_type (void);
void
ges_title_clip_set_mute (GESTitleClip * self,
gboolean mute);
void
ges_title_clip_set_text( GESTitleClip * self,
const gchar * text);
void
ges_title_clip_set_font_desc (GESTitleClip * self,
const gchar * font_desc);
void
ges_title_clip_set_valignment (GESTitleClip * self,
GESTextVAlign valign);
void
ges_title_clip_set_halignment (GESTitleClip * self,
GESTextHAlign halign);
void
ges_title_clip_set_color (GESTitleClip * self,
guint32 color);
void
ges_title_clip_set_background (GESTitleClip * self,
guint32 background);
void
ges_title_clip_set_xpos (GESTitleClip * self,
gdouble position);
void
ges_title_clip_set_ypos (GESTitleClip * self,
gdouble position);
const gchar*
ges_title_clip_get_font_desc (GESTitleClip * self);
GESTextVAlign
ges_title_clip_get_valignment (GESTitleClip * self);
GESTextHAlign
ges_title_clip_get_halignment (GESTitleClip * self);
const guint32
ges_title_clip_get_color (GESTitleClip * self);
const guint32
ges_title_clip_get_background (GESTitleClip * self);
const gdouble
ges_title_clip_get_xpos (GESTitleClip * self);
const gdouble
ges_title_clip_get_ypos (GESTitleClip * self);
gboolean ges_title_clip_is_muted (GESTitleClip * self);
const gchar* ges_title_clip_get_text (GESTitleClip * self);
GESTitleClip* ges_title_clip_new (void);
G_END_DECLS
#endif /* _GES_TIMELINE_TITLESOURCE */

View file

@ -71,8 +71,8 @@ typedef struct _GESStandardTransitionClipClass GESStandardTransitionClipClass;
typedef struct _GESTimelineTestSource GESTimelineTestSource;
typedef struct _GESTimelineTestSourceClass GESTimelineTestSourceClass;
typedef struct _GESTimelineTitleSource GESTimelineTitleSource;
typedef struct _GESTimelineTitleSourceClass GESTimelineTitleSourceClass;
typedef struct _GESTitleClip GESTitleClip;
typedef struct _GESTitleClipClass GESTitleClipClass;
typedef struct _GESOverlayClip GESOverlayClip;
typedef struct _GESOverlayClipClass GESOverlayClipClass;

View file

@ -73,7 +73,7 @@ ges_init (void)
GES_TYPE_TIMELINE_TEST_SOURCE;
GES_TYPE_URI_CLIP;
GES_TYPE_TIMELINE_TITLE_SOURCE;
GES_TYPE_TITLE_CLIP;
GES_TYPE_STANDARD_TRANSITION_CLIP;
GES_TYPE_OVERLAY_CLIP;

View file

@ -34,7 +34,7 @@
#include <ges/ges-timeline-pipeline.h>
#include <ges/ges-source-clip.h>
#include <ges/ges-timeline-test-source.h>
#include <ges/ges-timeline-title-source.h>
#include <ges/ges-title-clip.h>
#include <ges/ges-operation-clip.h>
#include <ges/ges-effect-clip.h>
#include <ges/ges-overlay-clip.h>

View file

@ -23,11 +23,11 @@
GST_START_TEST (test_title_source_basic)
{
GESTimelineTitleSource *source;
GESTitleClip *source;
ges_init ();
source = ges_timeline_title_source_new ();
source = ges_title_clip_new ();
fail_unless (source != NULL);
g_object_unref (source);
@ -47,7 +47,7 @@ GST_START_TEST (test_title_source_properties)
fail_unless (track != NULL);
object = (GESClip *)
ges_timeline_title_source_new ();
ges_title_clip_new ();
fail_unless (object != NULL);
/* Set some properties */
@ -97,7 +97,7 @@ GST_START_TEST (test_title_source_in_layer)
GESTimelineLayer *layer;
GESTrack *a, *v;
GESTrackObject *trobj;
GESTimelineTitleSource *source;
GESTitleClip *source;
gchar *text;
gint halign, valign;
guint32 color;
@ -115,7 +115,7 @@ GST_START_TEST (test_title_source_in_layer)
ges_timeline_add_track (timeline, v);
ges_timeline_add_layer (timeline, layer);
source = ges_timeline_title_source_new ();
source = ges_title_clip_new ();
g_object_set (source, "duration", (guint64) GST_SECOND, NULL);

View file

@ -353,7 +353,7 @@ layer_object_added_cb (GESTimelineLayer * layer, GESClip * object, App * app)
gtk_list_store_set (app->model, &iter, 0, description, 2, object, -1);
}
else if (GES_IS_TIMELINE_TITLE_SOURCE (object)) {
else if (GES_IS_TITLE_CLIP (object)) {
gtk_list_store_set (app->model, &iter, 2, object, -1);
g_signal_connect (G_OBJECT (object), "notify::text",
G_CALLBACK (title_source_text_changed_cb), app);
@ -620,13 +620,11 @@ disconnect_from_filesource (GESClip * object, App * app)
static void
connect_to_title_source (GESClip * object, App * app)
{
GESTimelineTitleSource *obj;
obj = GES_TIMELINE_TITLE_SOURCE (object);
gtk_combo_box_set_active (app->halign,
ges_timeline_title_source_get_halignment (obj));
gtk_combo_box_set_active (app->valign,
ges_timeline_title_source_get_valignment (obj));
gtk_entry_set_text (app->text, ges_timeline_title_source_get_text (obj));
GESTitleClip *obj;
obj = GES_TITLE_CLIP (object);
gtk_combo_box_set_active (app->halign, ges_title_clip_get_halignment (obj));
gtk_combo_box_set_active (app->valign, ges_title_clip_get_valignment (obj));
gtk_entry_set_text (app->text, ges_title_clip_get_text (obj));
}
static void
@ -683,7 +681,7 @@ connect_to_object (GESClip * object, App * app)
if (GES_IS_URI_CLIP (object)) {
connect_to_filesource (object, app);
} else if (GES_IS_TIMELINE_TITLE_SOURCE (object)) {
} else if (GES_IS_TITLE_CLIP (object)) {
connect_to_title_source (object, app);
} else if (GES_IS_TIMELINE_TEST_SOURCE (object)) {
connect_to_test_source (object, app);
@ -697,7 +695,7 @@ disconnect_from_object (GESClip * object, App * app)
{
if (GES_IS_URI_CLIP (object)) {
disconnect_from_filesource (object, app);
} else if (GES_IS_TIMELINE_TITLE_SOURCE (object)) {
} else if (GES_IS_TITLE_CLIP (object)) {
disconnect_from_title_source (object, app);
} else if (GES_IS_TIMELINE_TEST_SOURCE (object)) {
disconnect_from_test_source (object, app);
@ -1191,7 +1189,7 @@ app_add_title (App * app)
GST_DEBUG ("adding title");
obj = GES_CLIP (ges_timeline_title_source_new ());
obj = GES_CLIP (ges_title_clip_new ());
g_object_set (G_OBJECT (obj), "duration", GST_SECOND, NULL);
ges_simple_timeline_layer_add_object (GES_SIMPLE_TIMELINE_LAYER (app->layer),
@ -1606,7 +1604,7 @@ app_selection_changed_cb (GtkTreeSelection * selection, App * app)
app->selected_type == GES_TYPE_URI_CLIP);
gtk_widget_set_visible (app->text_properties,
app->selected_type == GES_TYPE_TIMELINE_TITLE_SOURCE);
app->selected_type == GES_TYPE_TITLE_CLIP);
gtk_widget_set_visible (app->generic_duration,
app->selected_type != G_TYPE_NONE &&

View file

@ -193,7 +193,7 @@ create_timeline (int nbargs, gchar ** argv, gchar * audio, gchar * video)
}
else if (!g_strcmp0 ("+title", source)) {
obj = GES_CLIP (ges_timeline_title_source_new ());
obj = GES_CLIP (ges_title_clip_new ());
g_object_set (obj, "duration", duration, "text", arg0, NULL);