File: init.c

package info (click to toggle)
xmms 1.0.1-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,180 kB
  • ctags: 3,923
  • sloc: ansic: 38,352; sh: 8,294; asm: 398; makefile: 387
file content (46 lines) | stat: -rw-r--r-- 1,458 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*      xmms - esound output plugin
 *    Copyright (C) 1999      Galex Yen
 *      
 *      this program is free software
 *      
 *      Description:
 *              This program is an output plugin for xmms v0.9 or greater.
 *              The program uses the esound daemon to output audio in order
 *              to allow more than one program to play audio on the same
 *              device at the same time.
 *
 *              Contains code Copyright (C) 1998-1999 Mikael Alm, Olle Hallnas,
 *              Thomas Nillson and 4Front Technologies
 *
 */

#include "esdout.h"
#include "libxmms/configfile.h"

ESDConfig esd_cfg;
esd_info_t *all_info;
esd_player_info_t *player_info;

void esdout_init(void)
{
	ConfigFile *cfgfile;
	gchar *filename;

	memset(&esd_cfg, 0, sizeof (ESDConfig));
	esd_cfg.port = ESD_DEFAULT_PORT;
	esd_cfg.buffer_size = 3000;
	esd_cfg.prebuffer = 25;

	filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL);
	if ((cfgfile = xmms_cfg_open_file(filename)))
	{
		xmms_cfg_read_boolean(cfgfile, "ESD", "use_remote", &esd_cfg.use_remote);
		xmms_cfg_read_string(cfgfile, "ESD", "remote_host", &esd_cfg.server);
		xmms_cfg_read_int(cfgfile, "ESD", "remote_port", &esd_cfg.port);
		xmms_cfg_read_int(cfgfile, "ESD", "buffer_size", &esd_cfg.buffer_size);
		xmms_cfg_read_int(cfgfile, "ESD", "prebuffer", &esd_cfg.prebuffer);
		xmms_cfg_free(cfgfile);
	}
	if (!esd_cfg.server)
		esd_cfg.server = g_strdup("localhost");
}