annotate src/alsa/alsa.c @ 1659:53adc480f9a7

fixed some more plugins
author mf0102 <0102@gmx.at>
date Fri, 07 Sep 2007 15:14:36 +0200
parents 67b5bf777a38
children c730f0212456
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 Matthieu Sozeau
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * 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
5 * 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
6 * 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
7 * (at your option) any later version.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 * 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
10 * 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 * GNU General Public License for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 * 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
15 * 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
16 * 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
17 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 #include "alsa.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20 #include <stdlib.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22 OutputPlugin alsa_op =
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23 {
1630
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
24 .description = "ALSA Output Plugin",
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
25 .init = alsa_init,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
26 .cleanup = alsa_cleanup,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
27 .about = alsa_about,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
28 .configure = alsa_configure,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
29 .get_volume = alsa_get_volume,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
30 .set_volume = alsa_set_volume,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
31 .open_audio = alsa_open,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
32 .write_audio = alsa_write,
1632
67b5bf777a38 fix C99 initialisations
William Pitcock <nenolod@atheme.org>
parents: 1630
diff changeset
33 .close_audio = alsa_close,
1630
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
34 .flush = alsa_flush,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
35 .pause = alsa_pause,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
36 .buffer_free = alsa_free,
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
37 .buffer_playing = alsa_playing,
1632
67b5bf777a38 fix C99 initialisations
William Pitcock <nenolod@atheme.org>
parents: 1630
diff changeset
38 .output_time = alsa_get_output_time,
67b5bf777a38 fix C99 initialisations
William Pitcock <nenolod@atheme.org>
parents: 1630
diff changeset
39 .written_time = alsa_get_written_time,
1630
e669c0e6a1f3 alsa: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
40 .tell_audio = alsa_tell
0
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
1084
f6fab42de168 [svn] - alsa: commit to plugin API v2
nenolod
parents: 12
diff changeset
43 OutputPlugin *alsa_oplist[] = { &alsa_op, NULL };
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
44
1395
761e17b23e0c added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 1111
diff changeset
45 DECLARE_PLUGIN(alsa, NULL, NULL, NULL, alsa_oplist, NULL, NULL, NULL, NULL)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
46
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
47 void alsa_cleanup(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
48 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
49 if (alsa_cfg.pcm_device) {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
50 free(alsa_cfg.pcm_device);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
51 alsa_cfg.pcm_device = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
52 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
53
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
54 if (alsa_cfg.mixer_device) {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
55 free(alsa_cfg.mixer_device);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
56 alsa_cfg.mixer_device = NULL;
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
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
59 /* release our mutex */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
60 g_mutex_free(alsa_mutex);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
61 alsa_mutex = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
62 }