2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * tuner.h: tuner interface 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.
22 #ifndef __GST_TUNER_H__
23 #define __GST_TUNER_H__
27 #include "tunernorm.h"
28 #include "tunerchannel.h"
32 #define GST_TYPE_TUNER \
33 (gst_tuner_get_type ())
34 #define GST_TUNER(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TUNER, GstTuner))
36 #define GST_IS_TUNER(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER))
38 #define GST_TUNER_GET_INTERFACE(inst) \
39 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerInterface))
41 typedef struct _GstTuner GstTuner;
42 typedef struct _GstTunerInterface GstTunerInterface;
46 * @iface: the parent interface
47 * @list_channels: list available channels
48 * @set_channel: set to a channel
49 * @get_channel: return the current channel
50 * @list_norms: list available norms
51 * @set_norm: set a norm
52 * @get_norm: return the current norm
53 * @set_frequency: set the frequency
54 * @get_frequency: return the current frequency
55 * @signal_strength: get the signal strength
56 * @channel_changed: default handler for channel changed notification
57 * @norm_changed: default handler for norm changed notification
58 * @frequency_changed: default handler for frequency changed notification
59 * @signal_changed: default handler for signal-strength changed notification
63 struct _GstTunerInterface {
66 /* virtual functions */
67 const GList * (* list_channels) (GstTuner *tuner);
68 void (* set_channel) (GstTuner *tuner,
69 GstTunerChannel *channel);
71 (* get_channel) (GstTuner *tuner);
73 const GList * (* list_norms) (GstTuner *tuner);
74 void (* set_norm) (GstTuner *tuner,
76 GstTunerNorm *(* get_norm) (GstTuner *tuner);
78 void (* set_frequency) (GstTuner *tuner,
79 GstTunerChannel *channel,
81 gulong (* get_frequency) (GstTuner *tuner,
82 GstTunerChannel *channel);
83 gint (* signal_strength) (GstTuner *tuner,
84 GstTunerChannel *channel);
87 void (*channel_changed) (GstTuner *tuner,
88 GstTunerChannel *channel);
89 void (*norm_changed) (GstTuner *tuner,
91 void (*frequency_changed) (GstTuner *tuner,
92 GstTunerChannel *channel,
94 void (*signal_changed) (GstTuner *tuner,
95 GstTunerChannel *channel,
99 GType gst_tuner_get_type (void);
101 /* virtual class function wrappers */
102 const GList * gst_tuner_list_channels (GstTuner *tuner);
103 void gst_tuner_set_channel (GstTuner *tuner,
104 GstTunerChannel *channel);
106 gst_tuner_get_channel (GstTuner *tuner);
108 const GList * gst_tuner_list_norms (GstTuner *tuner);
109 void gst_tuner_set_norm (GstTuner *tuner,
111 GstTunerNorm * gst_tuner_get_norm (GstTuner *tuner);
113 void gst_tuner_set_frequency (GstTuner *tuner,
114 GstTunerChannel *channel,
116 gulong gst_tuner_get_frequency (GstTuner *tuner,
117 GstTunerChannel *channel);
118 gint gst_tuner_signal_strength (GstTuner *tuner,
119 GstTunerChannel *channel);
121 /* helper functions */
122 GstTunerNorm * gst_tuner_find_norm_by_name (GstTuner *tuner,
124 GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner *tuner,
127 /* trigger signals */
128 void gst_tuner_channel_changed (GstTuner *tuner,
129 GstTunerChannel *channel);
130 void gst_tuner_norm_changed (GstTuner *tuner,
132 void gst_tuner_frequency_changed (GstTuner *tuner,
133 GstTunerChannel *channel,
135 void gst_tuner_signal_changed (GstTuner *tuner,
136 GstTunerChannel *channel,
141 #endif /* __GST_TUNER_H__ */