0
|
1 /* XMMS - ALSA output plugin
|
|
2 * Copyright (C) 2001-2003 Matthieu Sozeau
|
|
3 * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas,
|
|
4 * Thomas Nilsson and 4Front Technologies
|
|
5 * Copyright (C) 1999-2004 Håvard Kvålen
|
|
6 *
|
|
7 * This program is free software; you can redistribute it and/or modify
|
|
8 * it under the terms of the GNU General Public License as published by
|
|
9 * the Free Software Foundation; either version 2 of the License, or
|
|
10 * (at your option) any later version.
|
|
11 *
|
|
12 * This program is distributed in the hope that it will be useful,
|
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 * GNU General Public License for more details.
|
|
16 *
|
|
17 * You should have received a copy of the GNU General Public License
|
|
18 * along with this program; if not, write to the Free Software
|
|
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
20 */
|
|
21 #ifndef ALSA_H
|
|
22 #define ALSA_H
|
|
23
|
|
24 #include "config.h"
|
|
25
|
|
26 #include <libaudacious/util.h>
|
|
27 #include <audacious/plugin.h>
|
|
28
|
|
29 #define ALSA_PCM_NEW_HW_PARAMS_API
|
|
30 #define ALSA_PCM_NEW_SW_PARAMS_API
|
|
31 #include <alsa/asoundlib.h>
|
|
32 #include <alsa/pcm_plugin.h>
|
|
33
|
|
34 #include <gtk/gtk.h>
|
|
35
|
|
36 #ifdef WORDS_BIGENDIAN
|
|
37 # define IS_BIG_ENDIAN TRUE
|
|
38 #else
|
|
39 # define IS_BIG_ENDIAN FALSE
|
|
40 #endif
|
|
41
|
|
42 extern OutputPlugin op;
|
|
43
|
|
44 struct alsa_config
|
|
45 {
|
|
46 char *pcm_device;
|
|
47 int mixer_card;
|
|
48 char *mixer_device;
|
|
49 int buffer_time;
|
|
50 int period_time;
|
|
51 int thread_buffer_time;
|
|
52 gboolean debug;
|
|
53 gboolean multi_thread;
|
|
54 gboolean mmap;
|
|
55 struct
|
|
56 {
|
|
57 int left, right;
|
|
58 } vol;
|
|
59 gboolean soft_volume;
|
|
60 };
|
|
61
|
|
62 extern struct alsa_config alsa_cfg;
|
|
63
|
|
64 void alsa_init(void);
|
|
65 void alsa_about(void);
|
|
66 void alsa_configure(void);
|
|
67 int alsa_get_mixer(snd_mixer_t **mixer, int card);
|
|
68 void alsa_save_config(void);
|
|
69
|
|
70 void alsa_get_volume(int *l, int *r);
|
|
71 void alsa_set_volume(int l, int r);
|
|
72
|
|
73 int alsa_playing(void);
|
|
74 int alsa_free(void);
|
|
75 void alsa_write(void *ptr, int length);
|
|
76 void alsa_close(void);
|
|
77 void alsa_flush(int time);
|
|
78 void alsa_pause(short p);
|
|
79 int alsa_open(AFormat fmt, int rate, int nch);
|
|
80 int alsa_get_output_time(void);
|
|
81 int alsa_get_written_time(void);
|
|
82
|
|
83 #endif
|