cleanup: reindent audio_out.[ch]
[mplayer.git] / libao2 / audio_out.h
blobdddcb55a6acabdf97f3cba97d6d68c6111230a52
1 /*
2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef MPLAYER_AUDIO_OUT_H
20 #define MPLAYER_AUDIO_OUT_H
22 #include <stdbool.h>
24 typedef struct ao_info {
25 /* driver name ("Matrox Millennium G200/G400" */
26 const char *name;
27 /* short name (for config strings) ("mga") */
28 const char *short_name;
29 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */
30 const char *author;
31 /* any additional comments */
32 const char *comment;
33 } ao_info_t;
35 /* interface towards mplayer and */
36 typedef struct ao_functions {
37 const ao_info_t *info;
38 int (*control)(int cmd, void *arg);
39 int (*init)(int rate, int channels, int format, int flags);
40 void (*uninit)(int immed);
41 void (*reset)(void);
42 int (*get_space)(void);
43 int (*play)(void *data, int len, int flags);
44 float (*get_delay)(void);
45 void (*pause)(void);
46 void (*resume)(void);
47 } ao_functions_t;
49 /* global data used by mplayer and plugins */
50 struct ao {
51 int samplerate;
52 int channels;
53 int format;
54 int bps;
55 int outburst;
56 int buffersize;
57 int pts;
58 bool initialized;
59 const struct ao_functions *driver;
62 extern char *ao_subdevice;
64 void list_audio_out(void);
66 #define CONTROL_OK 1
67 #define CONTROL_TRUE 1
68 #define CONTROL_FALSE 0
69 #define CONTROL_UNKNOWN -1
70 #define CONTROL_ERROR -2
71 #define CONTROL_NA -3
73 #define AOCONTROL_SET_DEVICE 1
74 #define AOCONTROL_GET_DEVICE 2
75 #define AOCONTROL_QUERY_FORMAT 3 /* test for availabilty of a format */
76 #define AOCONTROL_GET_VOLUME 4
77 #define AOCONTROL_SET_VOLUME 5
78 #define AOCONTROL_SET_PLUGIN_DRIVER 6
79 #define AOCONTROL_SET_PLUGIN_LIST 7
81 #define AOPLAY_FINAL_CHUNK 1
83 typedef struct ao_control_vol {
84 float left;
85 float right;
86 } ao_control_vol_t;
88 struct ao *ao_create(void);
89 void ao_init(struct ao *ao, char **ao_list);
90 void ao_uninit(struct ao *ao, bool drain_audio);
91 int ao_play(struct ao *ao, void *data, int len, int flags);
92 int ao_control(struct ao *ao, int cmd, void *arg);
93 double ao_get_delay(struct ao *ao);
94 int ao_get_space(struct ao *ao);
95 void ao_reset(struct ao *ao);
96 void ao_pause(struct ao *ao);
97 void ao_resume(struct ao *ao);
99 #endif /* MPLAYER_AUDIO_OUT_H */