expand tabs
[platform/upstream/gstreamer.git] / gst-libs / gst / interfaces / tuner.h
1 /* GStreamer Tuner
2  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  *
4  * tuner.h: tuner interface design
5  *
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.
10  *
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.
15  *
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.
20  */
21
22 #ifndef __GST_TUNER_H__
23 #define __GST_TUNER_H__
24
25 #include <gst/gst.h>
26 #include <gst/interfaces/tunernorm.h>
27 #include <gst/interfaces/tunerchannel.h>
28 #include <gst/interfaces/interfaces-enumtypes.h>
29
30 G_BEGIN_DECLS
31
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))
44
45 typedef struct _GstTuner GstTuner;
46
47 typedef struct _GstTunerClass {
48   GTypeInterface klass;
49
50   /* virtual functions */
51   const GList * (* list_channels)   (GstTuner        *tuner);
52   void          (* set_channel)     (GstTuner        *tuner,
53                                      GstTunerChannel *channel);
54   GstTunerChannel *
55                 (* get_channel)     (GstTuner        *tuner);
56
57   const GList * (* list_norms)      (GstTuner        *tuner);
58   void          (* set_norm)        (GstTuner        *tuner,
59                                      GstTunerNorm    *norm);
60   GstTunerNorm *(* get_norm)        (GstTuner        *tuner);
61
62   void          (* set_frequency)   (GstTuner        *tuner,
63                                      GstTunerChannel *channel,
64                                      gulong           frequency);
65   gulong        (* get_frequency)   (GstTuner        *tuner,
66                                      GstTunerChannel *channel);
67   gint          (* signal_strength) (GstTuner        *tuner,
68                                      GstTunerChannel *channel);
69
70   /* signals */
71   void (*channel_changed)   (GstTuner        *tuner,
72                              GstTunerChannel *channel);
73   void (*norm_changed)      (GstTuner        *tuner,
74                              GstTunerNorm    *norm);
75   void (*frequency_changed) (GstTuner        *tuner,
76                              GstTunerChannel *channel,
77                              gulong           frequency);
78   void (*signal_changed)    (GstTuner        *tuner,
79                              GstTunerChannel *channel,
80                              gint             signal);
81
82   gpointer _gst_reserved[GST_PADDING];
83 } GstTunerClass;
84
85 GType           gst_tuner_get_type              (void);
86
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);
91 GstTunerChannel *
92                 gst_tuner_get_channel           (GstTuner        *tuner);
93
94 const GList *   gst_tuner_list_norms            (GstTuner        *tuner);
95 void            gst_tuner_set_norm              (GstTuner        *tuner,
96                                                  GstTunerNorm    *norm);
97 GstTunerNorm *  gst_tuner_get_norm              (GstTuner        *tuner);
98
99 void            gst_tuner_set_frequency         (GstTuner        *tuner,
100                                                  GstTunerChannel *channel,
101                                                  gulong           frequency);
102 gulong          gst_tuner_get_frequency         (GstTuner        *tuner,
103                                                  GstTunerChannel *channel);
104 gint            gst_tuner_signal_strength       (GstTuner        *tuner,
105                                                  GstTunerChannel *channel);
106
107 /* helper functions */
108 GstTunerNorm *  gst_tuner_find_norm_by_name     (GstTuner        *tuner,
109                                                  gchar           *norm);
110 GstTunerChannel *gst_tuner_find_channel_by_name (GstTuner        *tuner,
111                                                  gchar           *channel);
112
113 /* trigger signals */
114 void            gst_tuner_channel_changed       (GstTuner        *tuner,
115                                                  GstTunerChannel *channel);
116 void            gst_tuner_norm_changed          (GstTuner        *tuner,
117                                                  GstTunerNorm    *norm);
118 void            gst_tuner_frequency_changed     (GstTuner        *tuner,
119                                                  GstTunerChannel *channel,
120                                                  gulong           frequency);
121 void            gst_tuner_signal_changed        (GstTuner        *tuner,
122                                                  GstTunerChannel *channel,
123                                                  gint             signal);
124
125 G_END_DECLS
126
127 #endif /* __GST_TUNER_H__ */