Mercurial > audlegacy
annotate src/audacious/audconfig.c @ 4491:42575ed86c9f
Set eggsm flags conditionally.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 21 Apr 2008 07:40:14 +0300 |
parents | 3638e4151bae |
children | 246244ead30e |
rev | line source |
---|---|
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
1 /* Audacious - Cross-platform multimedia player |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
2 * Copyright (C) 2005-2008 Audacious development team. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
3 * |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
4 * Based on BMP: |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
5 * Copyright (C) 2003-2004 BMP development team. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
6 * |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
7 * Based on XMMS: |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
8 * Copyright (C) 1998-2003 XMMS development team. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
9 * |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
12 * the Free Software Foundation; under version 3 of the License. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
13 * |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
17 * GNU General Public License for more details. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
18 * |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
19 * You should have received a copy of the GNU General Public License |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses>. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
21 * |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
22 * The Audacious team does not consider modular code linking to |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
23 * Audacious or using our public API to be a derived work. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
24 */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
25 |
4358 | 26 #ifdef HAVE_CONFIG_H |
27 # include "config.h" | |
28 #endif | |
29 | |
30 #ifdef USE_SRC | |
31 # include <samplerate.h> | |
32 #endif | |
33 | |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
34 #include "effect.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
35 #include "general.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
36 #include "playback.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
37 #include "pluginenum.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
38 #include "skin.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
39 #include "ui_equalizer.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
40 #include "ui_playlist.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
41 #include "ui_skinned_window.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
42 #include "ui_vis.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
43 #include "util.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
44 #include "visualization.h" |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
45 |
4404
7513318719a7
Pfft, we are Audacious and this is SPARTA!
Matti Hamalainen <ccr@tnsp.org>
parents:
4374
diff
changeset
|
46 #include "audconfig.h" |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
47 |
4411
628926f505f8
BmpConfig -> AudConfig, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
4404
diff
changeset
|
48 AudConfig aud_default_config = { |
4456 | 49 .player_x = MAINWIN_DEFAULT_POS_X, |
50 .player_y = MAINWIN_DEFAULT_POS_Y, | |
51 .equalizer_x = EQUALIZER_DEFAULT_POS_X, | |
52 .equalizer_y = EQUALIZER_DEFAULT_POS_Y, | |
53 .playlist_x = PLAYLISTWIN_DEFAULT_POS_X, | |
54 .playlist_y = PLAYLISTWIN_DEFAULT_POS_Y, | |
55 .playlist_width = PLAYLISTWIN_DEFAULT_WIDTH, | |
56 .playlist_height = PLAYLISTWIN_DEFAULT_HEIGHT, | |
57 .snap_distance = 10, | |
58 .use_realtime = FALSE, | |
59 .shuffle = FALSE, | |
60 .repeat = FALSE, | |
61 .scaled = FALSE, | |
62 .autoscroll = TRUE, | |
63 .analyzer_peaks = TRUE, | |
64 .equalizer_autoload = FALSE, | |
65 .easy_move = FALSE, | |
66 .equalizer_active = FALSE, | |
67 .playlist_visible = FALSE, | |
68 .equalizer_visible = FALSE, | |
69 .player_visible = TRUE, | |
70 .player_shaded = FALSE, | |
71 .playlist_shaded = FALSE, | |
72 .equalizer_shaded = FALSE, | |
73 .allow_multiple_instances = FALSE, | |
74 .always_show_cb = TRUE, | |
75 .convert_underscore = TRUE, | |
76 .convert_twenty = TRUE, /* convert %20 */ | |
77 .convert_slash = TRUE, | |
78 .show_numbers_in_pl = TRUE, | |
79 .snap_windows = TRUE, | |
80 .save_window_position = TRUE, | |
81 .dim_titlebar = TRUE, | |
82 .get_info_on_load = FALSE, /* get playlist info on load */ | |
83 .get_info_on_demand = TRUE, /* get playlist info on demand */ | |
84 .eq_scaled_linked = TRUE, | |
85 .sort_jump_to_file = FALSE, | |
86 .use_eplugins = FALSE, /* use effect plugins */ | |
87 .always_on_top = FALSE, | |
88 .sticky = FALSE, | |
89 .no_playlist_advance = FALSE, | |
90 .stopaftersong = FALSE, | |
91 .refresh_file_list = TRUE, | |
92 .use_pl_metadata = TRUE, | |
93 .warn_about_win_visibility = TRUE, | |
94 .use_backslash_as_dir_delimiter = FALSE, | |
95 .random_skin_on_play = FALSE, | |
96 .use_fontsets = FALSE, | |
97 .mainwin_use_bitmapfont = TRUE, | |
98 .custom_cursors = TRUE, | |
99 .allow_broken_skins = FALSE, | |
100 .close_dialog_open = TRUE, | |
101 .close_dialog_add = TRUE, | |
102 .equalizer_preamp = 0.0, | |
103 .equalizer_bands = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, | |
104 .scale_factor = 1.2, /* GUI scale factor, hardcoded for testing purposes --majeru */ | |
105 .skin = NULL, | |
106 .outputplugin = NULL, | |
107 .filesel_path = NULL, | |
108 .playlist_path = NULL, | |
109 .playlist_font = NULL, | |
110 .mainwin_font = NULL, | |
111 .disabled_iplugins = NULL, /* disabled input plugins */ | |
112 .enabled_gplugins = NULL, /* enabled general plugins */ | |
113 .enabled_vplugins = NULL, /* enabled visualization plugins */ | |
114 .enabled_eplugins = NULL, /* enabled effect plugins */ | |
115 .enabled_dplugins = NULL, /* enabled discovery plugins */ | |
116 .eqpreset_default_file = NULL, | |
117 .eqpreset_extension = NULL, | |
118 .url_history = NULL, | |
119 .timer_mode = 0, | |
120 .vis_type = VIS_ANALYZER, | |
121 .analyzer_mode = ANALYZER_NORMAL, | |
122 .analyzer_type = ANALYZER_BARS, | |
123 .scope_mode = SCOPE_DOT, | |
124 .voiceprint_mode = VOICEPRINT_NORMAL, | |
125 .vu_mode = VU_SMOOTH, | |
126 .vis_refresh = REFRESH_FULL, | |
127 .analyzer_falloff = FALLOFF_FAST, | |
128 .peaks_falloff = FALLOFF_SLOW, | |
129 .playlist_position = 0, | |
130 .pause_between_songs_time = 2, | |
131 .pause_between_songs = FALSE, | |
132 .show_wm_decorations = FALSE, | |
133 .mouse_change = 8, /* mouse wheel scroll step */ | |
134 .playlist_transparent = FALSE, | |
135 .eq_extra_filtering = TRUE, | |
136 .scroll_pl_by = 3, | |
137 .resume_playback_on_startup = FALSE, | |
138 .resume_playback_on_startup_time = -1, | |
139 .show_separator_in_pl = TRUE, | |
140 .chardet_detector = NULL, | |
141 .chardet_fallback = NULL, | |
142 .output_buffer_size = 500, | |
143 .playlist_detect = TRUE, /* whether or not to postpone format detection on initial add */ | |
144 .show_filepopup_for_tuple = TRUE, | |
145 .cover_name_include = NULL, /* words identifying covers */ | |
146 .cover_name_exclude = NULL, /* words that might not show up in cover names */ | |
147 .recurse_for_cover = FALSE, | |
148 .recurse_for_cover_depth = 0, | |
149 .session_uri_base = NULL, /* default session uri base (non-NULL = custom session uri base) */ | |
150 .filepopup_pixelsize = 150, /* short side length of the picture in the filepopup */ | |
151 .filepopup_delay = 20, /* delay until the filepopup comes up */ | |
152 .use_file_cover = FALSE, /* use filename.jpg for coverart */ | |
153 .use_xmms_style_fileselector = FALSE, | |
154 .use_extension_probing = TRUE, | |
155 .colorize_r = 255, .colorize_g = 255, .colorize_b = 255, | |
156 .filepopup_showprogressbar = TRUE, | |
157 .close_jtf_dialog = TRUE, /* close jtf dialog on jump */ | |
158 .twoway_scroll = TRUE, /* use back and forth scroll */ | |
159 .software_volume_control = FALSE, | |
160 .warn_about_broken_gtk_engines = TRUE, | |
161 .disable_inline_gtk = FALSE, /* disable inline themes */ | |
162 .remember_jtf_entry = TRUE, | |
163 .output_bit_depth = 16, | |
164 .enable_replay_gain = TRUE, | |
165 .enable_clipping_prevention = TRUE, | |
166 .replay_gain_track = TRUE, /* track mode */ | |
167 .replay_gain_album = FALSE, /* album mode */ | |
168 .enable_adaptive_scaler = FALSE, | |
169 .replay_gain_preamp = 0.0, | |
170 .default_gain = -9.0, | |
171 .saved_volume = 0x6464, /* for both channels; 0x64=100 */ | |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
172 #ifdef USE_SRC |
4456 | 173 .enable_src = FALSE, /* enable resampling */ |
174 .src_rate = 48000, /* samplerate */ | |
175 .src_type = SRC_SINC_BEST_QUALITY, /* default interpolation method */ | |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
176 #endif |
4456 | 177 .bypass_dsp = FALSE, |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
178 }; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
179 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
180 typedef struct aud_cfg_boolent_t { |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
181 char const *be_vname; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
182 gboolean *be_vloc; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
183 gboolean be_wrt; |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
184 } aud_cfg_boolent; |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
185 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
186 typedef struct aud_cfg_nument_t { |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
187 char const *ie_vname; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
188 gint *ie_vloc; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
189 gboolean ie_wrt; |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
190 } aud_cfg_nument; |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
191 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
192 typedef struct aud_cfg_strent_t { |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
193 char const *se_vname; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
194 char **se_vloc; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
195 gboolean se_wrt; |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
196 } aud_cfg_strent; |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
197 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
198 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
199 /* XXX: case-sensitivity is bad for lazy nenolods. :( -nenolod */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
200 static gchar *pl_candidates[] = { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
201 PLUGIN_FILENAME("ALSA"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
202 PLUGIN_FILENAME("coreaudio"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
203 PLUGIN_FILENAME("OSS"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
204 PLUGIN_FILENAME("sun"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
205 PLUGIN_FILENAME("ESD"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
206 PLUGIN_FILENAME("pulse_audio"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
207 PLUGIN_FILENAME("disk_writer"), |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
208 NULL |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
209 }; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
210 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
211 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
212 static aud_cfg_boolent aud_boolents[] = { |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
213 {"allow_multiple_instances", &cfg.allow_multiple_instances, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
214 {"use_realtime", &cfg.use_realtime, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
215 {"always_show_cb", &cfg.always_show_cb, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
216 {"convert_underscore", &cfg.convert_underscore, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
217 {"convert_twenty", &cfg.convert_twenty, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
218 {"convert_slash", &cfg.convert_slash, TRUE }, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
219 {"show_numbers_in_pl", &cfg.show_numbers_in_pl, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
220 {"show_separator_in_pl", &cfg.show_separator_in_pl, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
221 {"snap_windows", &cfg.snap_windows, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
222 {"save_window_positions", &cfg.save_window_position, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
223 {"dim_titlebar", &cfg.dim_titlebar, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
224 {"get_info_on_load", &cfg.get_info_on_load, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
225 {"get_info_on_demand", &cfg.get_info_on_demand, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
226 {"eq_scaled_linked", &cfg.eq_scaled_linked, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
227 {"no_playlist_advance", &cfg.no_playlist_advance, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
228 {"refresh_file_list", &cfg.refresh_file_list, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
229 {"sort_jump_to_file", &cfg.sort_jump_to_file, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
230 {"use_pl_metadata", &cfg.use_pl_metadata, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
231 {"warn_about_win_visibility", &cfg.warn_about_win_visibility, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
232 {"use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
233 {"player_shaded", &cfg.player_shaded, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
234 {"player_visible", &cfg.player_visible, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
235 {"shuffle", &cfg.shuffle, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
236 {"repeat", &cfg.repeat, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
237 {"scaled", &cfg.scaled, TRUE}, /* toggles custom scale */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
238 {"autoscroll_songname", &cfg.autoscroll, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
239 {"stop_after_current_song", &cfg.stopaftersong, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
240 {"playlist_shaded", &cfg.playlist_shaded, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
241 {"playlist_visible", &cfg.playlist_visible, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
242 {"use_fontsets", &cfg.use_fontsets, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
243 {"mainwin_use_bitmapfont", &cfg.mainwin_use_bitmapfont, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
244 {"equalizer_visible", &cfg.equalizer_visible, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
245 {"equalizer_active", &cfg.equalizer_active, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
246 {"equalizer_shaded", &cfg.equalizer_shaded, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
247 {"equalizer_autoload", &cfg.equalizer_autoload, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
248 {"easy_move", &cfg.easy_move, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
249 {"use_eplugins", &cfg.use_eplugins, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
250 {"always_on_top", &cfg.always_on_top, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
251 {"sticky", &cfg.sticky, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
252 {"random_skin_on_play", &cfg.random_skin_on_play, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
253 {"pause_between_songs", &cfg.pause_between_songs, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
254 {"show_wm_decorations", &cfg.show_wm_decorations, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
255 {"eq_extra_filtering", &cfg.eq_extra_filtering, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
256 {"analyzer_peaks", &cfg.analyzer_peaks, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
257 {"custom_cursors", &cfg.custom_cursors, TRUE}, |
4455
5125b5910d0e
add checkbox to make it possible to load broken skins
Tomasz Mon <desowin@gmail.com>
parents:
4433
diff
changeset
|
258 {"allow_broken_skins", &cfg.allow_broken_skins, TRUE}, |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
259 {"close_dialog_open", &cfg.close_dialog_open, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
260 {"close_dialog_add", &cfg.close_dialog_add, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
261 {"resume_playback_on_startup", &cfg.resume_playback_on_startup, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
262 {"playlist_detect", &cfg.playlist_detect, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
263 {"show_filepopup_for_tuple", &cfg.show_filepopup_for_tuple, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
264 {"recurse_for_cover", &cfg.recurse_for_cover, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
265 {"use_file_cover", &cfg.use_file_cover, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
266 {"use_xmms_style_fileselector", &cfg.use_xmms_style_fileselector, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
267 {"use_extension_probing", &cfg.use_extension_probing, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
268 {"filepopup_showprogressbar", &cfg.filepopup_showprogressbar, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
269 {"close_jtf_dialog", &cfg.close_jtf_dialog, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
270 {"twoway_scroll", &cfg.twoway_scroll, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
271 {"software_volume_control", &cfg.software_volume_control, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
272 {"warn_about_broken_gtk_engines", &cfg.warn_about_broken_gtk_engines, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
273 {"disable_inline_gtk", &cfg.disable_inline_gtk, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
274 {"remember_jtf_entry", &cfg.remember_jtf_entry, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
275 {"enable_replay_gain", &cfg.enable_replay_gain, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
276 {"enable_clipping_prevention", &cfg.enable_clipping_prevention, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
277 {"replay_gain_track", &cfg.replay_gain_track, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
278 {"replay_gain_album", &cfg.replay_gain_album, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
279 {"enable_adaptive_scaler", &cfg.enable_adaptive_scaler, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
280 #ifdef USE_SRC |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
281 {"enable_src", &cfg.enable_src, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
282 #endif |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
283 {"bypass_dsp", &cfg.bypass_dsp, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
284 }; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
285 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
286 static gint ncfgbent = G_N_ELEMENTS(aud_boolents); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
287 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
288 static aud_cfg_nument aud_numents[] = { |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
289 {"player_x", &cfg.player_x, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
290 {"player_y", &cfg.player_y, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
291 {"timer_mode", &cfg.timer_mode, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
292 {"vis_type", &cfg.vis_type, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
293 {"analyzer_mode", &cfg.analyzer_mode, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
294 {"analyzer_type", &cfg.analyzer_type, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
295 {"scope_mode", &cfg.scope_mode, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
296 {"vu_mode", &cfg.vu_mode, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
297 {"voiceprint_mode", &cfg.voiceprint_mode, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
298 {"vis_refresh_rate", &cfg.vis_refresh, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
299 {"analyzer_falloff", &cfg.analyzer_falloff, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
300 {"peaks_falloff", &cfg.peaks_falloff, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
301 {"playlist_x", &cfg.playlist_x, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
302 {"playlist_y", &cfg.playlist_y, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
303 {"playlist_width", &cfg.playlist_width, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
304 {"playlist_height", &cfg.playlist_height, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
305 {"playlist_position", &cfg.playlist_position, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
306 {"equalizer_x", &cfg.equalizer_x, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
307 {"equalizer_y", &cfg.equalizer_y, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
308 {"snap_distance", &cfg.snap_distance, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
309 {"pause_between_songs_time", &cfg.pause_between_songs_time, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
310 {"mouse_wheel_change", &cfg.mouse_change, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
311 {"scroll_pl_by", &cfg.scroll_pl_by, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
312 {"titlestring_preset", &cfg.titlestring_preset, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
313 {"resume_playback_on_startup_time", &cfg.resume_playback_on_startup_time, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
314 {"output_buffer_size", &cfg.output_buffer_size, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
315 {"recurse_for_cover_depth", &cfg.recurse_for_cover_depth, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
316 {"filepopup_pixelsize", &cfg.filepopup_pixelsize, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
317 {"filepopup_delay", &cfg.filepopup_delay, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
318 {"colorize_r", &cfg.colorize_r, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
319 {"colorize_g", &cfg.colorize_g, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
320 {"colorize_b", &cfg.colorize_b, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
321 {"output_bit_depth", &cfg.output_bit_depth, TRUE}, |
4374
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
322 {"saved_volume", &cfg.saved_volume, TRUE}, |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
323 #ifdef USE_SRC |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
324 {"src_rate", &cfg.src_rate, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
325 {"src_type", &cfg.src_type, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
326 #endif |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
327 }; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
328 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
329 static gint ncfgient = G_N_ELEMENTS(aud_numents); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
330 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
331 static aud_cfg_strent aud_strents[] = { |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
332 {"playlist_font", &cfg.playlist_font, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
333 {"mainwin_font", &cfg.mainwin_font, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
334 {"eqpreset_default_file", &cfg.eqpreset_default_file, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
335 {"eqpreset_extension", &cfg.eqpreset_extension, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
336 {"skin", &cfg.skin, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
337 {"output_plugin", &cfg.outputplugin, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
338 {"disabled_iplugins", &cfg.disabled_iplugins, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
339 {"enabled_gplugins", &cfg.enabled_gplugins, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
340 {"enabled_vplugins", &cfg.enabled_vplugins, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
341 {"enabled_eplugins", &cfg.enabled_eplugins, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
342 {"filesel_path", &cfg.filesel_path, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
343 {"playlist_path", &cfg.playlist_path, FALSE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
344 {"generic_title_format", &cfg.gentitle_format, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
345 {"chardet_detector", &cfg.chardet_detector, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
346 {"chardet_fallback", &cfg.chardet_fallback, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
347 {"cover_name_include", &cfg.cover_name_include, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
348 {"cover_name_exclude", &cfg.cover_name_exclude, TRUE}, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
349 {"session_uri_base", &cfg.session_uri_base, TRUE} |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
350 }; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
351 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
352 static gint ncfgsent = G_N_ELEMENTS(aud_strents); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
353 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
354 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
355 static gboolean |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
356 save_extra_playlist(const gchar * path, const gchar * basename, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
357 gpointer savedlist) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
358 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
359 GList *playlists, *iter; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
360 GList **saved; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
361 Playlist *playlist; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
362 int found; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
363 gchar *filename; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
364 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
365 playlists = playlist_get_playlists(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
366 saved = (GList **) savedlist; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
367 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
368 found = 0; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
369 for (iter = playlists; iter; iter = iter->next) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
370 playlist = (Playlist *) iter->data; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
371 if (g_list_find(*saved, playlist)) continue; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
372 filename = playlist_filename_get(playlist); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
373 if (!filename) continue; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
374 if (strcmp(filename, path) == 0) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
375 /* Save playlist */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
376 playlist_save(playlist, path); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
377 *saved = g_list_prepend(*saved, playlist); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
378 found = 1; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
379 g_free(filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
380 break; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
381 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
382 g_free(filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
383 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
384 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
385 if(!found) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
386 /* Remove playlist */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
387 unlink(path); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
388 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
389 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
390 return FALSE; /* process other playlists */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
391 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
392 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
393 static void |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
394 save_other_playlists(GList *saved) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
395 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
396 GList *playlists, *iter; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
397 Playlist *playlist; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
398 gchar *pos, *ext, *basename, *filename, *newbasename; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
399 int i, num, isdigits; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
400 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
401 playlists = playlist_get_playlists(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
402 for(iter = playlists; iter; iter = iter->next) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
403 playlist = (Playlist *) iter->data; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
404 if (g_list_find(saved, playlist)) continue; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
405 filename = playlist_filename_get(playlist); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
406 if (!filename || !filename[0] |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
407 || g_file_test(filename, G_FILE_TEST_IS_DIR)) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
408 /* default basename */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
409 #ifdef HAVE_XSPF_PLAYLIST |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
410 basename = g_strdup("playlist_01.xspf"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
411 #else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
412 basename = g_strdup("playlist_01.m3u"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
413 #endif |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
414 } else { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
415 basename = g_path_get_basename(filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
416 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
417 g_free(filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
418 if ((pos = strrchr(basename, '.'))) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
419 *pos = '\0'; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
420 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
421 #ifdef HAVE_XSPF_PLAYLIST |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
422 ext = ".xspf"; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
423 #else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
424 ext = ".m3u"; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
425 #endif |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
426 num = -1; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
427 if ((pos = strrchr(basename, '_'))) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
428 isdigits = 0; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
429 for (i=1; pos[i]; i++) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
430 if (!g_ascii_isdigit(pos[i])) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
431 isdigits = 0; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
432 break; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
433 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
434 isdigits = 1; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
435 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
436 if (isdigits) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
437 num = atoi(pos+1) + 1; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
438 *pos = '\0'; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
439 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
440 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
441 /* attempt to generate unique filename */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
442 filename = NULL; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
443 do { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
444 g_free(filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
445 if (num < 0) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
446 /* try saving without number first */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
447 newbasename = g_strdup_printf("%s%s", basename, ext); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
448 num = 1; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
449 } else { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
450 newbasename = g_strdup_printf("%s_%02d%s", basename, num, ext); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
451 num++; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
452 if (num < 0) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
453 g_warning("Playlist number in filename overflowed." |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
454 " Not saving playlist.\n"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
455 goto cleanup; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
456 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
457 } |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
458 filename = g_build_filename(aud_paths[BMP_PATH_PLAYLISTS_DIR], |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
459 newbasename, NULL); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
460 g_free(newbasename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
461 } while (g_file_test(filename, G_FILE_TEST_EXISTS)); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
462 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
463 playlist_save(playlist, filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
464 cleanup: |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
465 g_free(filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
466 g_free(basename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
467 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
468 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
469 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
470 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
471 void |
4412
180996fcf12a
bmp_config_* -> aud_config_*
Matti Hamalainen <ccr@tnsp.org>
parents:
4411
diff
changeset
|
472 aud_config_free(void) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
473 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
474 gint i; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
475 for (i = 0; i < ncfgsent; ++i) { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
476 if ( *(aud_strents[i].se_vloc) != NULL ) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
477 { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
478 g_free( *(aud_strents[i].se_vloc) ); |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
479 *(aud_strents[i].se_vloc) = NULL; |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
480 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
481 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
482 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
483 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
484 void |
4412
180996fcf12a
bmp_config_* -> aud_config_*
Matti Hamalainen <ccr@tnsp.org>
parents:
4411
diff
changeset
|
485 aud_config_load(void) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
486 { |
4433
a6a2e84e2b2e
Use mcs_handle_t directly instead of ConfigDb struct to remove the useless wrapper.
Matti Hamalainen <ccr@tnsp.org>
parents:
4413
diff
changeset
|
487 mcs_handle_t *db; |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
488 gint i, length; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
489 |
4411
628926f505f8
BmpConfig -> AudConfig, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
4404
diff
changeset
|
490 memcpy(&cfg, &aud_default_config, sizeof(AudConfig)); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
491 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
492 db = cfg_db_open(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
493 for (i = 0; i < ncfgbent; ++i) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
494 cfg_db_get_bool(db, NULL, |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
495 aud_boolents[i].be_vname, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
496 aud_boolents[i].be_vloc); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
497 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
498 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
499 for (i = 0; i < ncfgient; ++i) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
500 cfg_db_get_int(db, NULL, |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
501 aud_numents[i].ie_vname, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
502 aud_numents[i].ie_vloc); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
503 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
504 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
505 for (i = 0; i < ncfgsent; ++i) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
506 cfg_db_get_string(db, NULL, |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
507 aud_strents[i].se_vname, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
508 aud_strents[i].se_vloc); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
509 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
510 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
511 /* Preset */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
512 cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
513 for (i = 0; i < 10; i++) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
514 gchar eqtext[18]; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
515 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
516 g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
517 cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
518 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
519 |
4374
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
520 cfg_db_get_int(db,NULL, "saved_volume", &cfg.saved_volume); |
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
521 |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
522 /* custom scale factor */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
523 cfg_db_get_float(db, NULL, "scale_factor", &cfg.scale_factor); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
524 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
525 /* History */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
526 if (cfg_db_get_int(db, NULL, "url_history_length", &length)) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
527 for (i = 1; i <= length; i++) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
528 gchar str[19], *tmp; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
529 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
530 g_snprintf(str, sizeof(str), "url_history%d", i); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
531 if (cfg_db_get_string(db, NULL, str, &tmp)) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
532 cfg.url_history = g_list_append(cfg.url_history, tmp); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
533 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
534 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
535 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
536 /* RG settings */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
537 cfg_db_get_float(db, NULL, "replay_gain_preamp", &cfg.replay_gain_preamp); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
538 cfg_db_get_float(db, NULL, "default_gain", &cfg.default_gain); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
539 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
540 cfg_db_close(db); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
541 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
542 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
543 if (cfg.playlist_font && strlen(cfg.playlist_font) == 0) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
544 g_free(cfg.playlist_font); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
545 cfg.playlist_font = NULL; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
546 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
547 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
548 if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
549 g_free(cfg.mainwin_font); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
550 cfg.mainwin_font = NULL; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
551 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
552 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
553 if (!cfg.playlist_font) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
554 cfg.playlist_font = g_strdup(MAINWIN_DEFAULT_FONT); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
555 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
556 if (!cfg.mainwin_font) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
557 cfg.mainwin_font = g_strdup(PLAYLISTWIN_DEFAULT_FONT); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
558 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
559 if (!cfg.gentitle_format) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
560 cfg.gentitle_format = g_strdup("${?artist:${artist} - }${?album:${album} - }${title}"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
561 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
562 if (!cfg.outputplugin) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
563 gint iter; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
564 gchar *pl_path = g_build_filename(PLUGIN_DIR, plugin_dir_list[0], NULL); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
565 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
566 for (iter = 0; pl_candidates[iter] != NULL && cfg.outputplugin == NULL; iter++) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
567 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
568 cfg.outputplugin = find_file_recursively(pl_path, pl_candidates[iter]); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
569 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
570 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
571 g_free(pl_path); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
572 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
573 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
574 if (!cfg.eqpreset_default_file) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
575 cfg.eqpreset_default_file = g_strdup(EQUALIZER_DEFAULT_DIR_PRESET); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
576 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
577 if (!cfg.eqpreset_extension) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
578 cfg.eqpreset_extension = g_strdup(EQUALIZER_DEFAULT_PRESET_EXT); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
579 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
580 if (!cfg.chardet_detector) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
581 cfg.chardet_detector = g_strdup(""); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
582 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
583 if (!cfg.chardet_fallback) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
584 cfg.chardet_fallback = g_strdup(""); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
585 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
586 if (!cfg.cover_name_include) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
587 cfg.cover_name_include = g_strdup(""); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
588 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
589 if (!cfg.cover_name_exclude) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
590 cfg.cover_name_exclude = g_strdup("back"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
591 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
592 if (!cfg.session_uri_base) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
593 cfg.session_uri_base = g_strdup(""); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
594 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
595 /* at least one of these should be true */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
596 if ((!cfg.get_info_on_demand) && (!cfg.get_info_on_load)) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
597 cfg.get_info_on_demand = TRUE; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
598 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
599 /* playlist width and height can't be smaller than minimum */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
600 cfg.playlist_width = MAX(cfg.playlist_width, PLAYLISTWIN_MIN_WIDTH); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
601 cfg.playlist_height = MAX(cfg.playlist_height, PLAYLISTWIN_MIN_HEIGHT); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
602 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
603 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
604 void |
4412
180996fcf12a
bmp_config_* -> aud_config_*
Matti Hamalainen <ccr@tnsp.org>
parents:
4411
diff
changeset
|
605 aud_config_save(void) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
606 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
607 GList *node; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
608 gchar *str; |
4374
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
609 gint i, cur_pb_time, vol_l, vol_r; |
4433
a6a2e84e2b2e
Use mcs_handle_t directly instead of ConfigDb struct to remove the useless wrapper.
Matti Hamalainen <ccr@tnsp.org>
parents:
4413
diff
changeset
|
610 mcs_handle_t *db; |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
611 GList *saved; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
612 Playlist *playlist = playlist_get_active(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
613 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
614 cfg.disabled_iplugins = input_stringify_disabled_list(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
615 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
616 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
617 db = cfg_db_open(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
618 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
619 for (i = 0; i < ncfgbent; ++i) |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
620 if (aud_boolents[i].be_wrt) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
621 cfg_db_set_bool(db, NULL, |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
622 aud_boolents[i].be_vname, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
623 *aud_boolents[i].be_vloc); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
624 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
625 for (i = 0; i < ncfgient; ++i) |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
626 if (aud_numents[i].ie_wrt) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
627 cfg_db_set_int(db, NULL, |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
628 aud_numents[i].ie_vname, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
629 *aud_numents[i].ie_vloc); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
630 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
631 /* This is a bit lame .. it'll end up being written twice, |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
632 * could do with being done a bit neater. -larne */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
633 cfg_db_set_int(db, NULL, "playlist_position", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
634 playlist_get_position(playlist)); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
635 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
636 /* FIXME: we're looking up SkinnedWindow::x &c ourselves here. |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
637 * this isn't exactly right. -nenolod |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
638 */ |
4367
99b6e2bac92a
write window positions to config only when windows are valid
mf0102 <0102@gmx.at>
parents:
4358
diff
changeset
|
639 if ( playlistwin && |
99b6e2bac92a
write window positions to config only when windows are valid
mf0102 <0102@gmx.at>
parents:
4358
diff
changeset
|
640 SKINNED_WINDOW(playlistwin)->x != -1 && |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
641 SKINNED_WINDOW(playlistwin)->y != -1 ) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
642 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
643 cfg_db_set_int(db, NULL, "playlist_x", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
644 SKINNED_WINDOW(playlistwin)->x); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
645 cfg_db_set_int(db, NULL, "playlist_y", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
646 SKINNED_WINDOW(playlistwin)->y); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
647 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
648 |
4367
99b6e2bac92a
write window positions to config only when windows are valid
mf0102 <0102@gmx.at>
parents:
4358
diff
changeset
|
649 if ( mainwin && |
99b6e2bac92a
write window positions to config only when windows are valid
mf0102 <0102@gmx.at>
parents:
4358
diff
changeset
|
650 SKINNED_WINDOW(mainwin)->x != -1 && |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
651 SKINNED_WINDOW(mainwin)->y != -1 ) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
652 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
653 cfg_db_set_int(db, NULL, "player_x", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
654 SKINNED_WINDOW(mainwin)->x); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
655 cfg_db_set_int(db, NULL, "player_y", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
656 SKINNED_WINDOW(mainwin)->y); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
657 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
658 |
4367
99b6e2bac92a
write window positions to config only when windows are valid
mf0102 <0102@gmx.at>
parents:
4358
diff
changeset
|
659 if ( equalizerwin && |
99b6e2bac92a
write window positions to config only when windows are valid
mf0102 <0102@gmx.at>
parents:
4358
diff
changeset
|
660 SKINNED_WINDOW(equalizerwin)->x != -1 && |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
661 SKINNED_WINDOW(equalizerwin)->y != -1 ) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
662 { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
663 cfg_db_set_int(db, NULL, "equalizer_x", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
664 SKINNED_WINDOW(equalizerwin)->x); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
665 cfg_db_set_int(db, NULL, "equalizer_y", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
666 SKINNED_WINDOW(equalizerwin)->y); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
667 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
668 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
669 cfg_db_set_bool(db, NULL, "mainwin_use_bitmapfont", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
670 cfg.mainwin_use_bitmapfont); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
671 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
672 for (i = 0; i < ncfgsent; ++i) { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
673 if (aud_strents[i].se_wrt) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
674 cfg_db_set_string(db, NULL, |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
675 aud_strents[i].se_vname, |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
676 *aud_strents[i].se_vloc); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
677 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
678 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
679 cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
680 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
681 /* RG settings */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
682 cfg_db_set_float(db, NULL, "replay_gain_preamp", cfg.replay_gain_preamp); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
683 cfg_db_set_float(db, NULL, "default_gain", cfg.default_gain); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
684 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
685 for (i = 0; i < 10; i++) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
686 str = g_strdup_printf("equalizer_band%d", i); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
687 cfg_db_set_float(db, NULL, str, cfg.equalizer_bands[i]); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
688 g_free(str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
689 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
690 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
691 cfg_db_set_float(db, NULL, "scale_factor", cfg.scale_factor); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
692 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
693 if (aud_active_skin != NULL) |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
694 { |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
695 if (aud_active_skin->path) |
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
696 cfg_db_set_string(db, NULL, "skin", aud_active_skin->path); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
697 else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
698 cfg_db_unset_key(db, NULL, "skin"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
699 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
700 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
701 if (get_current_output_plugin()) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
702 cfg_db_set_string(db, NULL, "output_plugin", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
703 get_current_output_plugin()->filename); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
704 else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
705 cfg_db_unset_key(db, NULL, "output_plugin"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
706 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
707 str = general_stringify_enabled_list(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
708 if (str) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
709 cfg_db_set_string(db, NULL, "enabled_gplugins", str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
710 g_free(str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
711 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
712 else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
713 cfg_db_unset_key(db, NULL, "enabled_gplugins"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
714 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
715 str = vis_stringify_enabled_list(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
716 if (str) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
717 cfg_db_set_string(db, NULL, "enabled_vplugins", str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
718 g_free(str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
719 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
720 else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
721 cfg_db_unset_key(db, NULL, "enabled_vplugins"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
722 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
723 str = effect_stringify_enabled_list(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
724 if (str) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
725 cfg_db_set_string(db, NULL, "enabled_eplugins", str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
726 g_free(str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
727 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
728 else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
729 cfg_db_unset_key(db, NULL, "enabled_eplugins"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
730 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
731 if (cfg.filesel_path) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
732 cfg_db_set_string(db, NULL, "filesel_path", cfg.filesel_path); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
733 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
734 if (cfg.playlist_path) |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
735 cfg_db_set_string(db, NULL, "playlist_path", cfg.playlist_path); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
736 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
737 cfg_db_set_int(db, NULL, "url_history_length", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
738 g_list_length(cfg.url_history)); |
4374
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
739 |
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
740 input_get_volume(&vol_l,&vol_r); |
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
741 cfg_db_set_int(db, NULL, "saved_volume", (vol_l<<8) | vol_r ); |
335f4ac3993a
save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents:
4367
diff
changeset
|
742 |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
743 for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
744 str = g_strdup_printf("url_history%d", i); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
745 cfg_db_set_string(db, NULL, str, node->data); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
746 g_free(str); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
747 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
748 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
749 if (playback_get_playing()) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
750 cur_pb_time = playback_get_time(); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
751 } else |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
752 cur_pb_time = -1; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
753 cfg.resume_playback_on_startup_time = cur_pb_time; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
754 cfg_db_set_int(db, NULL, "resume_playback_on_startup_time", |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
755 cfg.resume_playback_on_startup_time); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
756 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
757 cfg_db_close(db); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
758 |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
759 playlist_save(playlist, aud_paths[BMP_PATH_PLAYLIST_FILE]); |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
760 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
761 /* Save extra playlists that were loaded from PLAYLISTS_DIR */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
762 saved = NULL; |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
763 saved = g_list_prepend(saved, playlist); /* don't save default again */ |
4413
de33c83aa06f
Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents:
4412
diff
changeset
|
764 if(!dir_foreach(aud_paths[BMP_PATH_PLAYLISTS_DIR], save_extra_playlist, |
4352
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
765 &saved, NULL)) { |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
766 g_warning("Could not save extra playlists\n"); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
767 } |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
768 |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
769 /* Save other playlists to PLAYLISTS_DIR */ |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
770 save_other_playlists(saved); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
771 g_list_free(saved); |
ac1f6d211223
Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff
changeset
|
772 } |