Mercurial > audlegacy-plugins
annotate src/skins/skins_cfg.c @ 2642:c2603047a1a3
add few more config items
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Fri, 23 May 2008 17:17:16 +0200 |
parents | 1aa52f6d547a |
children | fb5375e86a03 |
rev | line source |
---|---|
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
1 /* |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
2 * Audacious - a cross-platform multimedia player |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
3 * Copyright (c) 2008 Tomasz Moń |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
4 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
8 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
13 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
16 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
17 * The Audacious team does not consider modular code linking to |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
18 * Audacious or using our public API to be a derived work. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
19 */ |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
20 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
21 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
22 #include "skins_cfg.h" |
2581 | 23 #include "ui_skin.h" |
2583 | 24 #include "ui_vis.h" |
2642 | 25 #include "ui_main.h" |
26 #include "ui_playlist.h" | |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
27 #include <glib.h> |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
28 #include <stdlib.h> |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
29 #include <audacious/plugin.h> |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
30 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
31 skins_cfg_t config; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
32 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
33 skins_cfg_t skins_default_config = { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
34 .scaled = FALSE, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
35 .autoscroll = TRUE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
36 .always_on_top = FALSE, |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
2592
diff
changeset
|
37 .sticky = FALSE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
38 .scale_factor = 2.0, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
39 .always_show_cb = TRUE, |
2614 | 40 .close_dialog_open = TRUE, |
41 .close_dialog_add = TRUE, | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
42 .skin = NULL, |
2614 | 43 .filesel_path = NULL, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
44 .playlist_visible = FALSE, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
45 .equalizer_visible = FALSE, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
46 .player_visible = TRUE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
47 .player_shaded = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
48 .equalizer_shaded = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
49 .playlist_shaded = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
50 .dim_titlebar = TRUE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
51 .show_wm_decorations = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
52 .easy_move = TRUE, |
2584 | 53 .allow_broken_skins = FALSE, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
54 .warn_about_broken_gtk_engines = TRUE, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
55 .warn_about_win_visibility = TRUE, |
2584 | 56 .disable_inline_gtk = FALSE, |
2583 | 57 .timer_mode = 0, |
58 .vis_type = VIS_ANALYZER, | |
59 .analyzer_mode = ANALYZER_NORMAL, | |
60 .analyzer_type = ANALYZER_BARS, | |
61 .scope_mode = SCOPE_DOT, | |
62 .voiceprint_mode = VOICEPRINT_NORMAL, | |
63 .vu_mode = VU_SMOOTH, | |
64 .vis_refresh = REFRESH_FULL, | |
65 .analyzer_falloff = FALLOFF_FAST, | |
66 .peaks_falloff = FALLOFF_SLOW, | |
67 .player_x = MAINWIN_DEFAULT_POS_X, | |
68 .player_y = MAINWIN_DEFAULT_POS_Y, | |
69 .equalizer_x = EQUALIZER_DEFAULT_POS_X, | |
70 .equalizer_y = EQUALIZER_DEFAULT_POS_Y, | |
71 .playlist_x = PLAYLISTWIN_DEFAULT_POS_X, | |
72 .playlist_y = PLAYLISTWIN_DEFAULT_POS_Y, | |
73 .playlist_width = PLAYLISTWIN_DEFAULT_WIDTH, | |
74 .playlist_height = PLAYLISTWIN_DEFAULT_HEIGHT, | |
75 .playlist_position = 0, | |
76 .mouse_change = 8, /* mouse wheel scroll step */ | |
77 .scroll_pl_by = 3, | |
78 .colorize_r = 255, .colorize_g = 255, .colorize_b = 255, | |
79 .snap_distance = 10, | |
80 .snap_windows = TRUE, | |
81 .save_window_position = TRUE, | |
2584 | 82 .analyzer_peaks = TRUE, |
2586 | 83 .twoway_scroll = TRUE, /* use back and forth scroll */ |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
84 .mainwin_use_bitmapfont = TRUE, |
2606 | 85 .eq_scaled_linked = TRUE, |
2614 | 86 .use_xmms_style_fileselector = FALSE, |
2620 | 87 .show_numbers_in_pl = TRUE, |
88 .show_separator_in_pl = TRUE, | |
2642 | 89 .playlist_font = NULL, |
90 .mainwin_font = NULL, | |
91 .show_filepopup_for_tuple = TRUE, | |
92 .filepopup_delay = 20, /* delay until the filepopup comes up */ | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
93 }; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
94 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
95 typedef struct skins_cfg_boolent_t { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
96 char const *be_vname; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
97 gboolean *be_vloc; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
98 gboolean be_wrt; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
99 } skins_cfg_boolent; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
100 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
101 static skins_cfg_boolent skins_boolents[] = { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
102 {"always_show_cb", &config.always_show_cb, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
103 {"always_on_top", &config.always_on_top, TRUE}, |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
2592
diff
changeset
|
104 {"sticky", &config.sticky, TRUE}, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
105 {"always_show_cb", &config.always_show_cb, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
106 {"scaled", &config.scaled, TRUE}, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
107 {"autoscroll_songname", &config.autoscroll, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
108 {"equalizer_visible", &config.equalizer_visible, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
109 {"playlist_visible", &config.playlist_visible, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
110 {"player_visible", &config.player_visible, TRUE}, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
111 {"player_shaded", &config.player_shaded, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
112 {"equalizer_shaded", &config.equalizer_shaded, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
113 {"playlist_shaded", &config.playlist_shaded, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
114 {"dim_titlebar", &config.dim_titlebar, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
115 {"show_wm_decorations", &config.show_wm_decorations, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
116 {"easy_move", &config.easy_move, TRUE}, |
2584 | 117 {"allow_broken_skins", &config.allow_broken_skins, TRUE}, |
118 {"disable_inline_gtk", &config.disable_inline_gtk, TRUE}, | |
2583 | 119 {"snap_windows", &config.snap_windows, TRUE}, |
120 {"save_window_positions", &config.save_window_position, TRUE}, | |
2584 | 121 {"analyzer_peaks", &config.analyzer_peaks, TRUE}, |
2586 | 122 {"twoway_scroll", &config.twoway_scroll, TRUE}, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
123 {"warn_about_win_visibility", &config.warn_about_win_visibility, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
124 {"warn_about_broken_gtk_engines", &config.warn_about_broken_gtk_engines, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
125 {"mainwin_use_bitmapfont", &config.mainwin_use_bitmapfont, TRUE}, |
2606 | 126 {"eq_scaled_linked", &config.eq_scaled_linked, TRUE}, |
2620 | 127 {"show_numbers_in_pl", &config.show_numbers_in_pl, TRUE}, |
128 {"show_separator_in_pl", &config.show_separator_in_pl, TRUE}, | |
2642 | 129 {"show_filepopup_for_tuple", &config.show_filepopup_for_tuple, TRUE}, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
130 }; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
131 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
132 static gint ncfgbent = G_N_ELEMENTS(skins_boolents); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
133 |
2583 | 134 typedef struct skins_cfg_nument_t { |
135 char const *ie_vname; | |
136 gint *ie_vloc; | |
137 gboolean ie_wrt; | |
138 } skins_cfg_nument; | |
139 | |
140 static skins_cfg_nument skins_numents[] = { | |
141 {"player_x", &config.player_x, TRUE}, | |
142 {"player_y", &config.player_y, TRUE}, | |
143 {"timer_mode", &config.timer_mode, TRUE}, | |
144 {"vis_type", &config.vis_type, TRUE}, | |
145 {"analyzer_mode", &config.analyzer_mode, TRUE}, | |
146 {"analyzer_type", &config.analyzer_type, TRUE}, | |
147 {"scope_mode", &config.scope_mode, TRUE}, | |
148 {"vu_mode", &config.vu_mode, TRUE}, | |
149 {"voiceprint_mode", &config.voiceprint_mode, TRUE}, | |
150 {"vis_refresh_rate", &config.vis_refresh, TRUE}, | |
151 {"analyzer_falloff", &config.analyzer_falloff, TRUE}, | |
152 {"peaks_falloff", &config.peaks_falloff, TRUE}, | |
153 {"playlist_x", &config.playlist_x, TRUE}, | |
154 {"playlist_y", &config.playlist_y, TRUE}, | |
155 {"playlist_width", &config.playlist_width, TRUE}, | |
156 {"playlist_height", &config.playlist_height, TRUE}, | |
157 {"playlist_position", &config.playlist_position, TRUE}, | |
158 {"equalizer_x", &config.equalizer_x, TRUE}, | |
159 {"equalizer_y", &config.equalizer_y, TRUE}, | |
160 {"mouse_wheel_change", &config.mouse_change, TRUE}, | |
161 {"scroll_pl_by", &config.scroll_pl_by, TRUE}, | |
162 {"colorize_r", &config.colorize_r, TRUE}, | |
163 {"colorize_g", &config.colorize_g, TRUE}, | |
164 {"colorize_b", &config.colorize_b, TRUE}, | |
165 {"snap_distance", &config.snap_distance, TRUE}, | |
2642 | 166 {"filepopup_delay", &config.filepopup_delay, TRUE}, |
2583 | 167 }; |
168 | |
169 static gint ncfgient = G_N_ELEMENTS(skins_numents); | |
170 | |
2642 | 171 typedef struct skins_cfg_strent_t { |
172 char const *se_vname; | |
173 char **se_vloc; | |
174 gboolean se_wrt; | |
175 } skins_cfg_strent; | |
176 | |
177 static skins_cfg_strent skins_strents[] = { | |
178 {"playlist_font", &config.playlist_font, TRUE}, | |
179 {"mainwin_font", &config.mainwin_font, TRUE}, | |
180 {"skin", &config.skin, FALSE}, | |
181 }; | |
182 | |
183 static gint ncfgsent = G_N_ELEMENTS(skins_strents); | |
184 | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
185 void skins_cfg_free() { |
2642 | 186 gint i; |
187 for (i = 0; i < ncfgsent; ++i) { | |
188 if (*(skins_strents[i].se_vloc) != NULL) { | |
189 g_free( *(skins_strents[i].se_vloc) ); | |
190 *(skins_strents[i].se_vloc) = NULL; | |
191 } | |
192 } | |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
193 } |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
194 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
195 void skins_cfg_load() { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
196 mcs_handle_t *cfgfile = aud_cfg_db_open(); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
197 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
198 memcpy(&config, &skins_default_config, sizeof(skins_cfg_t)); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
199 int i; |
2635
b990e7eb0c25
save config on plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2620
diff
changeset
|
200 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
201 for (i = 0; i < ncfgbent; ++i) { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
202 aud_cfg_db_get_bool(cfgfile, "skins", |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
203 skins_boolents[i].be_vname, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
204 skins_boolents[i].be_vloc); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
205 } |
2635
b990e7eb0c25
save config on plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2620
diff
changeset
|
206 |
2583 | 207 for (i = 0; i < ncfgient; ++i) { |
208 aud_cfg_db_get_int(cfgfile, "skins", | |
209 skins_numents[i].ie_vname, | |
210 skins_numents[i].ie_vloc); | |
211 } | |
2581 | 212 |
2642 | 213 for (i = 0; i < ncfgsent; ++i) { |
214 aud_cfg_db_get_string(cfgfile, "skins", | |
215 skins_strents[i].se_vname, | |
216 skins_strents[i].se_vloc); | |
217 } | |
218 | |
219 if (!config.mainwin_font) | |
220 config.mainwin_font = g_strdup(MAINWIN_DEFAULT_FONT); | |
221 | |
222 if (!config.playlist_font) | |
223 config.playlist_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT); | |
2573
c0b08527b121
allow loading compressed skins
Tomasz Mon <desowin@gmail.com>
parents:
2572
diff
changeset
|
224 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
225 if (!aud_cfg_db_get_float(cfgfile, "skins", "scale_factor", &(config.scale_factor))) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
226 config.scale_factor = 2.0; |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
227 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
228 aud_cfg_db_close(cfgfile); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
229 } |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
230 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
231 |
2635
b990e7eb0c25
save config on plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2620
diff
changeset
|
232 void skins_cfg_save() { |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
233 mcs_handle_t *cfgfile = aud_cfg_db_open(); |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
234 |
2636 | 235 if (aud_active_skin != NULL) { |
236 if (aud_active_skin->path) | |
237 aud_cfg_db_set_string(cfgfile, "skins", "skin", aud_active_skin->path); | |
238 else | |
239 aud_cfg_db_unset_key(cfgfile, "skins", "skin"); | |
240 } | |
241 | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
242 int i; |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
243 |
2642 | 244 for (i = 0; i < ncfgsent; ++i) { |
245 if (skins_strents[i].se_wrt) | |
246 aud_cfg_db_set_string(cfgfile, "skins", | |
247 skins_strents[i].se_vname, | |
248 *skins_strents[i].se_vloc); | |
249 } | |
250 | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
251 for (i = 0; i < ncfgbent; ++i) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
252 if (skins_boolents[i].be_wrt) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
253 aud_cfg_db_set_bool(cfgfile, "skins", |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
254 skins_boolents[i].be_vname, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
255 *skins_boolents[i].be_vloc); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
256 |
2583 | 257 for (i = 0; i < ncfgient; ++i) |
258 if (skins_numents[i].ie_wrt) | |
259 aud_cfg_db_set_int(cfgfile, "skins", | |
260 skins_numents[i].ie_vname, | |
261 *skins_numents[i].ie_vloc); | |
262 | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
263 aud_cfg_db_close(cfgfile); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
264 } |