expand tabs
[platform/upstream/gstreamer.git] / gst-libs / gst / interfaces / mixer.h
1 /* GStreamer Mixer
2  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  *
4  * mixer.h: mixer 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_MIXER_H__
23 #define __GST_MIXER_H__
24
25 #include <gst/gst.h>
26 #include <gst/interfaces/mixeroptions.h>
27 #include <gst/interfaces/mixertrack.h>
28 #include <gst/interfaces/interfaces-enumtypes.h>
29
30 G_BEGIN_DECLS
31
32 #define GST_TYPE_MIXER \
33   (gst_mixer_get_type ())
34 #define GST_MIXER(obj) \
35   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER, GstMixer))
36 #define GST_MIXER_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER, GstMixerClass))
38 #define GST_IS_MIXER(obj) \
39   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER))
40 #define GST_IS_MIXER_CLASS(klass) \
41   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER))
42 #define GST_MIXER_GET_CLASS(inst) \
43   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass))
44
45 #define GST_MIXER_TYPE(klass) (klass->mixer_type)
46
47 typedef struct _GstMixer GstMixer;
48 typedef struct _GstMixerClass GstMixerClass;
49
50 typedef enum
51 {
52   GST_MIXER_HARDWARE,
53   GST_MIXER_SOFTWARE
54 } GstMixerType;
55
56 struct _GstMixerClass {
57   GTypeInterface klass;
58
59   GstMixerType mixer_type;
60   
61   /* virtual functions */
62   const GList *  (* list_tracks)   (GstMixer      *mixer);
63
64   void           (* set_volume)    (GstMixer      *mixer,
65                                     GstMixerTrack *track,
66                                     gint          *volumes);
67   void           (* get_volume)    (GstMixer      *mixer,
68                                     GstMixerTrack *track,
69                                     gint          *volumes);
70
71   void           (* set_mute)      (GstMixer      *mixer,
72                                     GstMixerTrack *track,
73                                     gboolean       mute);
74   void           (* set_record)    (GstMixer      *mixer,
75                                     GstMixerTrack *track,
76                                     gboolean       record);
77
78   /* signals */
79   void (* mute_toggled)   (GstMixer      *mixer,
80                            GstMixerTrack *channel,
81                            gboolean       mute);
82   void (* record_toggled) (GstMixer      *mixer,
83                            GstMixerTrack *channel,
84                            gboolean       record);
85   void (* volume_changed) (GstMixer      *mixer,
86                            GstMixerTrack *channel,
87                            gint          *volumes);
88
89   void          (* set_option)     (GstMixer      *mixer,
90                                     GstMixerOptions *opts,
91                                     gchar         *value);
92   const gchar * (* get_option)     (GstMixer      *mixer,
93                                     GstMixerOptions *opts);
94
95   void (* option_changed) (GstMixer      *mixer,
96                            GstMixerOptions *opts,
97                            gchar         *option);
98
99   /*< private >*/
100   gpointer _gst_reserved[GST_PADDING];
101 };
102
103 GType           gst_mixer_get_type      (void);
104
105 /* virtual class function wrappers */
106 const GList *   gst_mixer_list_tracks    (GstMixer      *mixer);
107 void            gst_mixer_set_volume     (GstMixer      *mixer,
108                                           GstMixerTrack *track,
109                                           gint          *volumes);
110 void            gst_mixer_get_volume     (GstMixer      *mixer,
111                                           GstMixerTrack *track,
112                                           gint          *volumes);
113 void            gst_mixer_set_mute       (GstMixer      *mixer,
114                                           GstMixerTrack *track,
115                                           gboolean       mute);
116 void            gst_mixer_set_record     (GstMixer      *mixer,
117                                           GstMixerTrack *track,
118                                           gboolean       record);
119 void            gst_mixer_set_option     (GstMixer      *mixer,
120                                           GstMixerOptions *opts,
121                                           gchar         *value);
122 const gchar *   gst_mixer_get_option     (GstMixer      *mixer,
123                                           GstMixerOptions *opts);
124
125 /* trigger signals */
126 void            gst_mixer_mute_toggled   (GstMixer      *mixer,
127                                           GstMixerTrack *track,
128                                           gboolean       mute);
129 void            gst_mixer_record_toggled (GstMixer      *mixer,
130                                           GstMixerTrack *track,
131                                           gboolean       record);
132 void            gst_mixer_volume_changed (GstMixer      *mixer,
133                                           GstMixerTrack *track,
134                                           gint          *volumes);
135 void            gst_mixer_option_changed (GstMixer      *mixer,
136                                           GstMixerOptions *opts,
137                                           gchar         *value);
138
139 G_END_DECLS
140
141 #endif /* __GST_MIXER_H__ */