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.
21 #include "mixer_control.h"
22 #include "mixer_list.h"
23 #include "filter_registry.h"
24 #include "pcm_volume.h"
25 #include "event_pipe.h"
34 #include "output/pulse_output_plugin.h"
37 pulse_output_set_mixer(G_GNUC_UNUSED
struct pulse_output
*po
,
38 G_GNUC_UNUSED
struct pulse_mixer
*pm
)
43 pulse_output_clear_mixer(G_GNUC_UNUSED
struct pulse_output
*po
,
44 G_GNUC_UNUSED
struct pulse_mixer
*pm
)
49 pulse_output_set_volume(G_GNUC_UNUSED
struct pulse_output
*po
,
50 G_GNUC_UNUSED
const struct pa_cvolume
*volume
,
51 G_GNUC_UNUSED GError
**error_r
)
59 event_pipe_emit(G_GNUC_UNUSED
enum pipe_event event
)
63 const struct filter_plugin
*
64 filter_plugin_by_name(G_GNUC_UNUSED
const char *name
)
71 pcm_volume(G_GNUC_UNUSED
void *buffer
, G_GNUC_UNUSED
int length
,
72 G_GNUC_UNUSED
const struct audio_format
*format
,
73 G_GNUC_UNUSED
int volume
)
79 int main(int argc
, G_GNUC_UNUSED
char **argv
)
87 g_printerr("Usage: read_mixer PLUGIN\n");
93 mixer
= mixer_new(&alsa_mixer_plugin
, NULL
, NULL
, &error
);
95 g_printerr("mixer_new() failed: %s\n", error
->message
);
100 success
= mixer_open(mixer
, &error
);
103 g_printerr("failed to open the mixer: %s\n", error
->message
);
108 volume
= mixer_get_volume(mixer
, &error
);
112 assert(volume
>= -1 && volume
<= 100);
116 g_printerr("failed to read volume: %s\n",
120 g_printerr("failed to read volume\n");
124 g_print("%d\n", volume
);