MixerControl.hxx 1.69 KB
Newer Older
1
/*
2
 * Copyright 2003-2016 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
struct 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, AudioOutput &ao,
40
	  MixerListener &listener,
41
	  const ConfigBlock &block);
42 43

void
44
mixer_free(Mixer *mixer);
45

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

void
53
mixer_close(Mixer *mixer);
54

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

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

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

74
#endif