From b87c80074363eb6b1a7457f3534ef9762a71627c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 22 Apr 2013 00:21:58 -0300 Subject: [PATCH] meta-container: Add a VOLUME default meta to layers --- ges/ges-layer.c | 11 +++++++++++ ges/ges-meta-container.h | 18 ++++++++++++++++++ tests/check/ges/layer.c | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ges/ges-layer.c b/ges/ges-layer.c index 2f2503f..365c95c 100644 --- a/ges/ges-layer.c +++ b/ges/ges-layer.c @@ -128,6 +128,15 @@ ges_layer_dispose (GObject * object) G_OBJECT_CLASS (ges_layer_parent_class)->dispose (object); } +static gboolean +_register_metas (GESLayer * layer) +{ + ges_meta_container_register_meta_float (GES_META_CONTAINER (layer), + GES_META_READ_WRITE, GES_META_VOLUME, 1.0); + + return TRUE; +} + static void ges_meta_container_interface_init (GESMetaContainerInterface * iface) { @@ -202,6 +211,8 @@ ges_layer_init (GESLayer * self) self->priv->auto_transition = FALSE; self->min_gnl_priority = MIN_GNL_PRIO; self->max_gnl_priority = LAYER_HEIGHT + MIN_GNL_PRIO; + + _register_metas (self); } /** diff --git a/ges/ges-meta-container.h b/ges/ges-meta-container.h index d900fc6..200dab5 100644 --- a/ges/ges-meta-container.h +++ b/ges/ges-meta-container.h @@ -84,6 +84,24 @@ G_BEGIN_DECLS */ #define GES_META_FORMATTER_RANK "rank" +/** + * GES_META_VOLUME: + * + * The volume, can be used for audio track or layers + * + * The volume for a track or a layer, it is register as a float + */ +#define GES_META_VOLUME "volume" + +/** + * GES_META_VOLUME_DEFAULT: + * + * The default volume + * + * The default volume for a track or a layer as a float + */ +#define GES_META_VOLUME_DEFAULT 1.0 + typedef struct _GESMetaContainer GESMetaContainer; typedef struct _GESMetaContainerInterface GESMetaContainerInterface; diff --git a/tests/check/ges/layer.c b/tests/check/ges/layer.c index ccb12da..f2c9e46 100644 --- a/tests/check/ges/layer.c +++ b/tests/check/ges/layer.c @@ -1763,7 +1763,7 @@ test_foreach (const GESMetaContainer * container, const gchar * key, GValue * value, gpointer user_data) { fail_unless ((0 == g_strcmp0 (key, "some-string")) || - (0 == g_strcmp0 (key, "some-int"))); + (0 == g_strcmp0 (key, "some-int")) || (0 == g_strcmp0 (key, "volume"))); } GST_START_TEST (test_layer_meta_foreach) -- 2.7.4