replace existing text position enums

This commit is contained in:
Brandon Lewis 2010-07-02 12:25:58 +02:00 committed by Edward Hervey
parent 2bb344635b
commit e588daf078
5 changed files with 18 additions and 55 deletions

View file

@ -447,9 +447,6 @@ GESTrackAudioTestSource
GESTrackAudioTestSourceClass GESTrackAudioTestSourceClass
ges_track_audio_test_source_new ges_track_audio_test_source_new
ges_track_audio_test_source_get_type ges_track_audio_test_source_get_type
DEFAULT_FONT_DESC
DEFAULT_HALIGNMENT
DEFAULT_VALIGNMENT
<SUBSECTION Standard> <SUBSECTION Standard>
GES_TRACK_AUDIO_TEST_SOURCE GES_TRACK_AUDIO_TEST_SOURCE
GES_TRACK_AUDIO_TEST_SOURCE_CLASS GES_TRACK_AUDIO_TEST_SOURCE_CLASS
@ -464,8 +461,6 @@ GES_IS_TRACK_AUDIO_TEST_SOURCE_CLASS
<TITLE>GESTrackTitleSource</TITLE> <TITLE>GESTrackTitleSource</TITLE>
GESTrackTitleSource GESTrackTitleSource
GESTrackTitleSourceClass GESTrackTitleSourceClass
GESTrackTitleSrcHAlign
GESTrackTitleSrcVAlign
ges_tl_title_src_get_type ges_tl_title_src_get_type
ges_track_title_source_set_text ges_track_title_source_set_text
ges_track_title_source_set_font_desc ges_track_title_source_set_font_desc

View file

