aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/audio.c16
-rw-r--r--src/audio.h3
-rw-r--r--src/command.c1
-rw-r--r--src/output_print.c43
-rw-r--r--src/output_print.h32
6 files changed, 78 insertions, 19 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4888bfa27..140c0f436 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,6 +42,7 @@ mpd_headers = \
output_thread.h \
output_control.h \
output_state.h \
+ output_print.h \
output/shout_plugin.h \
buffer2array.h \
command.h \
@@ -140,6 +141,7 @@ mpd_SOURCES = \
output_thread.c \
output_control.c \
output_state.c \
+ output_print.c \
output_init.c \
output/null_plugin.c \
buffer2array.c \
diff --git a/src/audio.c b/src/audio.c
index ef62ef958..56aa70921 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -22,7 +22,6 @@
#include "output_control.h"
#include "output_internal.h"
#include "path.h"
-#include "client.h"
#include "idle.h"
#include "mixer_api.h"
@@ -381,21 +380,6 @@ int disableAudioDevice(unsigned int device)
return 0;
}
-void printAudioDevices(struct client *client)
-{
- unsigned int i;
-
- for (i = 0; i < audioOutputArraySize; i++) {
- client_printf(client,
- "outputid: %i\n"
- "outputname: %s\n"
- "outputenabled: %i\n",
- i,
- audioOutputArray[i].name,
- audioOutputArray[i].enabled);
- }
-}
-
bool mixer_control_setvol(unsigned int device, int volume, int rel)
{
struct audio_output *output;
diff --git a/src/audio.h b/src/audio.h
index 063a02b05..2ccebc358 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -26,7 +26,6 @@
struct audio_format;
struct tag;
-struct client;
struct config_param;
/**
@@ -80,8 +79,6 @@ int enableAudioDevice(unsigned int device);
int disableAudioDevice(unsigned int device);
-void printAudioDevices(struct client *client);
-
bool mixer_control_setvol(unsigned int device, int volume, int rel);
bool mixer_control_getvol(unsigned int device, int *volume);
diff --git a/src/command.c b/src/command.c
index 3b8ae9567..834f0c4b5 100644
--- a/src/command.c
+++ b/src/command.c
@@ -35,6 +35,7 @@
#include "stored_playlist.h"
#include "ack.h"
#include "audio.h"
+#include "output_print.h"
#include "locate.h"
#include "dbUtils.h"
#include "tag.h"
diff --git a/src/output_print.c b/src/output_print.c
new file mode 100644
index 000000000..6b2ab1b31
--- /dev/null
+++ b/src/output_print.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2009 The Music Player Daemon Project
+ * 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.
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Protocol specific code for the audio output library.
+ *
+ */
+
+#include "output_print.h"
+#include "output_internal.h"
+#include "audio.h"
+#include "client.h"
+
+void
+printAudioDevices(struct client *client)
+{
+ unsigned n = audio_output_count();
+
+ for (unsigned i = 0; i < n; ++i) {
+ const struct audio_output *ao = audio_output_get(i);
+
+ client_printf(client,
+ "outputid: %i\n"
+ "outputname: %s\n"
+ "outputenabled: %i\n",
+ i, ao->name, ao->enabled);
+ }
+}
diff --git a/src/output_print.h b/src/output_print.h
new file mode 100644
index 000000000..df15f765d
--- /dev/null
+++ b/src/output_print.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2003-2009 The Music Player Daemon Project
+ * 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.
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Protocol specific code for the audio output library.
+ *
+ */
+
+#ifndef OUTPUT_PRINT_H
+#define OUTPUT_PRINT_H
+
+struct client;
+
+void
+printAudioDevices(struct client *client);
+
+#endif