gst-libs/gst/: Generate enum type code with glib-mkenums.
[platform/upstream/gst-plugins-base.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/mixer/mixertrack.h>
27 #include <gst/mixer/mixerenumtypes.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_TYPE_MIXER \
32   (gst_mixer_get_type ())
33 #define GST_MIXER(obj) \
34   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER, GstMixer))
35 #define GST_MIXER_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER, GstMixerClass))
37 #define GST_IS_MIXER(obj) \
38   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER))
39 #define GST_IS_MIXER_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER))
41 #define GST_MIXER_GET_CLASS(inst) \
42   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass))
43
44 #define GST_MIXER_TYPE(klass) (klass->mixer_type)
45
46 typedef struct _GstMixer GstMixer;
47
48 typedef enum
49 {
50   GST_MIXER_HARDWARE,
51   GST_MIXER_SOFTWARE
52 } GstMixerType;
53
54 typedef struct _GstMixerClass {
55   GTypeInterface klass;
56
57   GstMixerType mixer_type;
58   
59   /* virtual functions */
60   const GList *  (* list_tracks)   (GstMixer      *mixer);
61
62   void           (* set_volume)    (GstMixer      *mixer,
63                                     GstMixerTrack *track,
64                                     gint          *volumes);
65   void           (* get_volume)    (GstMixer      *mixer,
66                                     GstMixerTrack *track,
67                                     gint          *volumes);
68
69   void           (* set_mute)      (GstMixer      *mixer,
70                                     GstMixerTrack *track,
71                                     gboolean       mute);
72   void           (* set_record)    (GstMixer      *mixer,
73                                     GstMixerTrack *track,
74                                     gboolean       record);
75
76   /* signals */
77   void (* mute_toggled)   (GstMixer      *mixer,
78                            GstMixerTrack *channel,
79                            gboolean       mute);
80   void (* record_toggled) (GstMixer      *mixer,
81                            GstMixerTrack *channel,
82                            gboolean       record);
83   void (* volume_changed) (GstMixer      *mixer,
84                            GstMixerTrack *channel,
85                            gint          *volumes);
86
87   gpointer _gst_reserved[GST_PADDING];
88 } GstMixerClass;
89
90 GType           gst_mixer_get_type      (void);
91
92 /* virtual class function wrappers */
93 const GList *   gst_mixer_list_tracks    (GstMixer      *mixer);
94 void            gst_mixer_set_volume     (GstMixer      *mixer,
95                                           GstMixerTrack *track,
96                                           gint          *volumes);
97 void            gst_mixer_get_volume     (GstMixer      *mixer,
98                                           GstMixerTrack *track,
99                                           gint          *volumes);
100 void            gst_mixer_set_mute       (GstMixer      *mixer,
101                                           GstMixerTrack *track,
102                                           gboolean       mute);
103 void            gst_mixer_set_record     (GstMixer      *mixer,
104                                           GstMixerTrack *track,
105                                           gboolean       record);
106
107 /* trigger signals */
108 void            gst_mixer_mute_toggled   (GstMixer      *mixer,
109                                           GstMixerTrack *track,
110                                           gboolean       mute);
111 void            gst_mixer_record_toggled (GstMixer      *mixer,
112                                           GstMixerTrack *track,
113                                           gboolean       record);
114 void            gst_mixer_volume_changed (GstMixer      *mixer,
115                                           GstMixerTrack *track,
116                                           gint          *volumes);
117
118 G_END_DECLS
119
120 #endif /* __GST_MIXER_H__ */