@ -72,7 +72,7 @@ static void
ges_track_text_overlay_init (GESTrackTextOverlay * self) ges_track_text_overlay_init (GESTrackTextOverlay * self)
{ {
self->text = NULL; self->text = NULL;
self->font_desc = g_strdup (DEFAULT_FONT_DESC); self->font_desc = NULL;
self->text_el = NULL; self->text_el = NULL;
self->halign = DEFAULT_HALIGNMENT; self->halign = DEFAULT_HALIGNMENT;
self->valign = DEFAULT_VALIGNMENT; self->valign = DEFAULT_VALIGNMENT;
@ -207,13 +207,13 @@ ges_track_text_overlay_set_font_desc (GESTrackTextOverlay * self,
/** /**
* ges_track_text_overlay_valignment: * ges_track_text_overlay_valignment:
* @self: the #GESTrackTextOverlay* to set text on * @self: the #GESTrackTextOverlay* to set text on
* @valign: #GESTrackTitleSrcVAlign * @valign: #GESTextVAlign
* *
* Sets the vertical aligment of the text. * Sets the vertical aligment of the text.
*/ */
void void
ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self, ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self,
GESTrackTitleSrcVAlign valign) GESTextVAlign valign)
{ {
self->valign = valign; self->valign = valign;
GST_LOG ("set valignment to: %d", valign); GST_LOG ("set valignment to: %d", valign);
@ -224,13 +224,13 @@ ges_track_text_overlay_set_valignment (GESTrackTextOverlay * self,
/** /**
* ges_track_text_overlay_halignment: * ges_track_text_overlay_halignment:
* @self: the #GESTrackTextOverlay* to set text on * @self: the #GESTrackTextOverlay* to set text on
* @halign: #GESTrackTitleSrcHAlign * @halign: #GESTextHAlign
* *
* Sets the vertical aligment of the text. * Sets the vertical aligment of the text.
*/ */
void void
ges_track_text_overlay_set_halignment (GESTrackTextOverlay * self, ges_track_text_overlay_set_halignment (GESTrackTextOverlay * self,
GESTrackTitleSrcHAlign halign) GESTextHAlign halign)
{ {
self->halign = halign; self->halign = halign;
GST_LOG ("set halignment to: %d", halign); GST_LOG ("set halignment to: %d", halign);

View file

@ -56,8 +56,8 @@ struct _GESTrackTextOverlay {
/*< private >*/ /*< private >*/
gchar *text; gchar *text;
gchar *font_desc; gchar *font_desc;
gint halign; GESTextHAlign halign;
gint valign; GESTextVAlign valign;
GstElement *text_el; GstElement *text_el;
}; };
@ -81,10 +81,10 @@ void ges_track_text_overlay_set_font_desc(GESTrackTextOverlay *self,
const gchar *font_desc); const gchar *font_desc);
void ges_track_text_overlay_set_halignment(GESTrackTextOverlay void ges_track_text_overlay_set_halignment(GESTrackTextOverlay
*self, GESTrackTitleSrcHAlign halgn); *self, GESTextHAlign halgn);
void ges_track_text_overlay_set_valignment(GESTrackTextOverlay void ges_track_text_overlay_set_valignment(GESTrackTextOverlay
*self, GESTrackTitleSrcVAlign valign); *self, GESTextVAlign valign);
GESTrackTextOverlay* ges_track_text_overlay_new (void); GESTrackTextOverlay* ges_track_text_overlay_new (void);

View file

@ -69,7 +69,7 @@ static void
ges_track_title_src_init (GESTrackTitleSource * self) ges_track_title_src_init (GESTrackTitleSource * self)
{ {
self->text = NULL; self->text = NULL;
self->font_desc = g_strdup (DEFAULT_FONT_DESC); self->font_desc = NULL;
self->text_el = NULL; self->text_el = NULL;
self->halign = DEFAULT_HALIGNMENT; self->halign = DEFAULT_HALIGNMENT;
self->valign = DEFAULT_VALIGNMENT; self->valign = DEFAULT_VALIGNMENT;
@ -212,13 +212,13 @@ ges_track_title_source_set_font_desc (GESTrackTitleSource * self,
/** /**
* ges_track_title_source_valignment: * ges_track_title_source_valignment:
* @self: the #GESTrackTitleSource* to set text on * @self: the #GESTrackTitleSource* to set text on
* @valign: #GESTrackTitleSrcVAlign * @valign: #GESTextVAlign
* *
* Sets the vertical aligment of the text. * Sets the vertical aligment of the text.
*/ */
void void
ges_track_title_source_set_valignment (GESTrackTitleSource * self, ges_track_title_source_set_valignment (GESTrackTitleSource * self,
GESTrackTitleSrcVAlign valign) GESTextVAlign valign)
{ {
self->valign = valign; self->valign = valign;
GST_LOG ("set valignment to: %d", valign); GST_LOG ("set valignment to: %d", valign);
@ -229,13 +229,13 @@ ges_track_title_source_set_valignment (GESTrackTitleSource * self,
/** /**
* ges_track_title_source_halignment: * ges_track_title_source_halignment:
* @self: the #GESTrackTitleSource* to set text on * @self: the #GESTrackTitleSource* to set text on
* @halign: #GESTrackTitleSrcHAlign * @halign: #GESTextHAlign
* *
* Sets the vertical aligment of the text. * Sets the vertical aligment of the text.
*/ */
void void
ges_track_title_source_set_halignment (GESTrackTitleSource * self, ges_track_title_source_set_halignment (GESTrackTitleSource * self,
GESTrackTitleSrcHAlign halign) GESTextHAlign halign)
{ {
self->halign = halign; self->halign = halign;
GST_LOG ("set halignment to: %d", halign); GST_LOG ("set halignment to: %d", halign);

View file

@ -44,38 +44,6 @@ G_BEGIN_DECLS
#define GES_TRACK_TITLE_SOURCE_GET_CLASS(obj) \ #define GES_TRACK_TITLE_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_TITLE_SOURCE, GESTrackTitleSourceClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_TITLE_SOURCE, GESTrackTitleSourceClass))
#define DEFAULT_FONT_DESC "serif 36"
#define DEFAULT_VALIGNMENT GES_TRACK_TITLE_SRC_VALIGN_BASELINE
#define DEFAULT_HALIGNMENT GES_TRACK_TITLE_SRC_HALIGN_CENTER
/**
* GESTrackTitleSrcVAlign:
* @GES_TRACK_TITLE_SRC_VALIGN_BASELINE: draw text on the baseline
* @GES_TRACK_TITLE_SRC_VALIGN_BOTTOM: draw text on the bottom
* @GES_TRACK_TITLE_SRC_VALIGN_TOP: draw test on top
*
* Vertical alignment of the text.
*/
typedef enum {
GES_TRACK_TITLE_SRC_VALIGN_BASELINE,
GES_TRACK_TITLE_SRC_VALIGN_BOTTOM,
GES_TRACK_TITLE_SRC_VALIGN_TOP
} GESTrackTitleSrcVAlign;
/**
* GESTrackTitleSrcHAlign:
* @GES_TRACK_TITLE_SRC_HALIGN_LEFT: align text left
* @GES_TRACK_TITLE_SRC_HALIGN_CENTER: align text center
* @GES_TRACK_TITLE_SRC_HALIGN_RIGHT: align text right
*
* Horizontal alignment of the text.
*/
typedef enum {
GES_TRACK_TITLE_SRC_HALIGN_LEFT,
GES_TRACK_TITLE_SRC_HALIGN_CENTER,
GES_TRACK_TITLE_SRC_HALIGN_RIGHT
} GESTrackTitleSrcHAlign;
/** /**
* GESTrackTitleSource: * GESTrackTitleSource:
* @parent: parent * @parent: parent
@ -87,8 +55,8 @@ struct _GESTrackTitleSource {
/*< private >*/ /*< private >*/
gchar *text; gchar *text;
gchar *font_desc; gchar *font_desc;
gint halign; GESTextHAlign halign;
gint valign; GESTextVAlign valign;
GstElement *text_el; GstElement *text_el;
GstElement *background_el; GstElement *background_el;
}; };
@ -113,10 +81,10 @@ void ges_track_title_source_set_font_desc(GESTrackTitleSource *self,
const gchar *font_desc); const gchar *font_desc);
void ges_track_title_source_set_halignment(GESTrackTitleSource void ges_track_title_source_set_halignment(GESTrackTitleSource
*self, GESTrackTitleSrcHAlign halgn); *self, GESTextHAlign halgn);
void ges_track_title_source_set_valignment(GESTrackTitleSource void ges_track_title_source_set_valignment(GESTrackTitleSource
*self, GESTrackTitleSrcVAlign valign); *self, GESTextVAlign valign);
GESTrackTitleSource* ges_track_title_source_new (void); GESTrackTitleSource* ges_track_title_source_new (void);