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., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __GST_TUNER_H__
23 #define __GST_TUNER_H__
26 #include <gst/interfaces/tunernorm.h>
27 #include <gst/interfaces/tunerchannel.h>
28 #include <gst/interfaces/interfaces-enumtypes.h>
32 #define GST_TYPE_TUNER \
33 (gst_tuner_get_type ())
34 #define GST_TUNER(obj) \
35 (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TUNER, GstTuner))
36 #define GST_TUNER_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TUNER, GstTunerClass))
38 #define GST_IS_TUNER(obj) \
39 (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER))
40 #define GST_IS_TUNER_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER))
42 #define GST_TUNER_GET_CLASS(inst) \
43 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerClass))
45 typedef struct _GstTuner GstTuner;
47 typedef struct _GstTunerClass {
50 /* virtual functions */
51 const GList * (* list_channels) (GstTuner *tuner);
52 void (* set_channel) (GstTuner *tuner,
53 GstTunerChannel *channel);
55 (* get_channel) (GstTuner *tuner);
57 const GList * (* list_norms) (GstTuner *tuner);
58 void (* set_norm) (GstTuner *tuner,
60 GstTunerNorm *(* get_norm) (GstTuner *tuner);
62 void (* set_frequency) (GstTuner *tuner,
63 GstTunerChannel *channel,
65 gulong (* get_frequency) (GstTuner *tuner,
66 GstTunerChannel *channel);
67 gint (* signal_strength) (GstTuner *tuner,
68 GstTunerChannel *channel);
71 void (*channel_changed) (GstTuner *tuner,
72 GstTunerChannel *channel);
73 void (*norm_changed) (GstTuner *tuner,
75 void (*frequency_changed) (GstTuner *tuner,
76 GstTunerChannel *channel,
78 void (*signal_changed) (GstTuner *tuner,
79 GstTunerChannel *channel,
82 gpointer _gst_reserved[GST_PADDING];
85 GType gst_tuner_get_type (void);
87 /* virtual class function wrappers */
88 const GList * gst_tuner_list_channels (GstTuner *tuner);
89 void gst_tuner_set_channel (GstTuner *tuner,
90 GstTunerChannel *channel);
92 gst_tuner_get_channel (GstTuner *tuner);
94 const GList * gst_tuner_list_norms (GstTuner *tuner);
95 void gst_tuner_set_norm (GstTuner *tuner,
97 GstTunerNorm * gst_tuner_get_norm (GstTuner *tuner);
99 void gst_tuner_set_frequency (GstTuner *tuner,
100 GstTunerChannel *channel,
102 gulong gst_tuner_get_frequency (GstTuner *tuner,
103 GstTunerChannel *channel);
104 gint gst_tuner_signal_strength (GstTuner *tuner,
105 GstTunerChannel *channel);
107 /* helper functions */
108 GstTunerNorm * gst_tuner_find_norm_by_name (GstTuner *tuner,
110 GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner *tuner,
113 /* trigger signals */
114 void gst_tuner_channel_changed (GstTuner *tuner,
115 GstTunerChannel *channel);
116 void gst_tuner_norm_changed (GstTuner *tuner,
118 void gst_tuner_frequency_changed (GstTuner *tuner,
119 GstTunerChannel *channel,
121 void gst_tuner_signal_changed (GstTuner *tuner,
122 GstTunerChannel *channel,
127 #endif /* __GST_TUNER_H__ */