annotate Plugins/Output/alsa/alsa.h @ 1269:681b629322c4 trunk

[svn] - hook up fileinfo box stuff
author nenolod
date Thu, 15 Jun 2006 22:23:39 -0700
parents 6bafb1360398
children 847d9a218f66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /* XMMS - ALSA output plugin
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * Copyright (C) 2001-2003 Matthieu Sozeau
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * Thomas Nilsson and 4Front Technologies
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * Copyright (C) 1999-2004 Håvard Kvålen
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * (at your option) any later version.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 #ifndef ALSA_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 #define ALSA_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 #include "config.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 #include <libaudacious/util.h>
211
0b48662886e9 [svn] Sync ALSA plugin with enhancements/patches from Fatal (XMMS cvs)
nenolod
parents: 61
diff changeset
27 #include <libaudacious/configdb.h>
1150
6bafb1360398 [svn] - use global value for buffer size
nenolod
parents: 813
diff changeset
28 #include <audacious/main.h>
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 #include <audacious/plugin.h>
211
0b48662886e9 [svn] Sync ALSA plugin with enhancements/patches from Fatal (XMMS cvs)
nenolod
parents: 61
diff changeset
30 #include <glib/gi18n.h>
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 #define ALSA_PCM_NEW_HW_PARAMS_API
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 #define ALSA_PCM_NEW_SW_PARAMS_API
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 #include <alsa/asoundlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 #include <alsa/pcm_plugin.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 #include <gtk/gtk.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 #ifdef WORDS_BIGENDIAN
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 # define IS_BIG_ENDIAN TRUE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 # define IS_BIG_ENDIAN FALSE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 extern OutputPlugin op;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 struct alsa_config
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 char *pcm_device;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 int mixer_card;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 char *mixer_device;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 int buffer_time;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53 int period_time;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 gboolean debug;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 struct
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 int left, right;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 } vol;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 gboolean soft_volume;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 extern struct alsa_config alsa_cfg;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 void alsa_init(void);
813
c8cf439179b8 [svn] - Fix a ton and a half of memory leaks, via the wonderful Leonardo Boshell <leonardop -at- gentoo.org>.
nenolod
parents: 517
diff changeset
65 void alsa_cleanup(void);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 void alsa_about(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 void alsa_configure(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 int alsa_get_mixer(snd_mixer_t **mixer, int card);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 void alsa_save_config(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71 void alsa_get_volume(int *l, int *r);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 void alsa_set_volume(int l, int r);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
73
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
74 int alsa_playing(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
75 int alsa_free(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76 void alsa_write(void *ptr, int length);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 void alsa_close(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78 void alsa_flush(int time);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
79 void alsa_pause(short p);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 int alsa_open(AFormat fmt, int rate, int nch);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
81 int alsa_get_output_time(void);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
82 int alsa_get_written_time(void);
517
55dc40ff1aff [svn] Add tell_audio(AFormat *, gint *, gint *), for retrieving audio
nenolod
parents: 211
diff changeset
83 void alsa_tell(AFormat * fmt, gint * rate, gint * nch);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
84
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85 #endif