support for binding :commands to keys
[cmus.git] / cmus / output.h
blob2fb39907ba2073920ba1dc69c27976a9e3437e26
1 /*
2 * Copyright 2005 Timo Hirvonen
3 */
5 #ifndef _OUTPUT_H
6 #define _OUTPUT_H
8 #include <sf.h>
10 extern void op_init_plugins(void);
13 * errors: OP_ERROR_{}
15 extern int op_init(void);
18 * errors: OP_ERROR_{}
20 extern int op_exit(void);
23 * select output plugin and open its mixer
25 * errors: OP_ERROR_{ERRNO, NO_PLUGIN}
27 extern int op_select(const char *name);
30 * open selected plugin
32 * errors: OP_ERROR_{}
34 extern int op_open(sample_format_t sf);
37 * returns:
38 * 0 if sample format didn't change
39 * 1 if sample format did change
40 * OP_ERROR_{} on error
42 extern int op_set_sf(sample_format_t sf);
44 extern int op_second_size(void);
47 * drop pcm data
49 * errors: OP_ERROR_{ERRNO}
51 extern int op_drop(void);
54 * close plugin
56 * errors: OP_ERROR_{}
58 extern int op_close(void);
61 * returns bytes written or error
63 * errors: OP_ERROR_{ERRNO}
65 extern int op_write(const char *buffer, int count);
68 * errors: OP_ERROR_{}
70 extern int op_pause(void);
71 extern int op_unpause(void);
74 * returns space in output buffer in bytes or -1 if busy
76 extern int op_buffer_space(void);
79 * errors: OP_ERROR_{}
81 extern int op_reset(void);
84 * set volume (0..100)
86 * returns actual volume which might not be same as given volume
87 * because of rounding
89 extern int op_set_volume(int *left, int *right);
92 * get volume (0..100)
94 * errors: OP_ERROR_{}
96 extern int op_get_volume(int *left, int *right);
99 * adds volume and returns new volume
101 * NOTE: adds volume to internal volume which might not be 0..100.
102 * returned volume is always 0..100.
104 extern int op_add_volume(int *left, int *right);
107 * returns 1 if changed, 0 otherwise
109 extern int op_volume_changed(int *left, int *right);
112 * errors: OP_ERROR_{NO_PLUGIN, NOT_INITIALIZED, NOT_OPTION}
114 extern int op_set_option(const char *key, const char *val);
115 extern int op_get_option(const char *key, char **val);
117 extern int op_for_each_option(void (*callback)(void *data, const char *key), void *data);
118 extern char *op_get_error_msg(int rc, const char *arg);
119 extern void op_dump_plugins(void);
120 extern char *op_get_current(void);
122 #endif