33296b9b6074622eb8f891ab868dfce75edbcb52
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / 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  * GstMixerTrackFlags:
59  * @GST_MIXER_TRACK_INPUT: mixer track is for input
60  * @GST_MIXER_TRACK_OUTPUT: mixer track is for output
61  * @GST_MIXER_TRACK_MUTE: input or output is muted
62  * @GST_MIXER_TRACK_RECORD: input is audible in speakers attached to output
63  *     (for #GST_MIXER_TRACK_INPUT mixer tracks only)
64  * @GST_MIXER_TRACK_MASTER: this mixer track is likely to be the master control
65  * @GST_MIXER_TRACK_SOFTWARE: mixer track's' volume control is implemented
66  *     in software (as opposed to a hardware control)
67  * @GST_MIXER_TRACK_NO_RECORD: input track lacks support for recordable.
68  *     Since: 0.10.23
69  * @GST_MIXER_TRACK_NO_MUTE: play track doesn't support mute. Since: 0.10.23
70  * @GST_MIXER_TRACK_WHITELIST: track should be displayed "by default" in apps.
71  *     Since: 0.10.23
72  * @GST_MIXER_TRACK_READONLY: track is read-only. Since: 0.10.25
73  * @GST_MIXER_TRACK_WRITEONLY: track is write-only. Since: 0.10.25
74  *
75  * Mixer track flags.
76  */
77 typedef enum {
78   GST_MIXER_TRACK_INPUT  = (1<<0),
79   GST_MIXER_TRACK_OUTPUT = (1<<1),
80   GST_MIXER_TRACK_MUTE   = (1<<2),
81   GST_MIXER_TRACK_RECORD = (1<<3),
82   GST_MIXER_TRACK_MASTER = (1<<4),
83   GST_MIXER_TRACK_SOFTWARE = (1<<5),
84   GST_MIXER_TRACK_NO_RECORD = (1<<6),
85   GST_MIXER_TRACK_NO_MUTE = (1<<7),
86   GST_MIXER_TRACK_WHITELIST = (1<<8),
87   GST_MIXER_TRACK_READONLY = (1<<9),
88   GST_MIXER_TRACK_WRITEONLY = (1<<10)
89 } GstMixerTrackFlags;
90
91 /* FIXME 0.11: READONLY/WRITEONLY -> READABLE/WRITABLE etc. */
92
93 #define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \
94   ((channel)->flags & flag)
95
96 typedef struct _GstMixerTrack GstMixerTrack;
97 typedef struct _GstMixerTrackClass GstMixerTrackClass;
98
99 struct _GstMixerTrack {
100   GObject            parent;
101
102   gchar             *label;
103
104   /* FIXME 0.11: flags should be guint32 */
105   GstMixerTrackFlags flags;
106
107   gint               num_channels;
108   gint               min_volume;
109   gint               max_volume;
110
111   /* FIXME 0.11: add padding */
112 };
113
114 struct _GstMixerTrackClass {
115   GObjectClass parent;
116
117 #ifdef GST_MIXER_NEED_DEPRECATED
118   /* signals (deprecated) */
119   void (* mute_toggled)   (GstMixerTrack *channel,
120                            gboolean       mute);
121   void (* record_toggled) (GstMixerTrack *channel,
122                            gboolean       record);
123   void (* volume_changed) (GstMixerTrack *channel,
124                            gint          *volumes);
125 #endif /* GST_MIXER_NEED_DEPRECATED */
126
127   gpointer _gst_reserved[GST_PADDING];
128 };
129
130 GType           gst_mixer_track_get_type        (void);
131
132 G_END_DECLS
133
134 #endif /* __GST_MIXER_TRACK_H__ */