aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/output_internal.h')
-rw-r--r--src/output_internal.h62
1 files changed, 48 insertions, 14 deletions
diff --git a/src/output_internal.h b/src/output_internal.h
index 72596c1c3..804fd8cdc 100644
--- a/src/output_internal.h
+++ b/src/output_internal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2009 The Music Player Daemon Project
+ * Copyright (C) 2003-2010 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -21,16 +21,32 @@
#define MPD_OUTPUT_INTERNAL_H
#include "audio_format.h"
-#include "pcm_convert.h"
-#include "notify.h"
+
+#include <glib.h>
#include <time.h>
enum audio_output_command {
AO_COMMAND_NONE = 0,
+ AO_COMMAND_ENABLE,
+ AO_COMMAND_DISABLE,
AO_COMMAND_OPEN,
+
+ /**
+ * This command is invoked when the input audio format
+ * changes.
+ */
+ AO_COMMAND_REOPEN,
+
AO_COMMAND_CLOSE,
AO_COMMAND_PAUSE,
+
+ /**
+ * Drains the internal (hardware) buffers of the device. This
+ * operation may take a while to complete.
+ */
+ AO_COMMAND_DRAIN,
+
AO_COMMAND_CANCEL,
AO_COMMAND_KILL
};
@@ -60,15 +76,15 @@ struct audio_output {
struct mixer *mixer;
/**
- * This flag is true, when the audio_format of this device is
- * configured in mpd.conf.
+ * Has the user enabled this device?
*/
- bool config_audio_format;
+ bool enabled;
/**
- * Has the user enabled this device?
+ * Is this device actually enabled, i.e. the "enable" method
+ * has succeeded?
*/
- bool enabled;
+ bool really_enabled;
/**
* Is the device (already) open and functional?
@@ -94,6 +110,11 @@ struct audio_output {
GTimer *fail_timer;
/**
+ * The configured audio format.
+ */
+ struct audio_format config_audio_format;
+
+ /**
* The audio_format in which audio data is received from the
* player thread (which in turn receives it from the decoder).
*/
@@ -107,18 +128,25 @@ struct audio_output {
*/
struct audio_format out_audio_format;
- struct pcm_convert_state convert_state;
+ /**
+ * The filter object of this audio output. This is an
+ * instance of chain_filter_plugin.
+ */
+ struct filter *filter;
/**
- * The thread handle, or NULL if the output thread isn't
- * running.
+ * The convert_filter_plugin instance of this audio output.
+ * It is the last item in the filter chain, and is responsible
+ * for converting the input data into the appropriate format
+ * for this audio output.
*/
- GThread *thread;
+ struct filter *convert_filter;
/**
- * Notify object for the thread.
+ * The thread handle, or NULL if the output thread isn't
+ * running.
*/
- struct notify notify;
+ GThread *thread;
/**
* The next command to be performed by the output thread.
@@ -136,6 +164,12 @@ struct audio_output {
GMutex *mutex;
/**
+ * This condition object wakes up the output thread after
+ * #command has been set.
+ */
+ GCond *cond;
+
+ /**
* The #music_chunk which is currently being played. All
* chunks before this one may be returned to the
* #music_buffer, because they are not going to be used by