fix Cyberblade VidiX driver TVOUT patch by Benjamin Zores <ben@tutuxclan.org>
[mplayer.git] / libaf / control.h
blob31ad012b0bc434c262646a65eeee610e346c4560
1 #ifndef __af_control_h
2 #define __af_control_h
4 /*********************************************
5 // Control info struct.
6 //
7 // This struct is the argument in a info call to a filter.
8 */
10 // Argument types
11 #define AF_CONTROL_TYPE_BOOL (0x0<<0)
12 #define AF_CONTROL_TYPE_CHAR (0x1<<0)
13 #define AF_CONTROL_TYPE_INT (0x2<<0)
14 #define AF_CONTROL_TYPE_FLOAT (0x3<<0)
15 #define AF_CONTROL_TYPE_STRUCT (0x4<<0)
16 #define AF_CONTROL_TYPE_SPECIAL (0x5<<0) // a pointer to a function for example
17 #define AF_CONTROL_TYPE_MASK (0x7<<0)
18 // Argument geometry
19 #define AF_CONTROL_GEOM_SCALAR (0x0<<3)
20 #define AF_CONTROL_GEOM_ARRAY (0x1<<3)
21 #define AF_CONTROL_GEOM_MATRIX (0x2<<3)
22 #define AF_CONTROL_GEOM_MASK (0x3<<3)
23 // Argument properties
24 #define AF_CONTROL_PROP_READ (0x0<<5) // The argument can be read
25 #define AF_CONTROL_PROP_WRITE (0x1<<5) // The argument can be written
26 #define AF_CONTROL_PROP_SAVE (0x2<<5) // Can be saved
27 #define AF_CONTROL_PROP_RUNTIME (0x4<<5) // Acessable during execution
28 #define AF_CONTROL_PROP_CHANNEL (0x8<<5) // Argument is set per channel
29 #define AF_CONTROL_PROP_MASK (0xF<<5)
31 typedef struct af_control_info_s{
32 int def; // Control enumrification
33 char* name; // Name of argument
34 char* info; // Description of what it does
35 int flags; // Flags as defined above
36 float max; // Max and min value
37 float min; // (only aplicable on float and int)
38 int xdim; // 1st dimension
39 int ydim; // 2nd dimension (=0 for everything except matrix)
40 size_t sz; // Size of argument in bytes
41 int ch; // Channel number (for future use)
42 void* arg; // Data (for future use)
43 }af_control_info_t;
46 /*********************************************
47 // Extended control used with arguments that operates on only one
48 // channel at the time
50 typedef struct af_control_ext_s{
51 void* arg; // Argument
52 int ch; // Chanel number
53 }af_control_ext_t;
55 /*********************************************
56 // Control parameters
59 /* The control system is divided into 3 levels
60 mandatory calls - all filters must answer to all of these
61 optional calls - are optional
62 filter specific calls - applies only to some filters
65 #define AF_CONTROL_MANDATORY 0x10000000
66 #define AF_CONTROL_OPTIONAL 0x20000000
67 #define AF_CONTROL_FILTER_SPECIFIC 0x40000000
69 // MANDATORY CALLS
71 /* Reinitialize filter. The optional argument contains the new
72 configuration in form of a af_data_t struct. If the filter does not
73 support the new format the struct should be changed and AF_FALSE
74 should be returned. If the incoming and outgoing data streams are
75 identical the filter can return AF_DETACH. This will remove the
76 filter. */
77 #define AF_CONTROL_REINIT 0x00000100 | AF_CONTROL_MANDATORY
79 // OPTIONAL CALLS
81 /* Called just after creation with the af_cfg for the stream in which
82 the filter resides as input parameter this call can be used by the
83 filter to initialize itself */
84 #define AF_CONTROL_POST_CREATE 0x00000100 | AF_CONTROL_OPTIONAL
86 // Called just before destruction of a filter
87 #define AF_CONTROL_PRE_DESTROY 0x00000200 | AF_CONTROL_OPTIONAL
89 /* Commandline parameters. If there were any commandline parameters
90 for this specific filter, they will be given as a char* in the
91 argument */
92 #define AF_CONTROL_COMMAND_LINE 0x00000300 | AF_CONTROL_OPTIONAL
95 // FILTER SPECIFIC CALLS
97 // Basic operations: These can be ored with any of the below calls
98 // Set argument
99 #define AF_CONTROL_SET 0x00000000
100 // Get argument
101 #define AF_CONTROL_GET 0x00000001
102 // Get info about the control, i.e fill in everything except argument
103 #define AF_CONTROL_INFO 0x00000002
105 // Resample
107 // Set output rate in resample
108 #define AF_CONTROL_RESAMPLE_RATE 0x00000100 | AF_CONTROL_FILTER_SPECIFIC
110 // Enable sloppy resampling
111 #define AF_CONTROL_RESAMPLE_SLOPPY 0x00000200 | AF_CONTROL_FILTER_SPECIFIC
113 // Set resampling accuracy
114 #define AF_CONTROL_RESAMPLE_ACCURACY 0x00000300 | AF_CONTROL_FILTER_SPECIFIC
116 // Format
118 // Set output format bits per sample
119 #define AF_CONTROL_FORMAT_BPS 0x00000400 | AF_CONTROL_FILTER_SPECIFIC
121 // Set output format sample format
122 #define AF_CONTROL_FORMAT_FMT 0x00000500 | AF_CONTROL_FILTER_SPECIFIC
124 // Channels
126 // Set number of output channels in channels
127 #define AF_CONTROL_CHANNELS 0x00000600 | AF_CONTROL_FILTER_SPECIFIC
129 // Set number of channel routes
130 #define AF_CONTROL_CHANNELS_ROUTES 0x00000700 | AF_CONTROL_FILTER_SPECIFIC
132 // Set channel routing pair, arg is int[2] and ch is used
133 #define AF_CONTROL_CHANNELS_ROUTING 0x00000800 | AF_CONTROL_FILTER_SPECIFIC
135 // Set nuber of channel routing pairs, arg is int*
136 #define AF_CONTROL_CHANNELS_NR 0x00000900 | AF_CONTROL_FILTER_SPECIFIC
138 // Set make af_channels into a router
139 #define AF_CONTROL_CHANNELS_ROUTER 0x00000A00 | AF_CONTROL_FILTER_SPECIFIC
141 // Volume
143 // Turn volume control on and off, arg is int*
144 #define AF_CONTROL_VOLUME_ON_OFF 0x00000B00 | AF_CONTROL_FILTER_SPECIFIC
146 // Turn soft clipping of the volume on and off, arg is binary
147 #define AF_CONTROL_VOLUME_SOFTCLIP 0x00000C00 | AF_CONTROL_FILTER_SPECIFIC
149 // Set volume level, arg is a float* with the volume for all the channels
150 #define AF_CONTROL_VOLUME_LEVEL 0x00000D00 | AF_CONTROL_FILTER_SPECIFIC
152 // Probed power level for all channels, arg is a float*
153 #define AF_CONTROL_VOLUME_PROBE 0x00000E00 | AF_CONTROL_FILTER_SPECIFIC
155 // Maximum probed power level for all channels, arg is a float*
156 #define AF_CONTROL_VOLUME_PROBE_MAX 0x00000F00 | AF_CONTROL_FILTER_SPECIFIC
158 // Compressor/expander
160 // Turn compressor/expander on and off
161 #define AF_CONTROL_COMP_ON_OFF 0x00001000 | AF_CONTROL_FILTER_SPECIFIC
163 // Compression/expansion threshold [dB]
164 #define AF_CONTROL_COMP_THRESH 0x00001100 | AF_CONTROL_FILTER_SPECIFIC
166 // Compression/expansion attack time [ms]
167 #define AF_CONTROL_COMP_ATTACK 0x00001200 | AF_CONTROL_FILTER_SPECIFIC
169 // Compression/expansion release time [ms]
170 #define AF_CONTROL_COMP_RELEASE 0x00001300 | AF_CONTROL_FILTER_SPECIFIC
172 // Compression/expansion gain level [dB]
173 #define AF_CONTROL_COMP_RATIO 0x00001400 | AF_CONTROL_FILTER_SPECIFIC
175 // Noise gate
177 // Turn noise gate on an off
178 #define AF_CONTROL_GATE_ON_OFF 0x00001500 | AF_CONTROL_FILTER_SPECIFIC
180 // Noise gate threshold [dB]
181 #define AF_CONTROL_GATE_THRESH 0x00001600 | AF_CONTROL_FILTER_SPECIFIC
183 // Noise gate attack time [ms]
184 #define AF_CONTROL_GATE_ATTACK 0x00001700 | AF_CONTROL_FILTER_SPECIFIC
186 // Noise gate release time [ms]
187 #define AF_CONTROL_GATE_RELEASE 0x00001800 | AF_CONTROL_FILTER_SPECIFIC
189 // Noise gate release range level [dB]
190 #define AF_CONTROL_GATE_RANGE 0x00001900 | AF_CONTROL_FILTER_SPECIFIC
192 // Pan
194 // Pan levels, arg is a control_ext with a float*
195 #define AF_CONTROL_PAN_LEVEL 0x00001A00 | AF_CONTROL_FILTER_SPECIFIC
197 // Number of outputs from pan, arg is int*
198 #define AF_CONTROL_PAN_NOUT 0x00001B00 | AF_CONTROL_FILTER_SPECIFIC
201 // Set equalizer gain, arg is a control_ext with a float*
202 #define AF_CONTROL_EQUALIZER_GAIN 0x00001C00 | AF_CONTROL_FILTER_SPECIFIC
205 // Delay length in ms, arg is a control_ext with a float*
206 #define AF_CONTROL_DELAY_LEN 0x00001D00 | AF_CONTROL_FILTER_SPECIFIC
209 // Subwoofer
211 // Channel number which to insert the filtered data, arg in int*
212 #define AF_CONTROL_SUB_CH 0x00001E00 | AF_CONTROL_FILTER_SPECIFIC
214 // Cutoff frequency [Hz] for lowpass filter, arg is float*
215 #define AF_CONTROL_SUB_FC 0x00001F00 | AF_CONTROL_FILTER_SPECIFIC
218 // Export
219 #define AF_CONTROL_EXPORT_SZ 0x00002000 | AF_CONTROL_FILTER_SPECIFIC
222 // ExtraStereo Multiplier
223 #define AF_CONTROL_ES_MUL 0x00002100 | AF_CONTROL_FILTER_SPECIFIC
225 #endif /*__af_control_h */