configure.ac: Move OggVorbis Encoder to Encoder Plugins.
[mpd-mk.git] / src / mixer_plugin.h
blob0915a03f3731d221ec10a87e891ebf834b738398
1 /*
2 * Copyright (C) 2003-2010 The Music Player Daemon Project
3 * http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 /** \file
22 * This header declares the mixer_plugin class. It should not be
23 * included directly; use mixer_api.h instead in mixer
24 * implementations.
27 #ifndef MPD_MIXER_PLUGIN_H
28 #define MPD_MIXER_PLUGIN_H
30 #include <glib.h>
32 #include <stdbool.h>
34 struct config_param;
35 struct mixer;
37 struct mixer_plugin {
38 /**
39 * Alocates and configures a mixer device.
41 * @param ao the pointer returned by audio_output_plugin.init
42 * @param param the configuration section, or NULL if there is
43 * no configuration
44 * @param error_r location to store the error occuring, or
45 * NULL to ignore errors
46 * @return a mixer object, or NULL on error
48 struct mixer *(*init)(void *ao, const struct config_param *param,
49 GError **error_r);
51 /**
52 * Finish and free mixer data
54 void (*finish)(struct mixer *data);
56 /**
57 * Open mixer device
59 * @param error_r location to store the error occuring, or
60 * NULL to ignore errors
61 * @return true on success, false on error
63 bool (*open)(struct mixer *data, GError **error_r);
65 /**
66 * Close mixer device
68 void (*close)(struct mixer *data);
70 /**
71 * Reads the current volume.
73 * @param error_r location to store the error occuring, or
74 * NULL to ignore errors
75 * @return the current volume (0..100 including) or -1 if
76 * unavailable or on error (error_r set, mixer will be closed)
78 int (*get_volume)(struct mixer *mixer, GError **error_r);
80 /**
81 * Sets the volume.
83 * @param error_r location to store the error occuring, or
84 * NULL to ignore errors
85 * @param volume the new volume (0..100 including)
86 * @return true on success, false on error
88 bool (*set_volume)(struct mixer *mixer, unsigned volume,
89 GError **error_r);
91 /**
92 * If true, then the mixer is automatically opened, even if
93 * its audio output is not open. If false, then the mixer is
94 * disabled as long as its audio output is closed.
96 bool global;
99 #endif