2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * tunerchannel.c: tuner 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., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
26 #include "tunerchannel.h"
29 * SECTION:gsttunerchannel
30 * @short_description: A channel from an element implementing the #GstTuner
34 * <para>The #GstTunerChannel object is provided by an element implementing
35 * the #GstTuner interface.
38 * GstTunerChannel provides a name and flags to determine the type and
39 * capabilities of the channel. If the GST_TUNER_CHANNEL_FREQUENCY flag is
40 * set, then the channel also information about the minimum and maximum
41 * frequency, and range of the reported signal strength.
49 SIGNAL_FREQUENCY_CHANGED,
50 SIGNAL_SIGNAL_CHANGED,
54 G_DEFINE_TYPE (GstTunerChannel, gst_tuner_channel, G_TYPE_OBJECT);
56 static void gst_tuner_channel_dispose (GObject * object);
58 static guint signals[LAST_SIGNAL] = { 0 };
61 gst_tuner_channel_class_init (GstTunerChannelClass * klass)
63 GObjectClass *object_klass = (GObjectClass *) klass;
66 * GstTunerChannel::frequency-changed:
67 * @tunerchannel: The #GstTunerChannel
68 * @frequency: The new frequency (an unsigned long)
70 * Reports that the current frequency has changed.
72 signals[SIGNAL_FREQUENCY_CHANGED] =
73 g_signal_new ("frequency-changed", G_TYPE_FROM_CLASS (klass),
75 G_STRUCT_OFFSET (GstTunerChannelClass,
77 NULL, NULL, g_cclosure_marshal_VOID__ULONG, G_TYPE_NONE, 1, G_TYPE_ULONG);
79 * GstTunerChannel::signal-changed:
80 * @tunerchannel: The #GstTunerChannel
81 * @signal: The new signal strength (an integer)
83 * Reports that the signal strength has changed.
85 * See Also: gst_tuner_signal_strength()
87 signals[SIGNAL_SIGNAL_CHANGED] =
88 g_signal_new ("signal-changed", G_TYPE_FROM_CLASS (klass),
90 G_STRUCT_OFFSET (GstTunerChannelClass,
92 NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
94 object_klass->dispose = gst_tuner_channel_dispose;
98 gst_tuner_channel_init (GstTunerChannel * channel)
100 channel->label = NULL;
102 channel->min_frequency = channel->max_frequency = 0;
103 channel->min_signal = channel->max_signal = 0;
107 gst_tuner_channel_dispose (GObject * object)
109 GstTunerChannel *channel = GST_TUNER_CHANNEL (object);
111 if (channel->label) {
112 g_free (channel->label);
113 channel->label = NULL;
116 G_OBJECT_CLASS (gst_tuner_channel_parent_class)->dispose (object);