00001 /* 00002 * Copyright (C) 2003-2009 The Music Player Daemon Project 00003 * http://www.musicpd.org 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 #ifndef MPD_OUTPUT_INTERNAL_H 00021 #define MPD_OUTPUT_INTERNAL_H 00022 00023 #include "audio_format.h" 00024 #include "pcm_convert.h" 00025 #include "notify.h" 00026 00027 #include <time.h> 00028 00029 enum audio_output_command { 00030 AO_COMMAND_NONE = 0, 00031 AO_COMMAND_OPEN, 00032 AO_COMMAND_CLOSE, 00033 AO_COMMAND_PAUSE, 00034 AO_COMMAND_CANCEL, 00035 AO_COMMAND_KILL 00036 }; 00037 00038 struct audio_output { 00042 const char *name; 00043 00047 const struct audio_output_plugin *plugin; 00048 00053 void *data; 00054 00060 struct mixer *mixer; 00061 00066 bool config_audio_format; 00067 00071 bool enabled; 00072 00081 bool open; 00082 00087 bool pause; 00088 00094 GTimer *fail_timer; 00095 00100 struct audio_format in_audio_format; 00101 00108 struct audio_format out_audio_format; 00109 00110 struct pcm_convert_state convert_state; 00111 00116 GThread *thread; 00117 00121 struct notify notify; 00122 00126 enum audio_output_command command; 00127 00131 const struct music_pipe *pipe; 00132 00136 GMutex *mutex; 00137 00144 const struct music_chunk *chunk; 00145 00149 bool chunk_finished; 00150 }; 00151 00156 extern struct notify audio_output_client_notify; 00157 00158 static inline bool 00159 audio_output_is_open(const struct audio_output *ao) 00160 { 00161 return ao->open; 00162 } 00163 00164 static inline bool 00165 audio_output_command_is_finished(const struct audio_output *ao) 00166 { 00167 return ao->command == AO_COMMAND_NONE; 00168 } 00169 00170 #endif