1 /* XMMS - Cross-platform multimedia player
2 * Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * 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.
18 #ifndef AUDIO_PLUGIN_H
19 #define AUDIO_PLUGIN_H
24 FMT_U8, FMT_S8, FMT_U16_LE, FMT_U16_BE, FMT_U16_NE, FMT_S16_LE, FMT_S16_BE, FMT_S16_NE
30 void *handle; /* Filled in by xmms */
31 char *filename; /* Filled in by xmms */
32 char *description; /* The description that is shown in the preferences box */
34 void (*about) (void); /* Show the about box */
35 void (*configure) (void); /* Show the configuration dialog */
36 void (*get_volume) (int *l, int *r);
37 void (*set_volume) (int l, int r); /* Set the volume */
38 int (*open_audio) (AFormat fmt, int rate, int nch); /* Open the device, if the device can't handle the given
39 parameters the plugin is responsible for downmixing
40 the data to the right format before outputting it */
41 void (*write_audio) (void *ptr, int length); /* The input plugin calls this to write data to the output
43 void (*close_audio) (void); /* No comment... */
44 void (*flush) (int time); /* Flush the buffer and set the plugins internal timers to time */
45 void (*pause) (short paused); /* Pause or unpause the output */
46 int (*buffer_free) (void); /* Return the amount of data that can be written to the buffer,
47 two calls to this without a call to write_audio should make
48 the plugin output audio directly */
49 int (*buffer_playing) (void); /* Returns TRUE if the plugin currently is playing some audio,
50 otherwise return FALSE */
51 int (*output_time) (void); /* Return the current playing time */
52 int (*written_time) (void); /* Return the length of all the data that has been written to