1
/*
2
 * Copyright 2008-2011 Various Authors
3
 * Copyright 2005 Timo Hirvonen
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License as
7
 * published by the Free Software Foundation; either version 2 of the
8
 * License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful, but
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
#ifndef _OUTPUT_H
20
#define _OUTPUT_H
21
22
#include "sf.h"
23
#include "channelmap.h"
24
25
extern int volume_max;
26
extern int volume_l;
27
extern int volume_r;
28
29
void op_load_plugins(void);
30
void op_exit_plugins(void);
31
32
/*
33
 * select output plugin and open its mixer
34
 *
35
 * errors: OP_ERROR_{ERRNO, NO_PLUGIN}
36
 */
37
int op_select(const char *name);
38
int op_select_any(void);
39
40
/*
41
 * open selected plugin
42
 *
43
 * errors: OP_ERROR_{}
44
 */
45
int op_open(sample_format_t sf, const channel_position_t *channel_map);
46
47
/*
48
 * drop pcm data
49
 *
50
 * errors: OP_ERROR_{ERRNO}
51
 */
52
int op_drop(void);
53
54
/*
55
 * close plugin
56
 *
57
 * errors: OP_ERROR_{}
58
 */
59
int op_close(void);
60
61
/*
62
 * returns bytes written or error
63
 *
64
 * errors: OP_ERROR_{ERRNO}
65
 */
66
int op_write(const char *buffer, int count);
67
68
/*
69
 * errors: OP_ERROR_{}
70
 */
71
int op_pause(void);
72
int op_unpause(void);
73
74
/*
75
 * returns space in output buffer in bytes or -1 if busy
76
 */
77
int op_buffer_space(void);
78
79
/*
80
 * errors: OP_ERROR_{}
81
 */
82
int op_reset(void);
83
84
void mixer_open(void);
85
void mixer_close(void);
86
int mixer_set_volume(int left, int right);
87
int mixer_read_volume(void);
88
int mixer_get_fds(int *fds);
89
90
void op_add_options(void);
91
char *op_get_error_msg(int rc, const char *arg);
92
void op_dump_plugins(void);
93
const char *op_get_current(void);
94
95
#endif