audio: don't pass "fd" to printAudioDevices()

Pass the client struct instead.
This commit is contained in:
Max Kellermann 2008-09-07 14:04:16 +02:00
parent a6c5928c75
commit 4d8438e63d
3 changed files with 12 additions and 9 deletions

View File

@ -20,7 +20,7 @@
#include "audioOutput.h" #include "audioOutput.h"
#include "log.h" #include "log.h"
#include "path.h" #include "path.h"
#include "myfprintf.h" #include "client.h"
#include "os_compat.h" #include "os_compat.h"
#define AUDIO_DEVICE_STATE "audio_device_state:" #define AUDIO_DEVICE_STATE "audio_device_state:"
@ -448,16 +448,18 @@ int disableAudioDevice(unsigned int device)
return 0; return 0;
} }
void printAudioDevices(int fd) void printAudioDevices(struct client *client)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < audioOutputArraySize; i++) { for (i = 0; i < audioOutputArraySize; i++) {
fdprintf(fd, client_printf(client,
"outputid: %i\noutputname: %s\noutputenabled: %i\n", "outputid: %i\n"
i, "outputname: %s\n"
audioOutputArray[i].name, "outputenabled: %i\n",
audioDeviceStates[i] & 0x01); i,
audioOutputArray[i].name,
audioDeviceStates[i] & 0x01);
} }
} }

View File

@ -25,6 +25,7 @@
#define AUDIO_AO_DRIVER_DEFAULT "default" #define AUDIO_AO_DRIVER_DEFAULT "default"
struct tag; struct tag;
struct client;
void copyAudioFormat(AudioFormat * dest, const AudioFormat * src); void copyAudioFormat(AudioFormat * dest, const AudioFormat * src);
@ -64,7 +65,7 @@ int enableAudioDevice(unsigned int device);
int disableAudioDevice(unsigned int device); int disableAudioDevice(unsigned int device);
void printAudioDevices(int fd); void printAudioDevices(struct client *client);
void readAudioDevicesState(FILE *fp); void readAudioDevicesState(FILE *fp);

View File

@ -1230,7 +1230,7 @@ static int handleDisableDevice(struct client *client, mpd_unused int *permission
static int handleDevices(struct client *client, mpd_unused int *permission, static int handleDevices(struct client *client, mpd_unused int *permission,
mpd_unused int argc, mpd_unused char *argv[]) mpd_unused int argc, mpd_unused char *argv[])
{ {
printAudioDevices(client_get_fd(client)); printAudioDevices(client);
return 0; return 0;
} }