1 /* GStreamer Color Balance
2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * colorbalancechannel.c: colorbalance channel object design
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
26 #include "colorbalancechannel.h"
29 * SECTION:gstcolorbalancechannel
30 * @short_description: Object representing a channel from the #GstColorBalance
33 * <refsect2><para>The #GstColorBalanceChannel object represents a parameter
34 * for modifying the color balance implemented by an element providing the
35 * #GstColorBalance interface. For example, Hue or Saturation.
46 static void gst_color_balance_channel_class_init (GstColorBalanceChannelClass *
48 static void gst_color_balance_channel_init (GstColorBalanceChannel * balance);
49 static void gst_color_balance_channel_dispose (GObject * object);
51 static GObjectClass *parent_class = NULL;
52 static guint signals[LAST_SIGNAL] = { 0 };
55 gst_color_balance_channel_get_type (void)
57 static GType gst_color_balance_channel_type = 0;
59 if (!gst_color_balance_channel_type) {
60 static const GTypeInfo color_balance_channel_info = {
61 sizeof (GstColorBalanceChannelClass),
64 (GClassInitFunc) gst_color_balance_channel_class_init,
67 sizeof (GstColorBalanceChannel),
69 (GInstanceInitFunc) gst_color_balance_channel_init,
73 gst_color_balance_channel_type =
74 g_type_register_static (G_TYPE_OBJECT,
75 "GstColorBalanceChannel", &color_balance_channel_info, 0);
78 return gst_color_balance_channel_type;
82 gst_color_balance_channel_class_init (GstColorBalanceChannelClass * klass)
84 GObjectClass *object_klass = (GObjectClass *) klass;
86 parent_class = g_type_class_peek_parent (klass);
89 * GstColorBalanceChannel::value-changed:
90 * @channel: The #GstColorBalanceChannel
91 * @value: The new value
93 * Fired when the value of the indicated channel has changed.
95 signals[SIGNAL_VALUE_CHANGED] =
96 g_signal_new ("value-changed", G_TYPE_FROM_CLASS (klass),
98 G_STRUCT_OFFSET (GstColorBalanceChannelClass,
100 NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
102 object_klass->dispose = gst_color_balance_channel_dispose;
106 gst_color_balance_channel_init (GstColorBalanceChannel * channel)
108 channel->label = NULL;
109 channel->min_value = channel->max_value = 0;
113 gst_color_balance_channel_dispose (GObject * object)
115 GstColorBalanceChannel *channel = GST_COLOR_BALANCE_CHANNEL (object);
118 g_free (channel->label);
120 channel->label = NULL;
122 if (parent_class->dispose)
123 parent_class->dispose (object);