annotate src/alsa/alsa.h @ 3020:fdcf79446ddf

Port to new API, lowest prio and NO_DEVICES to avoid autoselect.
author Tony Vroon <chainsaw@gentoo.org>
date Thu, 09 Apr 2009 21:57:39 +0100
parents 8b7a44631121
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 /* XMMS - ALSA output plugin
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 * Copyright (C) 2001-2003 Matthieu Sozeau
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * Thomas Nilsson and 4Front Technologies
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 * Copyright (C) 1999-2004 Håvard Kvålen
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
10 * (at your option) any later version.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
11 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 #ifndef ALSA_H
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22 #define ALSA_H
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23
2228
0f2ac612f318 eliminate warning.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1753
diff changeset
24 #define NDEBUG
0f2ac612f318 eliminate warning.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 1753
diff changeset
25
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26 #include "config.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
27
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2760
diff changeset
28 #include <audlegacy/plugin.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2760
diff changeset
29 #include <audlegacy/i18n.h>
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 #define ALSA_PCM_NEW_HW_PARAMS_API
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
32 #define ALSA_PCM_NEW_SW_PARAMS_API
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
33 #include <alsa/asoundlib.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
34 #include <alsa/pcm_plugin.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
35
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36 #include <gtk/gtk.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
37
2610
1e4d147bdc2b Combine init.c into alsa.c and use a preprocessor define for configdb ID for consistency.
Matti Hamalainen <ccr@tnsp.org>
parents: 2609
diff changeset
38 #define ALSA_CFGID "ALSA"
1e4d147bdc2b Combine init.c into alsa.c and use a preprocessor define for configdb ID for consistency.
Matti Hamalainen <ccr@tnsp.org>
parents: 2609
diff changeset
39
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
40 extern OutputPlugin op;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
41
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
42 struct alsa_config
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 {
2760
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
44 gchar *pcm_device;
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
45 gint mixer_card;
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
46 gchar *mixer_device;
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
47 gint buffer_time;
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
48 gint period_time;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
49 gboolean debug;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
50 struct
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
51 {
2760
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
52 gint left, right;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
53 } vol;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
54 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
55
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
56 extern struct alsa_config alsa_cfg;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
57
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
58 void alsa_about(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
59 void alsa_configure(void);
3003
8b7a44631121 Add hardware_present probe for a meaningful return code. Probe priority 1.
Tony Vroon <chainsaw@gentoo.org>
parents: 2971
diff changeset
60 gint alsa_hardware_present(void);
2760
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
61 gint alsa_get_mixer(snd_mixer_t **mixer, gint card);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
62 void alsa_save_config(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
63
2760
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
64 void alsa_get_volume(gint *l, gint *r);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
65 void alsa_set_volume(gint l, gint r);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
66
2760
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
67 gint alsa_playing(void);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
68 gint alsa_free(void);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
69 void alsa_write(void *ptr, gint length);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
70 void alsa_close(void);
2760
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
71 void alsa_flush(gint time);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
72 void alsa_pause(gshort p);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
73 gint alsa_open(AFormat fmt, gint rate, gint nch);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
74 gint alsa_get_output_time(void);
35ac6cb80680 Use glib types.
Matti Hamalainen <ccr@tnsp.org>
parents: 2610
diff changeset
75 gint alsa_get_written_time(void);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
76 void alsa_tell(AFormat * fmt, gint * rate, gint * nch);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
77
1753
c730f0212456 Use a GStaticMutex instead of a GMutex to avoid crashing and resource conflicts.
William Pitcock <nenolod@atheme.org>
parents: 1728
diff changeset
78 extern GStaticMutex alsa_mutex;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
79
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
80 #endif