MixerControl.hxx 1.7 KB
Newer Older
1
/*
Max Kellermann's avatar
Max Kellermann committed
2
 * Copyright 2003-2017 The Music Player Daemon Project
3 4 5 6 7 8 9 10 11 12 13
 * http://www.musicpd.org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
14 15 16 17
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 19
 */

20 21
/** \file
 *
Max Kellermann's avatar
Max Kellermann committed
22
 * Functions which manipulate a #Mixer object.
23 24
 */

25 26
#ifndef MPD_MIXER_CONTROL_HXX
#define MPD_MIXER_CONTROL_HXX
27

28
class Mixer;
29
class EventLoop;
30
class AudioOutput;
31
struct MixerPlugin;
32
class MixerListener;
33
struct ConfigBlock;
34

35 36 37
/**
 * Throws std::runtime_error on error.
 */
38
Mixer *
39
mixer_new(EventLoop &event_loop, const MixerPlugin &plugin,
40
	  AudioOutput &ao,
41
	  MixerListener &listener,
42
	  const ConfigBlock &block);
43 44

void
45
mixer_free(Mixer *mixer);
46

47 48 49 50 51
/**
 * Throws std::runtime_error on error.
 */
void
mixer_open(Mixer *mixer);
52 53

void
54
mixer_close(Mixer *mixer);
55

56 57
/**
 * Close the mixer unless the plugin's "global" flag is set.  This is
58
 * called when the #AudioOutput is closed.
59 60
 */
void
61
mixer_auto_close(Mixer *mixer);
62

63 64 65
/**
 * Throws std::runtime_error on error.
 */
66
int
67
mixer_get_volume(Mixer *mixer);
68

69 70 71 72 73
/**
 * Throws std::runtime_error on error.
 */
void
mixer_set_volume(Mixer *mixer, unsigned volume);
74

75
#endif