Initial revision 6759
[qball-mpd.git] / src / .svn / text-base / audioOutput.h.svn-base
blob1591c814a583f3e544e7ca3241c6c505a94719a6
1 /* the Music Player Daemon (MPD)
2  * Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com)
3  * This project's homepage is: http://www.musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
19 #ifndef AUDIO_OUTPUT_H
20 #define AUDIO_OUTPUT_H
22 #include "../config.h"
24 #include "pcm_utils.h"
25 #include "mpd_types.h"
26 #include "audio.h"
27 #include "tag.h"
28 #include "conf.h"
29 #include "utils.h"
31 #define DISABLED_AUDIO_OUTPUT_PLUGIN(plugin) AudioOutputPlugin plugin;
33 typedef struct _AudioOutput AudioOutput;
35 typedef int (*AudioOutputTestDefaultDeviceFunc) ();
37 typedef int (*AudioOutputInitDriverFunc) (AudioOutput * audioOutput,
38                                           ConfigParam * param);
40 typedef void (*AudioOutputFinishDriverFunc) (AudioOutput * audioOutput);
42 typedef int (*AudioOutputOpenDeviceFunc) (AudioOutput * audioOutput);
44 typedef int (*AudioOutputPlayFunc) (AudioOutput * audioOutput,
45                                     char *playChunk, int size);
47 typedef void (*AudioOutputDropBufferedAudioFunc) (AudioOutput * audioOutput);
49 typedef void (*AudioOutputCloseDeviceFunc) (AudioOutput * audioOutput);
51 typedef void (*AudioOutputSendMetadataFunc) (AudioOutput * audioOutput,
52                                              MpdTag * tag);
54 struct _AudioOutput {
55         int open;
56         char *name;
57         char *type;
59         AudioOutputFinishDriverFunc finishDriverFunc;
60         AudioOutputOpenDeviceFunc openDeviceFunc;
61         AudioOutputPlayFunc playFunc;
62         AudioOutputDropBufferedAudioFunc dropBufferedAudioFunc;
63         AudioOutputCloseDeviceFunc closeDeviceFunc;
64         AudioOutputSendMetadataFunc sendMetdataFunc;
66         int convertAudioFormat;
67         AudioFormat inAudioFormat;
68         AudioFormat outAudioFormat;
69         AudioFormat reqAudioFormat;
70         ConvState convState;
71         char *convBuffer;
72         int convBufferLen;
73         int sameInAndOutFormats;
75         void *data;
78 typedef struct _AudioOutputPlugin {
79         char *name;
81         AudioOutputTestDefaultDeviceFunc testDefaultDeviceFunc;
82         AudioOutputInitDriverFunc initDriverFunc;
83         AudioOutputFinishDriverFunc finishDriverFunc;
84         AudioOutputOpenDeviceFunc openDeviceFunc;
85         AudioOutputPlayFunc playFunc;
86         AudioOutputDropBufferedAudioFunc dropBufferedAudioFunc;
87         AudioOutputCloseDeviceFunc closeDeviceFunc;
88         AudioOutputSendMetadataFunc sendMetdataFunc;
89 } AudioOutputPlugin;
91 void initAudioOutputPlugins(void);
92 void finishAudioOutputPlugins(void);
94 void loadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin);
95 void unloadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin);
97 int initAudioOutput(AudioOutput *, ConfigParam * param);
98 int openAudioOutput(AudioOutput * audioOutput, AudioFormat * audioFormat);
99 int playAudioOutput(AudioOutput * audioOutput, char *playChunk, int size);
100 void dropBufferedAudioOutput(AudioOutput * audioOutput);
101 void closeAudioOutput(AudioOutput * audioOutput);
102 void finishAudioOutput(AudioOutput * audioOutput);
103 int keepAudioOutputAlive(AudioOutput * audioOutput, int ms);
104 void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag);
106 void printAllOutputPluginTypes(FILE * fp);
108 extern AudioOutputPlugin shoutPlugin;
109 extern AudioOutputPlugin nullPlugin;
110 extern AudioOutputPlugin fifoPlugin;
111 extern AudioOutputPlugin alsaPlugin;
112 extern AudioOutputPlugin aoPlugin;
113 extern AudioOutputPlugin ossPlugin;
114 extern AudioOutputPlugin osxPlugin;
115 extern AudioOutputPlugin pulsePlugin;
116 extern AudioOutputPlugin mvpPlugin;
117 extern AudioOutputPlugin jackPlugin;
119 #endif