annotate src/rootvis/config_backend.c @ 3148:d443c917dab9

Remove stale library variable from Makefile, as pointed out by RafaŠČ MuŤ÷yŠČo on #audacious.
author Tony Vroon <chainsaw@gentoo.org>
date Mon, 11 May 2009 17:32:04 +0100
parents 3134a0987162
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
1 #include <string.h>
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2523
diff changeset
2 #include <audlegacy/plugin.h>
2501
7b284f323ad8 Include cleanups, part #6.
Matti Hamalainen <ccr@tnsp.org>
parents: 2124
diff changeset
3 #include "rootvis.h"
7b284f323ad8 Include cleanups, part #6.
Matti Hamalainen <ccr@tnsp.org>
parents: 2124
diff changeset
4 #include "config.h"
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
5
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
6 extern void config_def_init(void);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
7 extern void config_frontend_init(void);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
8
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
9 void color_quad2arr(unsigned char* res, char* quad) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
10 if (sscanf(quad, "#%2hhx%2hhx%2hhx%2hhx", &res[0], &res[1], &res[2], &res[3]) != 4)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
11 fprintf(stderr, "Color value %s could not be recognized as #rrggbbaa, ranging from #00000000 to #FFFFFFFF\n", quad);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
12 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
13
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
14 char* color_arr2quad(unsigned char* src, char* quad) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
15 sprintf(quad, "#%2.2hhx%2.2hhx%2.2hhx%2.2hhx", src[0], src[1], src[2], src[3]);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
16 return quad;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
17 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
18
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
19 void cval_setdefault(struct config_value val)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
20 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
21 switch (val.type)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
22 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
23 case BOOLN:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
24 case INT:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
25 *val.vali.var = val.vali.def_value;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
26 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
27 case FLOAT:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
28 *val.valf.var = val.valf.def_value;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
29 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
30 case TEXT:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
31 strcpy(*val.valt.var, val.valt.def_value);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
32 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
33 case COLOR:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
34 color_quad2arr(val.valc.var, val.valc.def_value);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
35 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
36 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
37 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
38
2523
769e17da93dd Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2501
diff changeset
39 void cval_writefile(struct config_value val, mcs_handle_t *fp, char* sect)
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
40 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
41 switch (val.type)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
42 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
43 case BOOLN:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
44 case INT:
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
45 aud_cfg_db_set_int(fp, sect, val.name, *val.vali.var);
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
46 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
47 case FLOAT:
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
48 aud_cfg_db_set_float(fp, sect, val.name, *val.valf.var);
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
49 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
50 case TEXT:
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
51 aud_cfg_db_set_string(fp, sect, val.name, *val.valt.var);
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
52 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
53 case COLOR:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
54 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
55 char colortmp[10];
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
56 aud_cfg_db_set_string(fp, sect, val.name, color_arr2quad(val.valc.var, colortmp));
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
57 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
58 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
59 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
60 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
61
2523
769e17da93dd Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2501
diff changeset
62 void cval_readfile(struct config_value val, mcs_handle_t *fp, char* sect)
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
63 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
64 switch (val.type)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
65 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
66 case BOOLN:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
67 case INT:
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
68 if (!(aud_cfg_db_get_int(fp, sect, val.name, val.vali.var)))
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
69 cval_writefile(val, fp, sect);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
70 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
71 case FLOAT:
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
72 if (!(aud_cfg_db_get_float(fp, sect, val.name, val.valf.var)))
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
73 cval_writefile(val, fp, sect);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
74 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
75 case TEXT:
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
76 if (!(aud_cfg_db_get_string(fp, sect, val.name, val.valt.var)))
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
77 cval_writefile(val, fp, sect);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
78 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
79 case COLOR:
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
80 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
81 char* colortmp = NULL;
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
82 if (!(aud_cfg_db_get_string(fp, sect, val.name, &colortmp)))
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
83 cval_writefile(val, fp, sect);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
84 else color_quad2arr(val.valc.var, colortmp);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
85 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
86 break;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
87 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
88 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
89
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
90 // this parses ~/.xmms/config
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
91 // if a setting is not found, it is created to make it possible to edit the default settings
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
92 // after the configuration dialogue is finished, this won't be necessary any more
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
93 void config_read(int number) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
94 int i, j;
2523
769e17da93dd Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2501
diff changeset
95 mcs_handle_t *fp;
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
96
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
97 fp = aud_cfg_db_open();
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
98
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
99 print_status("Reading configuration");
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
100
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
101 if (number == 2)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
102 for (i = 0; i < Cmain.count; ++i)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
103 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
104 cval_setdefault(Cmain.def[i]);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
105 cval_readfile(Cmain.def[i], fp, "rootvis");
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
106 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
107
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
108 for (j = 0; j < 2; ++j)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
109 if ((number == j)||(number == 2))
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
110 for (i = 0; i < Cchannel[j].count; ++i)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
111 {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
112 cval_setdefault(Cchannel[j].def[i]);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
113 cval_readfile(Cchannel[j].def[i], fp, (j == 0 ? "rootvis" : "rootvis2"));
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
114 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
115
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
116 aud_cfg_db_close(fp);
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
117 print_status("Configuration finished");
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
118 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
119
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
120 void config_write(int number) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
121 int i, j;
2523
769e17da93dd Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2501
diff changeset
122 mcs_handle_t *fp;
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
123
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
124 print_status("Writing configuration");
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
125 fp = aud_cfg_db_open();
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
126
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
127 if (number == 2)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
128 for (i = 0; i < Cmain.count; ++i)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
129 cval_writefile(Cmain.def[i], fp, "rootvis");
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
130
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
131 for (j = 0; j < 2; ++j)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
132 if ((number == j)||(number == 2))
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
133 for (i = 0; i < Cchannel[j].count; ++i)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
134 cval_writefile(Cchannel[j].def[i], fp, (j == 0 ? "rootvis" : "rootvis2"));
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
135
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 900
diff changeset
136 aud_cfg_db_close(fp);
900
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
137 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
138
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
139 void config_revert(int number) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
140 /* as the configs aren't saved in a thread save way, we have to lock while we read them */
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
141 threads_lock();
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
142 config_read(number);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
143
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
144 // set the right change bits, according to wether we change channel 0, 1 or both (2)
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
145 if (number == 2) number = 15;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
146 else number = 3 + number*9;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
147 threads_unlock(number);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
148 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
149
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
150 void config_save(int number) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
151 threads_lock();
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
152 config_write(number);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
153 threads_unlock(0);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
154 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
155
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
156 void config_init(void) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
157 static int initialized = 0;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
158 if (initialized == 0) {
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
159 print_status("First initialization");
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
160
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
161 conf.geo[0].display = malloc(256);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
162 conf.geo[1].display = malloc(256);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
163
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
164 config_def_init();
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
165 config_frontend_init();
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
166
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
167 config_read(2);
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
168
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
169 initialized++;
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
170 }
d985f0dcdeb0 [svn] - add a starting point for xmms-rootvis port. giacomo will need to
nenolod
parents:
diff changeset
171 }