* @short_description: implements a list of markers with metadata asociated to time positions
* @see_also: #GESMarker
*
+ * A #GESMarker can be colored by setting the #GES_META_MARKER_COLOR meta.
+ *
* Since: 1.18
*/
static void
ges_marker_init (GESMarker * self)
{
+ ges_meta_container_register_static_meta (GES_META_CONTAINER (self),
+ GES_META_READ_WRITE, GES_META_MARKER_COLOR, G_TYPE_UINT);
}
static void
*/
#define GES_META_FORMAT_VERSION "format-version"
+/**
+ * GES_META_MARKER_COLOR:
+ *
+ * The ARGB color of a #GESMarker (an AARRGGBB hex as a guint)
+ */
+#define GES_META_MARKER_COLOR "marker-color"
+
typedef struct _GESMetaContainer GESMetaContainer;
typedef struct _GESMetaContainerInterface GESMetaContainerInterface;
GST_END_TEST;
+
+GST_START_TEST (test_marker_color)
+{
+ GESMarkerList *mlist;
+ GESMarker *marker;
+ const guint yellow_rgb = 16776960;
+ guint color;
+
+ ges_init ();
+
+ mlist = ges_marker_list_new ();
+ marker = ges_marker_list_add (mlist, 0);
+ /* getting the color should fail since no value should be set yet */
+ fail_unless (ges_meta_container_get_meta (GES_META_CONTAINER (marker),
+ GES_META_MARKER_COLOR) == NULL);
+ /* trying to set the color field to something other than a uint should
+ * fail */
+ fail_unless (ges_meta_container_set_float (GES_META_CONTAINER (marker),
+ GES_META_MARKER_COLOR, 0.0) == FALSE);
+ fail_unless (ges_meta_container_set_uint (GES_META_CONTAINER (marker),
+ GES_META_MARKER_COLOR, yellow_rgb));
+ fail_unless (ges_meta_container_get_uint (GES_META_CONTAINER (marker),
+ GES_META_MARKER_COLOR, &color));
+ fail_unless_equals_int (color, yellow_rgb);
+
+ g_object_unref (mlist);
+
+ ges_deinit ();
+}
+
+GST_END_TEST;
+
+
static Suite *
ges_suite (void)
{
tcase_add_test (tc_chain, test_get_markers);
tcase_add_test (tc_chain, test_move_marker);
tcase_add_test (tc_chain, test_serialize_deserialize);
+ tcase_add_test (tc_chain, test_marker_color);
return s;
}