0
|
1 /* BMP - Cross-platform multimedia player
|
|
2 * Copyright (C) 2003-2004 BMP development team.
|
|
3 *
|
|
4 * Based on XMMS:
|
|
5 * Copyright (C) 1998-2003 XMMS development team.
|
|
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
|
|
22 #include <glib.h>
|
|
23 #include <string.h>
|
|
24 #include <libaudacious/configdb.h>
|
|
25 #include "OSS.h"
|
|
26
|
|
27
|
|
28 OSSConfig oss_cfg;
|
|
29
|
|
30 void
|
|
31 oss_init(void)
|
|
32 {
|
|
33 ConfigDb *db;
|
|
34
|
|
35 memset(&oss_cfg, 0, sizeof(OSSConfig));
|
|
36
|
|
37 oss_cfg.audio_device = 0;
|
|
38 oss_cfg.mixer_device = 0;
|
|
39 oss_cfg.buffer_size = 3000;
|
|
40 oss_cfg.prebuffer = 25;
|
|
41 oss_cfg.use_alt_audio_device = FALSE;
|
|
42 oss_cfg.alt_audio_device = NULL;
|
|
43 oss_cfg.use_master = 0;
|
|
44
|
|
45 if ((db = bmp_cfg_db_open())) {
|
|
46 bmp_cfg_db_get_int(db, "OSS", "audio_device", &oss_cfg.audio_device);
|
|
47 bmp_cfg_db_get_int(db, "OSS", "mixer_device", &oss_cfg.mixer_device);
|
|
48 bmp_cfg_db_get_int(db, "OSS", "buffer_size", &oss_cfg.buffer_size);
|
|
49 bmp_cfg_db_get_int(db, "OSS", "prebuffer", &oss_cfg.prebuffer);
|
|
50 bmp_cfg_db_get_bool(db, "OSS", "use_master", &oss_cfg.use_master);
|
|
51 bmp_cfg_db_get_bool(db, "OSS", "use_alt_audio_device",
|
|
52 &oss_cfg.use_alt_audio_device);
|
|
53 bmp_cfg_db_get_string(db, "OSS", "alt_audio_device",
|
|
54 &oss_cfg.alt_audio_device);
|
|
55 bmp_cfg_db_get_bool(db, "OSS", "use_alt_mixer_device",
|
|
56 &oss_cfg.use_alt_mixer_device);
|
|
57 bmp_cfg_db_get_string(db, "OSS", "alt_mixer_device",
|
|
58 &oss_cfg.alt_mixer_device);
|
|
59 bmp_cfg_db_close(db);
|
|
60 }
|
|
61 }
|