annotate src/audlegacy/audconfig.c @ 4848:b2ee645f3e59

Hook up the equalizer (bug #24)
author John Lindgren <john.lindgren@tds.net>
date Sun, 12 Apr 2009 23:03:39 -0400
parents 7bf7f83a217e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
26 #ifdef HAVE_CONFIG_H
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
27 # include "config.h"
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
28 #endif
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
29
4523
b3e4f5c31546 Conditional USE_SRC was changed to USE_SAMPLERATE earlier.
Matti Hamalainen <ccr@tnsp.org>
parents: 4517
diff changeset
30 #ifdef USE_SAMPLERATE
4358
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
31 # include <samplerate.h>
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
32 #endif
6478692415a0 fixed FTBFS
Eugene Zagidullin <e.asphyx@gmail.com>
parents: 4352
diff changeset
33
4517
6e412073cf28 cleaned up some more
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
34 #include "audconfig.h"
6e412073cf28 cleaned up some more
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
35
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
36 #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
37 #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
38 #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
39 #include "pluginenum.h"
4700
3a56d2786063 move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents: 4604
diff changeset
40 #include "legacy/ui_equalizer.h"
3a56d2786063 move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents: 4604
diff changeset
41 #include "legacy/ui_playlist.h"
3a56d2786063 move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents: 4604
diff changeset
42 #include "legacy/ui_skin.h"
3a56d2786063 move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents: 4604
diff changeset
43 #include "legacy/ui_skinned_window.h"
3a56d2786063 move all files belonging to the legacy UI to legacy/
mf0102 <0102@gmx.at>
parents: 4604
diff changeset
44 #include "legacy/ui_vis.h"
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
45 #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
46 #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
47
4517
6e412073cf28 cleaned up some more
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
48 AudConfig cfg;
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
49
4411
628926f505f8 BmpConfig -> AudConfig, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 4404
diff changeset
50 AudConfig aud_default_config = {
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
51 .player_x = MAINWIN_DEFAULT_POS_X,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
52 .player_y = MAINWIN_DEFAULT_POS_Y,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
53 .equalizer_x = EQUALIZER_DEFAULT_POS_X,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
54 .equalizer_y = EQUALIZER_DEFAULT_POS_Y,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
55 .playlist_x = PLAYLISTWIN_DEFAULT_POS_X,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
56 .playlist_y = PLAYLISTWIN_DEFAULT_POS_Y,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
57 .playlist_width = PLAYLISTWIN_DEFAULT_WIDTH,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
58 .playlist_height = PLAYLISTWIN_DEFAULT_HEIGHT,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
59 .snap_distance = 10,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
60 .use_realtime = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
61 .shuffle = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
62 .repeat = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
63 .scaled = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
64 .autoscroll = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
65 .analyzer_peaks = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
66 .equalizer_autoload = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
67 .easy_move = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
68 .equalizer_active = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
69 .playlist_visible = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
70 .equalizer_visible = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
71 .player_visible = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
72 .player_shaded = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
73 .playlist_shaded = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
74 .equalizer_shaded = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
75 .allow_multiple_instances = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
76 .always_show_cb = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
77 .convert_underscore = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
78 .convert_twenty = TRUE, /* convert %20 */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
79 .convert_slash = TRUE,
4805
14da5037144f changed default values:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4804
diff changeset
80 .show_numbers_in_pl = FALSE,
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
81 .snap_windows = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
82 .save_window_position = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
83 .dim_titlebar = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
84 .get_info_on_load = FALSE, /* get playlist info on load */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
85 .get_info_on_demand = TRUE, /* get playlist info on demand */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
86 .eq_scaled_linked = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
87 .sort_jump_to_file = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
88 .use_eplugins = FALSE, /* use effect plugins */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
89 .always_on_top = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
90 .sticky = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
91 .no_playlist_advance = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
92 .stopaftersong = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
93 .refresh_file_list = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
94 .use_pl_metadata = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
95 .warn_about_win_visibility = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
96 .use_backslash_as_dir_delimiter = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
97 .random_skin_on_play = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
98 .use_fontsets = FALSE,
4805
14da5037144f changed default values:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4804
diff changeset
99 .mainwin_use_bitmapfont = FALSE,
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
100 .allow_broken_skins = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
101 .close_dialog_open = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
102 .close_dialog_add = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
103 .equalizer_preamp = 0.0,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
104 .equalizer_bands = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
4541
d8920be7275a set default scale_factor to 2.0, custom scale factor can be manually specified in config file anyway; use GDK_INTERP_NEAREST and GDK_RGB_DITHER_NONE when drawing scaled widgets
Tomasz Mon <desowin@gmail.com>
parents: 4526
diff changeset
105 .scale_factor = 2.0,
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
106 .skin = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
107 .outputplugin = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
108 .filesel_path = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
109 .playlist_path = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
110 .playlist_font = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
111 .mainwin_font = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
112 .disabled_iplugins = NULL, /* disabled input plugins */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
113 .enabled_gplugins = NULL, /* enabled general plugins */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
114 .enabled_vplugins = NULL, /* enabled visualization plugins */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
115 .enabled_eplugins = NULL, /* enabled effect plugins */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
116 .enabled_dplugins = NULL, /* enabled discovery plugins */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
117 .eqpreset_default_file = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
118 .eqpreset_extension = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
119 .url_history = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
120 .timer_mode = 0,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
121 .vis_type = VIS_ANALYZER,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
122 .analyzer_mode = ANALYZER_NORMAL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
123 .analyzer_type = ANALYZER_BARS,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
124 .scope_mode = SCOPE_DOT,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
125 .voiceprint_mode = VOICEPRINT_NORMAL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
126 .vu_mode = VU_SMOOTH,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
127 .vis_refresh = REFRESH_FULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
128 .analyzer_falloff = FALLOFF_FAST,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
129 .peaks_falloff = FALLOFF_SLOW,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
130 .playlist_position = 0,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
131 .pause_between_songs_time = 2,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
132 .pause_between_songs = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
133 .show_wm_decorations = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
134 .mouse_change = 8, /* mouse wheel scroll step */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
135 .playlist_transparent = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
136 .eq_extra_filtering = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
137 .scroll_pl_by = 3,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
138 .resume_playback_on_startup = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
139 .resume_playback_on_startup_time = -1,
4805
14da5037144f changed default values:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4804
diff changeset
140 .show_separator_in_pl = FALSE,
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
141 .chardet_detector = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
142 .chardet_fallback = NULL,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
143 .output_buffer_size = 500,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
144 .playlist_detect = TRUE, /* whether or not to postpone format detection on initial add */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
145 .show_filepopup_for_tuple = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
146 .cover_name_include = NULL, /* words identifying covers */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
147 .cover_name_exclude = NULL, /* words that might not show up in cover names */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
148 .recurse_for_cover = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
149 .recurse_for_cover_depth = 0,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
150 .session_uri_base = NULL, /* default session uri base (non-NULL = custom session uri base) */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
151 .filepopup_pixelsize = 150, /* short side length of the picture in the filepopup */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
152 .filepopup_delay = 20, /* delay until the filepopup comes up */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
153 .use_file_cover = FALSE, /* use filename.jpg for coverart */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
154 .use_extension_probing = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
155 .colorize_r = 255, .colorize_g = 255, .colorize_b = 255,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
156 .filepopup_showprogressbar = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
157 .close_jtf_dialog = TRUE, /* close jtf dialog on jump */
4805
14da5037144f changed default values:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4804
diff changeset
158 .twoway_scroll = FALSE, /* use back and forth scroll */
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
159 .software_volume_control = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
160 .warn_about_broken_gtk_engines = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
161 .disable_inline_gtk = FALSE, /* disable inline themes */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
162 .remember_jtf_entry = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
163 .output_bit_depth = 16,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
164 .enable_replay_gain = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
165 .enable_clipping_prevention = TRUE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
166 .replay_gain_track = TRUE, /* track mode */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
167 .replay_gain_album = FALSE, /* album mode */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
168 .enable_adaptive_scaler = FALSE,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
169 .replay_gain_preamp = 0.0,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
170 .default_gain = -9.0,
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
171 .saved_volume = 0x6464, /* for both channels; 0x64=100 */
4523
b3e4f5c31546 Conditional USE_SRC was changed to USE_SAMPLERATE earlier.
Matti Hamalainen <ccr@tnsp.org>
parents: 4517
diff changeset
172 #ifdef USE_SAMPLERATE
4456
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
173 .enable_src = FALSE, /* enable resampling */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
174 .src_rate = 48000, /* samplerate */
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
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
3638e4151bae little cleanup; no functional change
mf0102 <0102@gmx.at>
parents: 4455
diff changeset
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},
4455
5125b5910d0e add checkbox to make it possible to load broken skins
Tomasz Mon <desowin@gmail.com>
parents: 4433
diff changeset
257 {"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
258 {"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
259 {"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
260 {"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
261 {"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
262 {"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
263 {"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
264 {"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
265 {"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
266 {"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
267 {"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
268 {"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
269 {"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
270 {"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
271 {"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
272 {"remember_jtf_entry", &cfg.remember_jtf_entry, TRUE},
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
273 {"enable_replay_gain", &cfg.enable_replay_gain, TRUE},
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
274 {"enable_clipping_prevention", &cfg.enable_clipping_prevention, TRUE},
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
275 {"replay_gain_track", &cfg.replay_gain_track, TRUE},
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
276 {"replay_gain_album", &cfg.replay_gain_album, TRUE},
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
277 {"enable_adaptive_scaler", &cfg.enable_adaptive_scaler, TRUE},
4523
b3e4f5c31546 Conditional USE_SRC was changed to USE_SAMPLERATE earlier.
Matti Hamalainen <ccr@tnsp.org>
parents: 4517
diff changeset
278 #ifdef USE_SAMPLERATE
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
279 {"enable_src", &cfg.enable_src, TRUE},
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
280 #endif
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
281 {"bypass_dsp", &cfg.bypass_dsp, TRUE},
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
282 };
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
283
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
284 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
285
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
286 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
287 {"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
288 {"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
289 {"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
290 {"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
291 {"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
292 {"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
293 {"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
294 {"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
295 {"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
296 {"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
297 {"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
298 {"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
299 {"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
300 {"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
301 {"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
302 {"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
303 {"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
304 {"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
305 {"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
306 {"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
307 {"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
308 {"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
309 {"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
310 {"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
311 {"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
312 {"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
313 {"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
314 {"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
315 {"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
316 {"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
317 {"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
318 {"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
319 {"output_bit_depth", &cfg.output_bit_depth, TRUE},
4374
335f4ac3993a save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents: 4367
diff changeset
320 {"saved_volume", &cfg.saved_volume, TRUE},
4523
b3e4f5c31546 Conditional USE_SRC was changed to USE_SAMPLERATE earlier.
Matti Hamalainen <ccr@tnsp.org>
parents: 4517
diff changeset
321 #ifdef USE_SAMPLERATE
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
322 {"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
323 {"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
324 #endif
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
325 };
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
326
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
327 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
328
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
329 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
330 {"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
331 {"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
332 {"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
333 {"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
334 {"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
335 {"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
336 {"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
337 {"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
338 {"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
339 {"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
340 {"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
341 {"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
342 {"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
343 {"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
344 {"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
345 {"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
346 {"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
347 {"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
348 };
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
349
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
350 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
351
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
353 static gboolean
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
354 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
355 gpointer savedlist)
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
356 {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
357 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
358 GList **saved;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
359 Playlist *playlist;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
360 int found;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
361 gchar *filename;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
362
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
363 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
364 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
365
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
366 found = 0;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
367 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
368 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
369 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
370 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
371 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
372 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
373 /* Save playlist */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
374 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
375 *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
376 found = 1;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
377 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
378 break;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
379 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
380 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
381 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
382
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
383 if(!found) {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
384 /* Remove playlist */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
385 unlink(path);
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
386 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
387
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
388 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
389 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
390
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
391 static void
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
392 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
393 {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
394 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
395 Playlist *playlist;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
396 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
397 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
398
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
399 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
400 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
401 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
402 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
403 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
404 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
405 || 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
406 /* default basename */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
407 #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
408 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
409 #else
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.m3u");
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
411 #endif
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
412 } else {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
413 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
414 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
415 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
416 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
417 *pos = '\0';
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
418 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
419 #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
420 ext = ".xspf";
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
421 #else
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
422 ext = ".m3u";
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
423 #endif
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
424 num = -1;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
425 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
426 isdigits = 0;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
427 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
428 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
429 isdigits = 0;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
430 break;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
431 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
432 isdigits = 1;
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 if (isdigits) {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
435 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
436 *pos = '\0';
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
437 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
438 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
439 /* 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
440 filename = NULL;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
441 do {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
442 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
443 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
444 /* 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
445 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
446 num = 1;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
447 } else {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
448 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
449 num++;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
450 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
451 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
452 " 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
453 goto cleanup;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
454 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
455 }
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
456 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
457 newbasename, NULL);
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
458 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
459 } 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
460
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
461 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
462 cleanup:
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
463 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
464 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
465 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
466 }
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 void
4412
180996fcf12a bmp_config_* -> aud_config_*
Matti Hamalainen <ccr@tnsp.org>
parents: 4411
diff changeset
470 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
471 {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
472 gint i;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
473 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
474 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
475 {
4413
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
476 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
477 *(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
478 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
479 }
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 void
4412
180996fcf12a bmp_config_* -> aud_config_*
Matti Hamalainen <ccr@tnsp.org>
parents: 4411
diff changeset
483 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
484 {
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
485 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
486 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
487
4411
628926f505f8 BmpConfig -> AudConfig, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 4404
diff changeset
488 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
489
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
490 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
491 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
492 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
493 aud_boolents[i].be_vname,
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
494 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
495 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
496
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
497 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
498 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
499 aud_numents[i].ie_vname,
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
500 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
501 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
502
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
503 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
504 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
505 aud_strents[i].se_vname,
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
506 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
507 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
508
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
509 /* Preset */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
510 cfg_db_get_float(db, NULL, "equalizer_preamp", &cfg.equalizer_preamp);
4604
51d82bf6ba63 Use a define (AUD_EQUALIZER_NBANDS) instead of magic value 10 everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 4551
diff changeset
511 for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) {
51d82bf6ba63 Use a define (AUD_EQUALIZER_NBANDS) instead of magic value 10 everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 4551
diff changeset
512 gchar eqtext[32];
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
513
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
514 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
515 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
516 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
517
4374
335f4ac3993a save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents: 4367
diff changeset
518 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
519
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
520 /* 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
521 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
522
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
523 /* History */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
524 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
525 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
526 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
527
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
528 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
529 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
530 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
531 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
532 }
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 /* RG settings */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
535 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
536 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
537
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_close(db);
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
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
541 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
542 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
543 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
544 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
545
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
546 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
547 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
548 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
549 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
550
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
551 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
552 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
553
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
554 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
555 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
556
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
557 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
558 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
559
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
560 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
561 gint iter;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
562 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
563
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
564 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
565 {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
566 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
567 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
568
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
569 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
570 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
571
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
572 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
573 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
574
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
575 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
576 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
577
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
578 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
579 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
580
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
581 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
582 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
583
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
584 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
585 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
586
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
587 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
588 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
589
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
590 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
591 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
592
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
593 /* 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
594 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
595 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
596
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
597 /* 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
598 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
599 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
600 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
601
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
602 void
4412
180996fcf12a bmp_config_* -> aud_config_*
Matti Hamalainen <ccr@tnsp.org>
parents: 4411
diff changeset
603 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
604 {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
605 GList *node;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
606 gchar *str;
4374
335f4ac3993a save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents: 4367
diff changeset
607 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
608 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
609 GList *saved;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
610 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
611
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
612 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
613
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
614
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
615 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
616
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
617 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
618 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
619 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
620 aud_boolents[i].be_vname,
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
621 *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
622
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
623 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
624 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
625 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
626 aud_numents[i].ie_vname,
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
627 *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
628
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
629 /* 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
630 * could do with being done a bit neater. -larne */
4526
8465e73d5584 Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal.
Matti Hamalainen <ccr@tnsp.org>
parents: 4523
diff changeset
631 if (playlist) {
8465e73d5584 Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal.
Matti Hamalainen <ccr@tnsp.org>
parents: 4523
diff changeset
632 cfg_db_set_int(db, NULL, "playlist_position",
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
633 playlist_get_position(playlist));
4526
8465e73d5584 Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal.
Matti Hamalainen <ccr@tnsp.org>
parents: 4523
diff changeset
634 }
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
635
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
636 hook_call("config save", db);
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4508
diff changeset
637
4804
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
638 /* FIXME: we're looking up SkinnedWindow::x &c ourselves here.
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
639 * this isn't exactly right. -nenolod
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
640 */
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
641 if ( playlistwin &&
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
642 SKINNED_WINDOW(playlistwin)->x != -1 &&
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
643 SKINNED_WINDOW(playlistwin)->y != -1 )
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
644 {
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
645 cfg_db_set_int(db, NULL, "playlist_x",
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
646 SKINNED_WINDOW(playlistwin)->x);
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
647 cfg_db_set_int(db, NULL, "playlist_y",
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
648 SKINNED_WINDOW(playlistwin)->y);
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
649 }
4811
7bf7f83a217e rename src/audacious src/audlegacy so that both audlegacy and audacious can coexist.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4805
diff changeset
650
4804
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
651 if ( equalizerwin &&
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
652 SKINNED_WINDOW(equalizerwin)->x != -1 &&
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
653 SKINNED_WINDOW(equalizerwin)->y != -1 )
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
654 {
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
655 cfg_db_set_int(db, NULL, "equalizer_x",
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
656 SKINNED_WINDOW(equalizerwin)->x);
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
657 cfg_db_set_int(db, NULL, "equalizer_y",
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
658 SKINNED_WINDOW(equalizerwin)->y);
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
659 }
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
660
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
661 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
662 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
663 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
664 aud_strents[i].se_vname,
de33c83aa06f Huge renaming patch, changing BMP references to Audacious.
Matti Hamalainen <ccr@tnsp.org>
parents: 4412
diff changeset
665 *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
666 }
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 cfg_db_set_float(db, NULL, "equalizer_preamp", cfg.equalizer_preamp);
4805
14da5037144f changed default values:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4804
diff changeset
669
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
670 /* RG settings */
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
671 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
672 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
673
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
674 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
675 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
676 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
677 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
678 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
679
4804
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
680 cfg_db_set_float(db, NULL, "scale_factor", cfg.scale_factor);
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
681
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
682 if (aud_active_skin != NULL)
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
683 {
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
684 if (aud_active_skin->path)
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
685 cfg_db_set_string(db, NULL, "skin", aud_active_skin->path);
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
686 else
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
687 cfg_db_unset_key(db, NULL, "skin");
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
688 }
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
689
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
690 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
691 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
692 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
693 else
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
694 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
695
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
696 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
697 if (str) {
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_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
699 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
700 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
701 else
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_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
703
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
704 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
705 if (str) {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
706 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
707 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
708 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
709 else
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
710 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
711
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
712 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
713 if (str) {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
714 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
715 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
716 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
717 else
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
718 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
719
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
720 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
721 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
722
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
723 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
724 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
725
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
726 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
727 g_list_length(cfg.url_history));
4804
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
728
4374
335f4ac3993a save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents: 4367
diff changeset
729 input_get_volume(&vol_l,&vol_r);
335f4ac3993a save volume between sessions
Paula Stanciu <paula.stanciu@gmail.com>
parents: 4367
diff changeset
730 cfg_db_set_int(db, NULL, "saved_volume", (vol_l<<8) | vol_r );
4804
cbaeab1f6378 revert 4769.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4787
diff changeset
731
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
732 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
733 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
734 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
735 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
736 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
737
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
738 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
739 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
740 } else
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
741 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
742 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
743 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
744 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
745
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
746 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
747
4526
8465e73d5584 Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal.
Matti Hamalainen <ccr@tnsp.org>
parents: 4523
diff changeset
748 if (!playlist_save(playlist, aud_paths[BMP_PATH_PLAYLIST_FILE])) {
8465e73d5584 Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal.
Matti Hamalainen <ccr@tnsp.org>
parents: 4523
diff changeset
749 g_warning("Could not save main playlist\n");
8465e73d5584 Check for NULL playlist pointer in configuration saving. This situation may occur if the process is interrupted by a signal.
Matti Hamalainen <ccr@tnsp.org>
parents: 4523
diff changeset
750 }
4352
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
751
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
752 /* 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
753 saved = NULL;
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
754 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
755 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
756 &saved, NULL)) {
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
757 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
758 }
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
759
ac1f6d211223 Split BmpConfig from main.c and main.h; move around some other stuff too
mf0102 <0102@gmx.at>
parents:
diff changeset
760 /* 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
761 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
762 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
763 }