comparison src/Output/alsa/alsa.c @ 0:13389e613d67 trunk

[svn] - initial import of audacious-plugins tree (lots to do)
author nenolod
date Mon, 18 Sep 2006 01:11:49 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13389e613d67
1 /* XMMS - ALSA output plugin
2 * Copyright (C) 2001 Matthieu Sozeau
3 *
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.
8 *
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.
13 *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #include "alsa.h"
20 #include <stdlib.h>
21
22 OutputPlugin alsa_op =
23 {
24 NULL,
25 NULL,
26 NULL,
27 alsa_init,
28 alsa_cleanup,
29 alsa_about,
30 alsa_configure,
31 alsa_get_volume,
32 alsa_set_volume,
33 alsa_open,
34 alsa_write,
35 alsa_close,
36 alsa_flush,
37 alsa_pause,
38 alsa_free,
39 alsa_playing,
40 alsa_get_output_time,
41 alsa_get_written_time,
42 alsa_tell
43 };
44
45 OutputPlugin *get_oplugin_info(void)
46 {
47 alsa_op.description = g_strdup_printf(_("ALSA %s output plugin"), VERSION);
48 return &alsa_op;
49 }
50
51
52 void alsa_cleanup(void)
53 {
54 g_free(alsa_op.description);
55 alsa_op.description = NULL;
56
57 if (alsa_cfg.pcm_device) {
58 free(alsa_cfg.pcm_device);
59 alsa_cfg.pcm_device = NULL;
60 }
61
62 if (alsa_cfg.mixer_device) {
63 free(alsa_cfg.mixer_device);
64 alsa_cfg.mixer_device = NULL;
65 }
66
67 /* release our mutex */
68 g_mutex_free(alsa_mutex);
69 alsa_mutex = NULL;
70 }