expand tabs
[platform/upstream/gstreamer.git] / gst-libs / gst / interfaces / mixertrack.h
1 /* GStreamer Mixer
2  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  *
4  * mixertrack.h: mixer track object
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_TRACK_H__
23 #define __GST_MIXER_TRACK_H__
24
25 #include <gst/gst.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_TYPE_MIXER_TRACK \
30   (gst_mixer_track_get_type ())
31 #define GST_MIXER_TRACK(obj) \
32   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER_TRACK, \
33                                GstMixerTrack))
34 #define GST_MIXER_TRACK_CLASS(klass) \
35   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER_TRACK, \
36                             GstMixerTrackClass))
37 #define GST_IS_MIXER_TRACK(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER_TRACK))
39 #define GST_IS_MIXER_TRACK_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER_TRACK))
41
42 /*
43  * Naming:
44  *
45  * A track is a single input/output stream (e.g. line-in,
46  * microphone, etc.). Channels are then single streams
47  * within a track. A mono stream has one channel, a stereo
48  * stream has two, etc.
49  *
50  * Input tracks can have 'recording' enabled, which means
51  * that any input will be hearable into the speakers that
52  * are attached to the output. Mute is obvious. A track
53  * flagged as master is the master volume track on this
54  * mixer, which means that setting this track will change
55  * the hearable volume on any output.
56  */
57
58 typedef enum {
59   GST_MIXER_TRACK_INPUT  = (1<<0),
60   GST_MIXER_TRACK_OUTPUT = (1<<1),
61   GST_MIXER_TRACK_MUTE   = (1<<2),
62   GST_MIXER_TRACK_RECORD = (1<<3),
63   GST_MIXER_TRACK_MASTER = (1<<4),
64   GST_MIXER_TRACK_SOFTWARE = (1<<5)
65 } GstMixerTrackFlags;
66
67 #define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \
68   ((channel)->flags & flag)
69
70 typedef struct _GstMixerTrack GstMixerTrack;
71 typedef struct _GstMixerTrackClass GstMixerTrackClass;
72
73 struct _GstMixerTrack {
74   GObject            parent;
75
76   gchar             *label;
77   /* FIXME: flags should be guint32. Change in 0.9 */
78   GstMixerTrackFlags flags;
79   gint               num_channels,
80                      min_volume,
81                      max_volume;
82 };
83
84 struct _GstMixerTrackClass {
85   GObjectClass parent;
86
87   /* signals */
88   void (* mute_toggled)   (GstMixerTrack *channel,
89                            gboolean       mute);
90   void (* record_toggled) (GstMixerTrack *channel,
91                            gboolean       record);
92   void (* volume_changed) (GstMixerTrack *channel,
93                            gint          *volumes);
94
95   gpointer _gst_reserved[GST_PADDING];
96 };
97
98 GType           gst_mixer_track_get_type        (void);
99
100 G_END_DECLS
101
102 #endif /* __GST_MIXER_TRACK_H__ */