audio: moved protocol code to output_print.c

This commit is contained in:
Max Kellermann 2009-02-10 18:51:42 +01:00
parent 49ff2aceb5
commit e7505381eb
6 changed files with 78 additions and 19 deletions

View File

@ -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 \

View File

@ -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;

View File

@ -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);

View File

@ -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"

43
src/output_print.c Normal file
View File

@ -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);
}
}

32
src/output_print.h Normal file
View File

@ -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