Mercurial > hg > xmms-sid
annotate src/xs_config.c @ 621:11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Sep 2007 00:21:05 +0000 |
parents | 0f2b7b2556ff |
children | 0bf32fa002bf |
rev | line source |
---|---|
1 | 1 /* |
3 | 2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS) |
1 | 3 |
4 Configuration dialog | |
5 | |
324 | 6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org> |
422 | 7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP) |
1 | 8 |
9 This program is free software; you can redistribute it and/or modify | |
10 it under the terms of the GNU General Public License as published by | |
11 the Free Software Foundation; either version 2 of the License, or | |
12 (at your option) any later version. | |
13 | |
14 This program is distributed in the hope that it will be useful, | |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 GNU General Public License for more details. | |
18 | |
412
7f694e5a1493
Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
19 You should have received a copy of the GNU General Public License along |
7f694e5a1493
Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
20 with this program; if not, write to the Free Software Foundation, Inc., |
7f694e5a1493
Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
1 | 22 */ |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
23 #include "xs_config.h" |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
24 |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
25 #ifdef AUDACIOUS_PLUGIN |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
26 #include <audacious/configdb.h> |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
27 #define XS_CONFIG_FILE ConfigDb |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
28 #define XS_CONFIG_OPEN bmp_cfg_db_open |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
29 #define XS_CONFIG_FREE bmp_cfg_db_close |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
30 #define XS_CONFIG_WRITE |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
31 |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
32 #define XS_CFG_SET_STRING bmp_cfg_db_set_string |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
33 #define XS_CFG_SET_FLOAT bmp_cfg_db_set_float |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
34 #define XS_CFG_SET_INT bmp_cfg_db_set_int |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
35 #define XS_CFG_SET_BOOL bmp_cfg_db_set_bool |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
36 #define XS_CFG_GET_STRING bmp_cfg_db_get_string |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
37 #define XS_CFG_GET_FLOAT bmp_cfg_db_get_float |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
38 #define XS_CFG_GET_INT bmp_cfg_db_get_int |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
39 #define XS_CFG_GET_BOOL bmp_cfg_db_get_bool |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
40 #else |
3 | 41 #include <xmms/configfile.h> |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
42 #define XS_CONFIG_FILE ConfigFile |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
43 #define XS_CONFIG_OPEN xmms_cfg_open_default_file |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
44 #define XS_CONFIG_FREE xmms_cfg_free |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
45 #define XS_CONFIG_WRITE xmms_cfg_write_default_file |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
46 |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
47 #define XS_CFG_SET_STRING xmms_cfg_write_string |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
48 #define XS_CFG_SET_FLOAT xmms_cfg_write_float |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
49 #define XS_CFG_SET_INT xmms_cfg_write_int |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
50 #define XS_CFG_SET_BOOL xmms_cfg_write_boolean |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
51 #define XS_CFG_GET_STRING xmms_cfg_read_string |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
52 #define XS_CFG_GET_FLOAT xmms_cfg_read_float |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
53 #define XS_CFG_GET_INT xmms_cfg_read_int |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
54 #define XS_CFG_GET_BOOL xmms_cfg_read_boolean |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
55 #endif |
3 | 56 #include <stdio.h> |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
57 #include <ctype.h> |
3 | 58 #include "xs_glade.h" |
59 #include "xs_interface.h" | |
63 | 60 #include "xs_support.h" |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
61 |
1 | 62 |
63 /* | |
3 | 64 * Global widgets |
1 | 65 */ |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
66 static GtkWidget *xs_configwin = NULL, |
362 | 67 *xs_sldb_fileselector = NULL, |
68 *xs_stil_fileselector = NULL, | |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
69 *xs_hvsc_selector = NULL, |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
70 *xs_filt_importselector = NULL, |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
71 *xs_filt_exportselector = NULL; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
72 |
296
4279cc6a3412
No need for variadic macros here.
Matti Hamalainen <ccr@tnsp.org>
parents:
292
diff
changeset
|
73 #define LUW(x) lookup_widget(xs_configwin, x) |
1 | 74 |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
75 /* Samplerates |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
76 */ |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
77 static gchar *xs_samplerates_table[] = { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
78 "8000", "11025", "22050", |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
79 "44100", "48000", "64000", |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
80 "96000" |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
81 }; |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
82 |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
83 static gint xs_nsamplerates_table = (sizeof(xs_samplerates_table) / sizeof(xs_samplerates_table[0])); |
1 | 84 |
85 /* | |
86 * Configuration specific stuff | |
87 */ | |
228
a9a5924eb10c
Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
88 XS_MUTEX(xs_cfg); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
89 struct t_xs_cfg xs_cfg; |
228
a9a5924eb10c
Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
90 |
608 | 91 static t_xs_cfg_item xs_cfgtable[] = { |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
92 { CTYPE_INT, &xs_cfg.audioBitsPerSample, "audioBitsPerSample" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
93 { CTYPE_INT, &xs_cfg.audioChannels, "audioChannels" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
94 { CTYPE_INT, &xs_cfg.audioFrequency, "audioFrequency" }, |
3 | 95 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
96 { CTYPE_BOOL, &xs_cfg.mos8580, "mos8580" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
97 { CTYPE_BOOL, &xs_cfg.forceModel, "forceModel" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
98 { CTYPE_BOOL, &xs_cfg.emulateFilters, "emulateFilters" }, |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
99 { CTYPE_FLOAT, &xs_cfg.sid1FilterFs, "filterFs" }, |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
100 { CTYPE_FLOAT, &xs_cfg.sid1FilterFm, "filterFm" }, |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
101 { CTYPE_FLOAT, &xs_cfg.sid1FilterFt, "filterFt" }, |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
102 { CTYPE_INT, &xs_cfg.memoryMode, "memoryMode" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
103 { CTYPE_INT, &xs_cfg.clockSpeed, "clockSpeed" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
104 { CTYPE_BOOL, &xs_cfg.forceSpeed, "forceSpeed" }, |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
105 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
106 { CTYPE_INT, &xs_cfg.playerEngine, "playerEngine" }, |
190 | 107 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
108 { CTYPE_INT, &xs_cfg.sid2Builder, "sid2Builder" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
109 { CTYPE_INT, &xs_cfg.sid2OptLevel, "sid2OptLevel" }, |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
110 { CTYPE_INT, &xs_cfg.sid2NFilterPresets, "sid2NFilterPresets" }, |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
111 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
112 { CTYPE_BOOL, &xs_cfg.oversampleEnable, "oversampleEnable" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
113 { CTYPE_INT, &xs_cfg.oversampleFactor, "oversampleFactor" }, |
3 | 114 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
115 { CTYPE_BOOL, &xs_cfg.playMaxTimeEnable, "playMaxTimeEnable" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
116 { CTYPE_BOOL, &xs_cfg.playMaxTimeUnknown, "playMaxTimeUnknown" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
117 { CTYPE_INT, &xs_cfg.playMaxTime, "playMaxTime" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
118 { CTYPE_BOOL, &xs_cfg.playMinTimeEnable, "playMinTimeEnable" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
119 { CTYPE_INT, &xs_cfg.playMinTime, "playMinTime" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
120 { CTYPE_BOOL, &xs_cfg.songlenDBEnable, "songlenDBEnable" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
121 { CTYPE_STR, &xs_cfg.songlenDBPath, "songlenDBPath" }, |
3 | 122 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
123 { CTYPE_BOOL, &xs_cfg.stilDBEnable, "stilDBEnable" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
124 { CTYPE_STR, &xs_cfg.stilDBPath, "stilDBPath" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
125 { CTYPE_STR, &xs_cfg.hvscPath, "hvscPath" }, |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
126 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
127 { CTYPE_INT, &xs_cfg.subsongControl, "subsongControl" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
128 { CTYPE_BOOL, &xs_cfg.detectMagic, "detectMagic" }, |
3 | 129 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
130 { CTYPE_BOOL, &xs_cfg.titleOverride, "titleOverride" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
131 { CTYPE_STR, &xs_cfg.titleFormat, "titleFormat" }, |
258
e255f23abf33
Automatic subtune changing options added to config.
Matti Hamalainen <ccr@tnsp.org>
parents:
245
diff
changeset
|
132 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
133 { CTYPE_BOOL, &xs_cfg.subAutoEnable, "subAutoEnable" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
134 { CTYPE_BOOL, &xs_cfg.subAutoMinOnly, "subAutoMinOnly" }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
135 { CTYPE_INT, &xs_cfg.subAutoMinTime, "subAutoMinTime" }, |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
136 }; |
3 | 137 |
228
a9a5924eb10c
Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
138 static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(t_xs_cfg_item)); |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
139 |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
140 |
608 | 141 static t_xs_wid_item xs_widtable[] = { |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
142 { WTYPE_BGROUP, CTYPE_INT, "cfg_res_16bit", &xs_cfg.audioBitsPerSample, XS_RES_16BIT }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
143 { WTYPE_BGROUP, CTYPE_INT, "cfg_res_8bit", &xs_cfg.audioBitsPerSample, XS_RES_8BIT }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
144 { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_mono", &xs_cfg.audioChannels, XS_CHN_MONO }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
145 { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_stereo", &xs_cfg.audioChannels, XS_CHN_STEREO }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
146 { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_autopan", &xs_cfg.audioChannels, XS_CHN_AUTOPAN }, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
147 { WTYPE_COMBO, CTYPE_INT, "cfg_samplerate", &xs_cfg.audioFrequency, XS_AUDIO_FREQ }, |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
148 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_oversample", &xs_cfg.oversampleEnable, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
149 { WTYPE_SPIN, CTYPE_INT, "cfg_oversample_factor",&xs_cfg.oversampleFactor, 0 }, |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
150 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
151 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sidplay1", &xs_cfg.playerEngine, XS_ENG_SIDPLAY1 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
152 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sidplay2", &xs_cfg.playerEngine, XS_ENG_SIDPLAY2 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
153 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_mem_real", &xs_cfg.memoryMode, XS_MPU_REAL }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
154 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_mem_banksw", &xs_cfg.memoryMode, XS_MPU_BANK_SWITCHING }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
155 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_mem_transrom", &xs_cfg.memoryMode, XS_MPU_TRANSPARENT_ROM }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
156 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_mem_playsid", &xs_cfg.memoryMode, XS_MPU_PLAYSID_ENVIRONMENT }, |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
157 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
158 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_mos8580", &xs_cfg.mos8580, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
159 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_sid_force", &xs_cfg.forceModel, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
160 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_clock_ntsc", &xs_cfg.clockSpeed, XS_CLOCK_NTSC }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
161 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_clock_pal", &xs_cfg.clockSpeed, XS_CLOCK_PAL }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
162 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_clock_force", &xs_cfg.forceSpeed, 0 }, |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
163 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_sp2_opt", &xs_cfg.sid2OptLevel, 0 }, |
87
94497283affa
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
78
diff
changeset
|
164 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
165 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sp2_resid", &xs_cfg.sid2Builder, XS_BLD_RESID }, |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
166 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sp2_hardsid", &xs_cfg.sid2Builder, XS_BLD_HARDSID }, |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
167 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
168 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_filters", &xs_cfg.emulateFilters, 0 }, |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
169 { WTYPE_SCALE, CTYPE_FLOAT, "cfg_sp1_filter_fs", &xs_cfg.sid1FilterFs, 0 }, |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
170 { WTYPE_SCALE, CTYPE_FLOAT, "cfg_sp1_filter_fm", &xs_cfg.sid1FilterFm, 0 }, |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
171 { WTYPE_SCALE, CTYPE_FLOAT, "cfg_sp1_filter_ft", &xs_cfg.sid1FilterFt, 0 }, |
64 | 172 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
173 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_maxtime_enable", &xs_cfg.playMaxTimeEnable, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
174 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_maxtime_unknown", &xs_cfg.playMaxTimeUnknown, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
175 { WTYPE_SPIN, CTYPE_INT, "cfg_maxtime", &xs_cfg.playMaxTime, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
176 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_mintime_enable", &xs_cfg.playMinTimeEnable, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
177 { WTYPE_SPIN, CTYPE_INT, "cfg_mintime", &xs_cfg.playMinTime, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
178 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_sld_enable", &xs_cfg.songlenDBEnable, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
179 { WTYPE_TEXT, CTYPE_STR, "cfg_sld_dbpath", &xs_cfg.songlenDBPath, 0 }, |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
180 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
181 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_stil_enable", &xs_cfg.stilDBEnable, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
182 { WTYPE_TEXT, CTYPE_STR, "cfg_stil_dbpath", &xs_cfg.stilDBPath, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
183 { WTYPE_TEXT, CTYPE_STR, "cfg_hvsc_path", &xs_cfg.hvscPath, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
184 |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
185 { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_none", &xs_cfg.subsongControl, XS_SSC_NONE }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
186 { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_seek", &xs_cfg.subsongControl, XS_SSC_SEEK }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
187 { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_popup", &xs_cfg.subsongControl, XS_SSC_POPUP }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
188 { WTYPE_BGROUP, CTYPE_INT, "cfg_subctrl_patch", &xs_cfg.subsongControl, XS_SSC_PATCH }, |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
189 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
190 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_detectmagic", &xs_cfg.detectMagic, 0 }, |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
191 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
192 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_ftitle_override", &xs_cfg.titleOverride, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
193 { WTYPE_TEXT, CTYPE_STR, "cfg_ftitle_format", &xs_cfg.titleFormat, 0 }, |
72
e3b205a6bc7e
Lots re-arranging and new code for upcoming modularization.
Matti Hamalainen <ccr@tnsp.org>
parents:
69
diff
changeset
|
194 |
360
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
195 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_subauto_enable", &xs_cfg.subAutoEnable, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
196 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_subauto_min_only", &xs_cfg.subAutoMinOnly, 0 }, |
3bea6584259f
Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
197 { WTYPE_SPIN, CTYPE_INT, "cfg_subauto_mintime", &xs_cfg.subAutoMinTime, 0 }, |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
198 }; |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
199 |
228
a9a5924eb10c
Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
200 static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(t_xs_wid_item)); |
1 | 201 |
202 | |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
203 /* Reset/initialize the configuration |
1 | 204 */ |
271
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
205 void xs_init_configuration(void) |
1 | 206 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
207 /* Lock configuration mutex */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
208 XSDEBUG("initializing configuration ...\n"); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
209 XS_MUTEX_LOCK(xs_cfg); |
3 | 210 |
621
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
211 xs_memset(&xs_cfg, 0, sizeof(xs_cfg)); |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
212 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
213 /* Initialize values with sensible defaults */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
214 xs_cfg.audioBitsPerSample = XS_RES_16BIT; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
215 xs_cfg.audioChannels = XS_CHN_MONO; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
216 xs_cfg.audioFrequency = XS_AUDIO_FREQ; |
3 | 217 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
218 xs_cfg.mos8580 = FALSE; |
361 | 219 xs_cfg.forceModel = FALSE; |
230 | 220 |
583
f63a50ec456c
SP1 filter widget names were incorrect, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
221 /* Filter values */ |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
222 xs_cfg.emulateFilters = TRUE; |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
223 xs_cfg.sid1FilterFs = XS_SIDPLAY1_FS; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
224 xs_cfg.sid1FilterFm = XS_SIDPLAY1_FM; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
225 xs_cfg.sid1FilterFt = XS_SIDPLAY1_FT; |
44
90cd38b28a72
Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
226 |
90cd38b28a72
Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
227 #ifdef HAVE_SIDPLAY2 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
228 xs_cfg.playerEngine = XS_ENG_SIDPLAY2; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
229 xs_cfg.memoryMode = XS_MPU_REAL; |
44
90cd38b28a72
Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
230 #else |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
231 #ifdef HAVE_SIDPLAY1 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
232 xs_cfg.playerEngine = XS_ENG_SIDPLAY1; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
233 xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING; |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
234 #else |
141 | 235 #error This should not happen! No emulator engines configured in! |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
236 #endif |
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
237 #endif |
44
90cd38b28a72
Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
238 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
239 xs_cfg.clockSpeed = XS_CLOCK_PAL; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
240 xs_cfg.forceSpeed = FALSE; |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
241 |
402
f997b79a7251
More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents:
392
diff
changeset
|
242 xs_cfg.sid2OptLevel = 0; |
621
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
243 xs_cfg.sid2NFilterPresets = 0; |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
244 |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
245 #ifdef HAVE_RESID_BUILDER |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
246 xs_cfg.sid2Builder = XS_BLD_RESID; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
247 #else |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
248 #ifdef HAVE_HARDSID_BUILDER |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
249 xs_cfg.sid2Builder = XS_BLD_HARDSID; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
250 #else |
89
b3f5b731a3fe
Fixed a problem with only libsidplay1 installed
Matti Hamalainen <ccr@tnsp.org>
parents:
87
diff
changeset
|
251 #ifdef HAVE_SIDPLAY2 |
271
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
252 #error This should not happen! No supported SIDPlay2 builders configured in! |
89
b3f5b731a3fe
Fixed a problem with only libsidplay1 installed
Matti Hamalainen <ccr@tnsp.org>
parents:
87
diff
changeset
|
253 #endif |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
254 #endif |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
255 #endif |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
256 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
257 xs_cfg.oversampleEnable = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
258 xs_cfg.oversampleFactor = XS_MIN_OVERSAMPLE; |
1 | 259 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
260 xs_cfg.playMaxTimeEnable = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
261 xs_cfg.playMaxTimeUnknown = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
262 xs_cfg.playMaxTime = 150; |
169 | 263 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
264 xs_cfg.playMinTimeEnable = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
265 xs_cfg.playMinTime = 15; |
3 | 266 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
267 xs_cfg.songlenDBEnable = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
268 xs_pstrcpy(&xs_cfg.songlenDBPath, "~/C64Music/Songlengths.txt"); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
269 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
270 xs_cfg.stilDBEnable = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
271 xs_pstrcpy(&xs_cfg.stilDBPath, "~/C64Music/DOCUMENTS/STIL.txt"); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
272 xs_pstrcpy(&xs_cfg.hvscPath, "~/C64Music"); |
3 | 273 |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
274 #ifdef HAVE_SONG_POSITION |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
275 xs_cfg.subsongControl = XS_SSC_PATCH; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
276 #else |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
277 xs_cfg.subsongControl = XS_SSC_POPUP; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
278 #endif |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
279 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
280 xs_cfg.detectMagic = FALSE; |
1 | 281 |
538 | 282 #if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN) |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
283 xs_cfg.titleOverride = FALSE; |
45 | 284 #else |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
285 xs_cfg.titleOverride = TRUE; |
45 | 286 #endif |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
287 xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n/%N][%m/%C]"); |
3 | 288 |
289 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
290 xs_cfg.subAutoEnable = FALSE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
291 xs_cfg.subAutoMinOnly = TRUE; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
292 xs_cfg.subAutoMinTime = 15; |
260 | 293 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
294 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
295 /* Unlock the configuration */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
296 XS_MUTEX_UNLOCK(xs_cfg); |
271
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
297 } |
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
298 |
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
299 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
300 /* Filter configuration handling |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
301 */ |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
302 #define XS_FITEM (4 * 2) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
303 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
304 static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, t_xs_sid2_filter *pResult) |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
305 { |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
306 gchar tmpKey[64], *tmpStr; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
307 gint i, j; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
308 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
309 /* Get fields from config */ |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
310 g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
311 if (!XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT, tmpKey, &(pResult->npoints))) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
312 return FALSE; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
313 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
314 g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
315 if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr)) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
316 return FALSE; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
317 |
605 | 318 pResult->name = g_strdup(tmpStr); |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
319 if (pResult->name == NULL) { |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
320 g_free(pResult); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
321 return FALSE; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
322 } |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
323 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
324 g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
325 if (!XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, &tmpStr)) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
326 return FALSE; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
327 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
328 for (i = 0, j = 0; i < pResult->npoints; i++, j += XS_FITEM) { |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
329 if (sscanf(&tmpStr[j], "%4x%4x", |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
330 &(pResult->points[i].x), |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
331 &(pResult->points[i].y)) != 2) |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
332 return FALSE; |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
333 } |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
334 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
335 return TRUE; |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
336 } |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
337 |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
338 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
339 static t_xs_sid2_filter * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
340 { |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
341 t_xs_sid2_filter *pResult; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
342 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
343 /* Allocate filter struct */ |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
344 if ((pResult = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
345 return NULL; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
346 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
347 if (!xs_filter_load_into(cfg, nFilter, pResult)) { |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
348 g_free(pResult); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
349 return NULL; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
350 } else |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
351 return pResult; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
352 } |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
353 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
354 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
355 static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter) |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
356 { |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
357 gchar *tmpValue, tmpKey[64]; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
358 gint i, j; |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
359 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
360 /* Allocate memory for value string */ |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
361 tmpValue = g_malloc(sizeof(gchar) * XS_FITEM * (pFilter->npoints + 1)); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
362 if (tmpValue == NULL) |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
363 return FALSE; |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
364 |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
365 /* Make value string */ |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
366 for (i = 0, j = 0; i < pFilter->npoints; i++, j += XS_FITEM) { |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
367 g_snprintf(&tmpValue[j], XS_FITEM+1, "%04x%04x", |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
368 pFilter->points[i].x, |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
369 pFilter->points[i].y); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
370 } |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
371 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
372 /* Write into the configuration */ |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
373 g_snprintf(tmpKey, sizeof(tmpKey), "filter%dName", nFilter); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
374 XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->name); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
375 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
376 g_snprintf(tmpKey, sizeof(tmpKey), "filter%dNPoints", nFilter); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
377 XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT, tmpKey, pFilter->npoints); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
378 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
379 g_snprintf(tmpKey, sizeof(tmpKey), "filter%dPoints", nFilter); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
380 XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, tmpKey, tmpValue); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
381 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
382 g_free(tmpValue); |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
383 return TRUE; |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
384 } |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
385 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
386 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
387 /* Filter exporting and importing. These functions export/import |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
388 * filter settings to/from SIDPlay2 INI-type files. |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
389 */ |
600 | 390 static gboolean xs_fgetitem(gchar *inLine, size_t *linePos, gchar sep, gchar *tmpStr, size_t tmpMax) |
391 { | |
392 size_t i; | |
393 for (i = 0; i < tmpMax && inLine[*linePos] && | |
394 !isspace(inLine[*linePos]) && | |
395 inLine[*linePos] != sep; i++, (*linePos)++) | |
396 tmpStr[i] = inLine[*linePos]; | |
397 tmpStr[i] = 0; | |
398 xs_findnext(inLine, linePos); | |
399 return (inLine[*linePos] == sep); | |
400 } | |
401 | |
620 | 402 static gboolean xs_filters_import(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint *nFilters) |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
403 { |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
404 FILE *inFile; |
600 | 405 gchar inLine[XS_BUF_SIZE], tmpStr[XS_BUF_SIZE]; |
406 gchar *sectName = NULL; | |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
407 gboolean sectBegin; |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
408 size_t lineNum, i; |
607
e22db8f24976
Temporarily fix compilation.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
409 t_xs_sid2_filter *tmpFilter; |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
410 |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
411 fprintf(stderr, "xs_filters_import(%s)\n", pcFilename); |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
412 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
413 if ((inFile = fopen(pcFilename, "ra")) == NULL) |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
414 return FALSE; |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
415 |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
416 fprintf(stderr, "importing...\n"); |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
417 |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
418 sectBegin = FALSE; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
419 lineNum = 0; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
420 while (fgets(inLine, XS_BUF_SIZE, inFile) != NULL) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
421 size_t linePos = 0; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
422 lineNum++; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
423 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
424 xs_findnext(inLine, &linePos); |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
425 if (isalpha(inLine[linePos]) && sectBegin) { |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
426 /* A new key/value pair */ |
600 | 427 if (!xs_fgetitem(inLine, &linePos, '=', tmpStr, XS_BUF_SIZE)) { |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
428 fprintf(stderr, "invalid line: %s [expect =']'", inLine); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
429 } else { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
430 linePos++; |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
431 xs_findnext(inLine, &linePos); |
600 | 432 if (!strncmp(tmpStr, "points", 6)) { |
433 fprintf(stderr, "points=%s\n", &inLine[linePos]); | |
434 } else if (!strncmp(tmpStr, "point", 5)) { | |
435 } else if (!strncmp(tmpStr, "type", 4)) { | |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
436 } else { |
600 | 437 fprintf(stderr, "warning: ukn def: %s @ %s\n", |
438 tmpStr, sectName); | |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
439 } |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
440 } |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
441 } else if (inLine[linePos] == '[') { |
600 | 442 /* Check for existing section */ |
443 if (sectBegin) { | |
604 | 444 /* Submit definition */ |
600 | 445 fprintf(stderr, "filter ends: %s\n", sectName); |
604 | 446 if ((tmpFilter = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) { |
447 fprintf(stderr, "could not allocate ..\n"); | |
448 } else { | |
449 | |
450 } | |
600 | 451 g_free(sectName); |
452 } | |
453 | |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
454 /* New filter(?) section starts */ |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
455 linePos++; |
600 | 456 for (i = 0; i < XS_BUF_SIZE && inLine[linePos] && inLine[linePos] != ']'; i++, linePos++) |
457 tmpStr[i] = inLine[linePos]; | |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
458 tmpStr[i] = 0; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
459 |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
460 if (inLine[linePos] != ']') { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
461 fprintf(stderr, "invalid! expected ']': %s\n", inLine); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
462 } else { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
463 sectName = strdup(tmpStr); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
464 fprintf(stderr, "filter: %s\n", sectName); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
465 sectBegin = TRUE; |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
466 } |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
467 } else if ((inLine[linePos] != ';') && (inLine[linePos] != 0)) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
468 /* Syntax error */ |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
469 fprintf(stderr, "syntax error: %s\n", inLine); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
470 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
471 } |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
472 |
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
473 fclose(inFile); |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
474 return TRUE; |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
475 } |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
476 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
477 |
620 | 478 static gboolean xs_filters_export(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint nFilters) |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
479 { |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
480 FILE *outFile; |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
481 t_xs_sid2_filter *f; |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
482 gint n; |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
483 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
484 /* Open/create the file */ |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
485 if ((outFile = fopen(pcFilename, "wa")) == NULL) |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
486 return FALSE; |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
487 |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
488 /* Header */ |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
489 fprintf(outFile, |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
490 "; SIDPlay2 compatible filter definition file\n" |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
491 "; Exported by " PACKAGE_STRING "\n\n"); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
492 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
493 /* Write each filter spec in "INI"-style format */ |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
494 for (n = 0; n < nFilters; n++) { |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
495 gint i; |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
496 f = pFilters[n]; |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
497 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
498 fprintf(outFile, |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
499 "[%s]\n" |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
500 "type=1\n" |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
501 "points=%d\n", |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
502 f->name, f->npoints); |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
503 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
504 for (i = 0; i < f->npoints; i++) { |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
505 fprintf(outFile, |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
506 "point%d=%d,%d\n", |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
507 i + 1, |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
508 f->points[i].x, |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
509 f->points[i].y); |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
510 } |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
511 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
512 fprintf(outFile, "\n"); |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
513 f++; |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
514 } |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
515 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
516 fclose(outFile); |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
517 return TRUE; |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
518 } |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
519 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
520 |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
521 /* Get the configuration (from file or default) |
271
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
522 */ |
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
523 void xs_read_configuration(void) |
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
524 { |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
525 XS_CONFIG_FILE *cfg; |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
526 gint i; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
527 gchar *tmpStr; |
271
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
528 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
529 /* Try to open the XMMS configuration file */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
530 XS_MUTEX_LOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
531 XSDEBUG("loading from config-file ...\n"); |
271
eebb38debe35
Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
532 |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
533 cfg = XS_CONFIG_OPEN(); |
50
dae6d3c2268d
Minor fixes, updated to support default XMMS configfile
Matti Hamalainen <ccr@tnsp.org>
parents:
45
diff
changeset
|
534 |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
535 if (cfg == NULL) { |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
536 XSDEBUG("Could not open configuration, trying to write defaults...\n"); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
537 xs_write_configuration(); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
538 return; |
3 | 539 } |
1 | 540 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
541 /* Read the new settings from XMMS configuration file */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
542 for (i = 0; i < xs_cfgtable_max; i++) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
543 switch (xs_cfgtable[i].itemType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
544 case CTYPE_INT: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
545 XS_CFG_GET_INT(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
546 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
547 (gint *) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
548 break; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
549 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
550 case CTYPE_BOOL: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
551 XS_CFG_GET_BOOL(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
552 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
553 (gboolean *) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
554 break; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
555 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
556 case CTYPE_FLOAT: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
557 XS_CFG_GET_FLOAT(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
558 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
559 (gfloat *) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
560 break; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
561 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
562 case CTYPE_STR: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
563 if (XS_CFG_GET_STRING(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
564 xs_cfgtable[i].itemName, (gchar **) &tmpStr)) { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
565 xs_pstrcpy((gchar **) xs_cfgtable[i].itemData, tmpStr); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
566 g_free(tmpStr); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
567 } |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
568 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
569 } |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
570 } |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
571 |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
572 /* Filters and presets are a special case */ |
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
573 xs_filter_load_into(cfg, 0, &xs_cfg.sid2Filter); |
621
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
574 |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
575 if (xs_cfg.sid2NFilterPresets > 0) { |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
576 xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(t_xs_sid2_filter *)); |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
577 if (!xs_cfg.sid2FilterPresets) { |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
578 xs_error(_("Allocation of sid2FilterPresets structure failed!\n")); |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
579 } else { |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
580 for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) { |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
581 xs_cfg.sid2FilterPresets[i] = xs_filter_load(cfg, i); |
11e24183ff23
Properly initialize xs_cfg struct; Check for 0 in sid2NFilterPresets.
Matti Hamalainen <ccr@tnsp.org>
parents:
620
diff
changeset
|
582 } |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
583 } |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
584 } |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
585 |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
586 XS_CONFIG_FREE(cfg); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
587 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
588 XS_MUTEX_UNLOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
589 XSDEBUG("OK\n"); |
1 | 590 } |
591 | |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
592 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
593 /* Write the current configuration |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
594 */ |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
595 gint xs_write_configuration(void) |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
596 { |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
597 XS_CONFIG_FILE *cfg; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
598 gint i; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
599 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
600 XSDEBUG("writing configuration ...\n"); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
601 XS_MUTEX_LOCK(xs_cfg); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
602 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
603 /* Try to open the XMMS configuration file */ |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
604 cfg = XS_CONFIG_OPEN(); |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
605 |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
606 #ifndef AUDACIOUS_PLUGIN |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
607 if (!cfg) cfg = xmms_cfg_new(); |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
608 if (!cfg) return -1; |
50
dae6d3c2268d
Minor fixes, updated to support default XMMS configfile
Matti Hamalainen <ccr@tnsp.org>
parents:
45
diff
changeset
|
609 #endif |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
610 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
611 /* Write the new settings to XMMS configuration file */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
612 for (i = 0; i < xs_cfgtable_max; i++) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
613 switch (xs_cfgtable[i].itemType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
614 case CTYPE_INT: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
615 XS_CFG_SET_INT(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
616 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
617 *(gint *) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
618 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
619 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
620 case CTYPE_BOOL: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
621 XS_CFG_SET_BOOL(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
622 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
623 *(gboolean *) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
624 break; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
625 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
626 case CTYPE_FLOAT: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
627 XS_CFG_SET_FLOAT(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
628 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
629 *(gfloat *) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
630 break; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
631 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
632 case CTYPE_STR: |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
633 XS_CFG_SET_STRING(cfg, XS_CONFIG_IDENT, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
634 xs_cfgtable[i].itemName, |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
635 *(gchar **) xs_cfgtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
636 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
637 } |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
638 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
639 |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
640 |
533
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
641 XS_CONFIG_WRITE(cfg); |
9ca430524698
Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
524
diff
changeset
|
642 XS_CONFIG_FREE(cfg); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
643 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
644 XS_MUTEX_UNLOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
645 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
646 return 0; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
647 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
648 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
649 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
650 /* Configuration panel was canceled |
1 | 651 */ |
612
32fc27395220
About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
652 XS_DEF_WINDOW_CLOSE(cfg_cancel, configwin) |
1 | 653 |
654 | |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
655 /* Configuration was accepted, save the settings |
1 | 656 */ |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
657 void xs_cfg_ok(void) |
1 | 658 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
659 gint i; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
660 gfloat tmpValue; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
661 gint tmpInt; |
616
1776da045588
Fix a warning about discarding const qualifier.
Matti Hamalainen <ccr@tnsp.org>
parents:
612
diff
changeset
|
662 const gchar *tmpStr; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
663 |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
664 /* Get lock on configuration */ |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
665 XS_MUTEX_LOCK(xs_cfg); |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
666 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
667 XSDEBUG("get data from widgets to config...\n"); |
3 | 668 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
669 for (i = 0; i < xs_widtable_max; i++) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
670 switch (xs_widtable[i].widType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
671 case WTYPE_BGROUP: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
672 /* Check if toggle-button is active */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
673 if (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
674 /* Yes, set the constant value */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
675 *((gint *) xs_widtable[i].itemData) = xs_widtable[i].itemSet; |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
676 } |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
677 break; |
63 | 678 |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
679 case WTYPE_COMBO: |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
680 /* Get text from text-widget */ |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
681 tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName))); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
682 if (sscanf(tmpStr, "%d", &tmpInt) != 1) |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
683 tmpInt = xs_widtable[i].itemSet; |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
684 |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
685 *((gint *) xs_widtable[i].itemData) = tmpInt; |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
686 break; |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
687 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
688 case WTYPE_SPIN: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
689 case WTYPE_SCALE: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
690 /* Get the value */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
691 switch (xs_widtable[i].widType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
692 case WTYPE_SPIN: |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
693 tmpValue = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName)))->value; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
694 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
695 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
696 case WTYPE_SCALE: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
697 tmpValue = gtk_range_get_adjustment(GTK_RANGE(LUW(xs_widtable[i].widName)))->value; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
698 break; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
699 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
700 default: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
701 tmpValue = -1; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
702 break; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
703 } |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
704 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
705 /* Set the value */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
706 switch (xs_widtable[i].itemType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
707 case CTYPE_INT: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
708 *((gint *) xs_widtable[i].itemData) = (gint) tmpValue; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
709 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
710 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
711 case CTYPE_FLOAT: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
712 *((gfloat *) xs_widtable[i].itemData) = tmpValue; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
713 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
714 } |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
715 break; |
1 | 716 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
717 case WTYPE_BUTTON: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
718 /* Check if toggle-button is active */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
719 *((gboolean *) xs_widtable[i].itemData) = |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
720 (GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName))->active); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
721 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
722 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
723 case WTYPE_TEXT: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
724 /* Get text from text-widget */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
725 xs_pstrcpy((gchar **) xs_widtable[i].itemData, |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
726 gtk_entry_get_text(GTK_ENTRY(LUW(xs_widtable[i].widName)))); |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
727 break; |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
728 } |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
729 } |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
730 |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
731 /* Get filter settings */ |
600 | 732 /* |
733 if (!xs_curve_get_points(XS_CURVE(LUW("")), &xs_cfg.sid2Filter.points, &xs_cfg.sid2Filter.npoints)) { | |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
734 xs_error(_("Warning: Could not get filter curve widget points!\n")); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
735 } |
600 | 736 */ |
1 | 737 |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
738 /* Release lock */ |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
739 XS_MUTEX_UNLOCK(xs_cfg); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
740 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
741 /* Close window */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
742 gtk_widget_destroy(xs_configwin); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
743 xs_configwin = NULL; |
147
a7abcda7a86c
SLDB, STIL and emulation engine settings are now updated
Matti Hamalainen <ccr@tnsp.org>
parents:
141
diff
changeset
|
744 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
745 /* Write settings */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
746 xs_write_configuration(); |
1 | 747 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
748 /* Re-initialize */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
749 xs_reinit(); |
1 | 750 } |
751 | |
752 | |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
753 /* HVSC songlength-database file selector response-functions |
3 | 754 */ |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
755 void xs_cfg_sldb_browse(GtkButton * button, gpointer user_data) |
1 | 756 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
757 (void) button; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
758 (void) user_data; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
759 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
760 if (xs_sldb_fileselector != NULL) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
761 gdk_window_raise(xs_sldb_fileselector->window); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
762 return; |
42 | 763 } |
764 | |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
765 xs_sldb_fileselector = create_xs_sldb_fs(); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
766 XS_MUTEX_LOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
767 gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_sldb_fileselector), xs_cfg.songlenDBPath); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
768 XS_MUTEX_UNLOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
769 gtk_widget_show(xs_sldb_fileselector); |
3 | 770 } |
771 | |
772 | |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
773 void xs_sldb_fs_ok(GtkButton *button, gpointer user_data) |
3 | 774 { |
579 | 775 (void) button; |
776 (void) user_data; | |
777 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
778 /* Selection was accepted! */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
779 gtk_entry_set_text(GTK_ENTRY(LUW("cfg_sld_dbpath")), |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
780 gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_sldb_fileselector))); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
781 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
782 /* Close file selector window */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
783 gtk_widget_destroy(xs_sldb_fileselector); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
784 xs_sldb_fileselector = NULL; |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
785 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
786 |
612
32fc27395220
About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
787 XS_DEF_WINDOW_CLOSE(sldb_fs_cancel, sldb_fileselector) |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
788 XS_DEF_WINDOW_DELETE(sldb_fs, sldb_fileselector) |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
789 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
790 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
791 /* STIL-database file selector response-functions |
1 | 792 */ |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
793 void xs_cfg_stil_browse(GtkButton * button, gpointer user_data) |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
794 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
795 (void) button; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
796 (void) user_data; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
797 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
798 if (xs_stil_fileselector != NULL) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
799 gdk_window_raise(xs_stil_fileselector->window); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
800 return; |
42 | 801 } |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
802 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
803 xs_stil_fileselector = create_xs_stil_fs(); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
804 XS_MUTEX_LOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
805 gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_stil_fileselector), xs_cfg.stilDBPath); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
806 XS_MUTEX_UNLOCK(xs_cfg); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
807 gtk_widget_show(xs_stil_fileselector); |
40
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
808 } |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
809 |
1788f4ce6a44
Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
810 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
811 void xs_stil_fs_ok(GtkButton *button, gpointer user_data) |
1 | 812 { |
579 | 813 (void) button; |
814 (void) user_data; | |
815 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
816 /* Selection was accepted! */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
817 gtk_entry_set_text(GTK_ENTRY(LUW("cfg_stil_dbpath")), |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
818 gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_stil_fileselector))); |
1 | 819 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
820 /* Close file selector window */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
821 gtk_widget_destroy(xs_stil_fileselector); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
822 xs_stil_fileselector = NULL; |
1 | 823 } |
824 | |
825 | |
612
32fc27395220
About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
826 XS_DEF_WINDOW_CLOSE(stil_fs_cancel, stil_fileselector) |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
827 XS_DEF_WINDOW_DELETE(stil_fs, stil_fileselector) |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
828 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
829 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
830 /* HVSC location selector response-functions |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
831 */ |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
832 void xs_cfg_hvsc_browse(GtkButton * button, gpointer user_data) |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
833 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
834 (void) button; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
835 (void) user_data; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
836 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
837 if (xs_hvsc_selector != NULL) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
838 gdk_window_raise(xs_hvsc_selector->window); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
839 return; |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
840 } |
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
841 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
842 xs_hvsc_selector = create_xs_hvsc_fs(); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
843 XS_MUTEX_LOCK(xs_cfg); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
844 gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_selector), xs_cfg.hvscPath); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
845 XS_MUTEX_UNLOCK(xs_cfg); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
846 gtk_widget_show(xs_hvsc_selector); |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
847 } |
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
848 |
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
849 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
850 void xs_hvsc_fs_ok(GtkButton *button, gpointer user_data) |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
851 { |
579 | 852 (void) button; |
853 (void) user_data; | |
854 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
855 /* Selection was accepted! */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
856 gtk_entry_set_text(GTK_ENTRY(LUW("cfg_hvsc_path")), |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
857 gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_hvsc_selector))); |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
858 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
859 /* Close file selector window */ |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
860 gtk_widget_destroy(xs_hvsc_selector); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
861 xs_hvsc_selector = NULL; |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
862 } |
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
863 |
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
864 |
612
32fc27395220
About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
865 XS_DEF_WINDOW_CLOSE(hvsc_fs_cancel, hvsc_selector) |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
866 XS_DEF_WINDOW_DELETE(hvsc_fs, hvsc_selector) |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
867 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
868 |
578 | 869 /* Filter handling |
870 */ | |
871 void xs_cfg_sp1_filter_reset(GtkButton * button, gpointer user_data) | |
872 { | |
873 (void) button; | |
874 (void) user_data; | |
875 | |
583
f63a50ec456c
SP1 filter widget names were incorrect, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
876 gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fs"))), XS_SIDPLAY1_FS); |
f63a50ec456c
SP1 filter widget names were incorrect, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
877 gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_fm"))), XS_SIDPLAY1_FM); |
f63a50ec456c
SP1 filter widget names were incorrect, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
878 gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_sp1_filter_ft"))), XS_SIDPLAY1_FT); |
578 | 879 } |
880 | |
881 | |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
882 void xs_cfg_sp2_filter_update(XSCurve *curve, t_xs_sid2_filter *f) |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
883 { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
884 assert(curve); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
885 assert(f); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
886 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
887 xs_curve_reset(curve); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
888 xs_curve_set_range(curve, 0,0, XS_SIDPLAY2_NFPOINTS, XS_SIDPLAY2_FMAX); |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
889 if (!xs_curve_set_points(curve, f->points, f->npoints)) { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
890 // FIXME |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
891 xs_error(_("Warning: Could not set filter curve widget points!\n")); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
892 } |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
893 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
894 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
895 |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
896 void xs_cfg_sp2_presets_update(void) |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
897 { |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
898 GList *tmpList = NULL; |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
899 gint i; |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
900 |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
901 for (i = 0; i < xs_cfg.sid2NFilterPresets; i++) { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
902 tmpList = g_list_append(tmpList, |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
903 (gpointer) xs_cfg.sid2FilterPresets[i]->name); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
904 } |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
905 |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
906 gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_sp2_filter_combo")), tmpList); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
907 g_list_free(tmpList); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
908 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
909 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
910 |
578 | 911 void xs_cfg_sp2_filter_load(GtkButton *button, gpointer user_data) |
912 { | |
620 | 913 const gchar *tmpStr; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
914 gint i, j; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
915 |
582
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
916 (void) button; |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
917 (void) user_data; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
918 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
919 XS_MUTEX_LOCK(xs_cfg); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
920 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
921 tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry"))); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
922 for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
923 if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
924 j = i; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
925 break; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
926 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
927 } |
583
f63a50ec456c
SP1 filter widget names were incorrect, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
928 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
929 if (j != -1) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
930 fprintf(stderr, "Updating from '%s'\n", tmpStr); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
931 xs_cfg_sp2_filter_update( |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
932 XS_CURVE(LUW("cfg_sp2_filter_curve")), |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
933 xs_cfg.sid2FilterPresets[i]); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
934 } else { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
935 /* error/warning: no such filter preset */ |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
936 fprintf(stderr, "No such filter preset '%s'!\n", tmpStr); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
937 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
938 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
939 XS_MUTEX_UNLOCK(xs_cfg); |
578 | 940 } |
941 | |
942 | |
943 void xs_cfg_sp2_filter_save(GtkButton *button, gpointer user_data) | |
944 { | |
582
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
945 /* |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
946 1) check if textentry matches any current filter name |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
947 yes) ask if saving over ok? |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
948 no) ... |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
949 |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
950 2) save current filter to the name |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
951 */ |
620 | 952 const gchar *tmpStr; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
953 gint i, j; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
954 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
955 (void) button; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
956 (void) user_data; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
957 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
958 XS_MUTEX_LOCK(xs_cfg); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
959 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
960 tmpStr = gtk_entry_get_text(GTK_ENTRY(LUW("cfg_sp2_filter_combo_entry"))); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
961 for (i = 0, j = -1; i < xs_cfg.sid2NFilterPresets; i++) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
962 if (!strcmp(tmpStr, xs_cfg.sid2FilterPresets[i]->name)) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
963 j = i; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
964 break; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
965 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
966 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
967 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
968 if (j != -1) { |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
969 fprintf(stderr, "Found, confirm overwrite?\n"); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
970 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
971 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
972 fprintf(stderr, "saving!\n"); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
973 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
974 xs_cfg_sp2_presets_update(); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
975 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
976 XS_MUTEX_UNLOCK(xs_cfg); |
578 | 977 } |
978 | |
979 | |
980 void xs_cfg_sp2_filter_delete(GtkButton *button, gpointer user_data) | |
981 { | |
582
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
982 (void) button; |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
983 (void) user_data; |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
984 /* |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
985 1) confirm |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
986 2) delete |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
987 */ |
578 | 988 } |
989 | |
990 | |
991 void xs_cfg_sp2_filter_import(GtkButton *button, gpointer user_data) | |
992 { | |
582
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
993 (void) button; |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
994 (void) user_data; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
995 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
996 if (xs_filt_importselector != NULL) { |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
997 gdk_window_raise(xs_filt_importselector->window); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
998 return; |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
999 } |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1000 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1001 xs_filt_importselector = create_xs_filter_import_fs(); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1002 gtk_widget_show(xs_filt_importselector); |
578 | 1003 } |
1004 | |
1005 | |
1006 void xs_filter_import_fs_ok(GtkButton *button, gpointer user_data) | |
1007 { | |
620 | 1008 const gchar *tmpStr; |
582
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
1009 (void) button; |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
1010 (void) user_data; |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1011 |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1012 XS_MUTEX_LOCK(xs_cfg); |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1013 |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1014 /* Selection was accepted! */ |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1015 tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_importselector)); |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1016 xs_filters_import(tmpStr, xs_cfg.sid2FilterPresets, &xs_cfg.sid2NFilterPresets); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1017 xs_cfg_sp2_presets_update(); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1018 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1019 /* Close file selector window */ |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1020 gtk_widget_destroy(xs_filt_importselector); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1021 xs_filt_importselector = NULL; |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1022 XS_MUTEX_UNLOCK(xs_cfg); |
578 | 1023 } |
1024 | |
1025 | |
612
32fc27395220
About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
1026 XS_DEF_WINDOW_CLOSE(filter_import_fs_cancel, filt_importselector) |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1027 XS_DEF_WINDOW_DELETE(filter_import_fs, filt_importselector) |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1028 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1029 |
590 | 1030 void xs_cfg_sp2_filter_export(GtkButton *button, gpointer user_data) |
1031 { | |
1032 (void) button; | |
1033 (void) user_data; | |
1034 | |
1035 if (xs_filt_exportselector != NULL) { | |
1036 gdk_window_raise(xs_filt_exportselector->window); | |
1037 return; | |
1038 } | |
1039 | |
1040 xs_filt_exportselector = create_xs_filter_export_fs(); | |
1041 gtk_widget_show(xs_filt_exportselector); | |
1042 } | |
1043 | |
1044 | |
578 | 1045 void xs_filter_export_fs_ok(GtkButton *button, gpointer user_data) |
1046 { | |
620 | 1047 const gchar *tmpStr; |
582
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
1048 (void) button; |
f58eb35438c6
Outline plans for rest of the filter config functionality in comments;
Matti Hamalainen <ccr@tnsp.org>
parents:
579
diff
changeset
|
1049 (void) user_data; |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1050 |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1051 XS_MUTEX_LOCK(xs_cfg); |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1052 |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1053 /* Selection was accepted! */ |
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1054 tmpStr = gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_filt_exportselector)); |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1055 xs_filters_export(tmpStr, xs_cfg.sid2FilterPresets, xs_cfg.sid2NFilterPresets); |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1056 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1057 /* Close file selector window */ |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1058 gtk_widget_destroy(xs_filt_exportselector); |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1059 xs_filt_exportselector = NULL; |
592
7ae251af5f83
Some macro magic for simplifying the repetitive code.
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1060 XS_MUTEX_UNLOCK(xs_cfg); |
578 | 1061 } |
1062 | |
1063 | |
612
32fc27395220
About window wasn't handling delete_event properly, fixed; Cleaned up event handling a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
608
diff
changeset
|
1064 XS_DEF_WINDOW_CLOSE(filter_export_fs_cancel, filt_exportselector) |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1065 XS_DEF_WINDOW_DELETE(filter_export_fs, filt_exportselector) |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1066 |
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1067 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1068 /* Selection toggle handlers |
127
ddb513bd2610
Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents:
116
diff
changeset
|
1069 */ |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1070 void xs_cfg_emu_filters_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1071 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1072 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1073 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1074 (void) user_data; |
172 | 1075 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1076 gtk_widget_set_sensitive(LUW("cfg_filters_notebook"), isActive); |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1077 } |
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1078 |
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1079 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1080 void xs_cfg_ftitle_override_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1081 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1082 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1083 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1084 (void) user_data; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1085 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1086 gtk_widget_set_sensitive(LUW("cfg_ftitle_box"), isActive); |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1087 } |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1088 |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1089 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1090 void xs_cfg_emu_sidplay1_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1091 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1092 (void) togglebutton; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1093 (void) user_data; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1094 } |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1095 |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1096 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1097 void xs_cfg_emu_sidplay2_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1098 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1099 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1100 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1101 (void) user_data; |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1102 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1103 gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive); |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1104 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1105 gtk_widget_set_sensitive(LUW("cfg_sidplay2_frame"), isActive); |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1106 gtk_widget_set_sensitive(LUW("cfg_emu_sp2_opt"), isActive); |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1107 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1108 gtk_widget_set_sensitive(LUW("cfg_chn_autopan"), !isActive); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1109 |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1110 #ifdef HAVE_RESID_BUILDER |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1111 gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), isActive); |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1112 #else |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1113 gtk_widget_set_sensitive(LUW("cfg_emu_sp2_resid"), FALSE); |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1114 #endif |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1115 |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1116 #ifdef HAVE_HARDSID_BUILDER |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1117 gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), isActive); |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1118 #else |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1119 gtk_widget_set_sensitive(LUW("cfg_emu_sp2_hardsid"), FALSE); |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1120 #endif |
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1121 } |
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1122 |
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1123 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1124 void xs_cfg_oversample_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1125 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1126 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1127 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1128 (void) user_data; |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1129 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1130 gtk_widget_set_sensitive(LUW("cfg_oversample_box"), isActive); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1131 } |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1132 |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1133 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1134 void xs_cfg_mintime_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1135 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1136 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1137 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1138 (void) user_data; |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1139 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1140 gtk_widget_set_sensitive(LUW("cfg_mintime_box"), isActive); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1141 } |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1142 |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1143 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1144 void xs_cfg_maxtime_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1145 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1146 gboolean isActive = GTK_TOGGLE_BUTTON(LUW("cfg_maxtime_enable"))->active; |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1147 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1148 (void) togglebutton; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1149 (void) user_data; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1150 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1151 gtk_widget_set_sensitive(LUW("cfg_maxtime_unknown"), isActive); |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1152 gtk_widget_set_sensitive(LUW("cfg_maxtime_box"), isActive); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1153 } |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1154 |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1155 |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1156 void xs_cfg_sldb_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1157 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1158 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1159 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1160 (void) user_data; |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1161 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1162 gtk_widget_set_sensitive(LUW("cfg_sld_box"), isActive); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1163 } |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1164 |
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1165 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1166 void xs_cfg_stil_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
260 | 1167 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1168 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1169 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1170 (void) user_data; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1171 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1172 gtk_widget_set_sensitive(LUW("cfg_stil_box1"), isActive); |
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1173 gtk_widget_set_sensitive(LUW("cfg_stil_box2"), isActive); |
260 | 1174 } |
1175 | |
1176 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1177 void xs_cfg_subauto_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
260 | 1178 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1179 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1180 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1181 (void) user_data; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1182 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1183 gtk_widget_set_sensitive(LUW("cfg_subauto_min_only"), isActive); |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1184 gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1185 } |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1186 |
260 | 1187 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1188 void xs_cfg_subauto_min_only_toggled(GtkToggleButton * togglebutton, gpointer user_data) |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1189 { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1190 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active && |
362 | 1191 GTK_TOGGLE_BUTTON(LUW("cfg_subauto_enable"))->active; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1192 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1193 (void) user_data; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1194 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1195 gtk_widget_set_sensitive(LUW("cfg_subauto_box"), isActive); |
260 | 1196 } |
1197 | |
172 | 1198 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1199 void xs_cfg_mintime_changed(GtkEditable * editable, gpointer user_data) |
172 | 1200 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1201 gint tmpValue; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1202 GtkAdjustment *tmpAdj; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1203 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1204 (void) user_data; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1205 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1206 tmpAdj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_maxtime"))); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1207 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1208 tmpValue = (gint) gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(editable))->value; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1209 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1210 if (tmpValue > tmpAdj->value) |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1211 gtk_adjustment_set_value(tmpAdj, tmpValue); |
172 | 1212 } |
1213 | |
1214 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1215 void xs_cfg_maxtime_changed(GtkEditable * editable, gpointer user_data) |
172 | 1216 { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1217 gint tmpValue; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1218 GtkAdjustment *tmpAdj; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1219 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1220 (void) user_data; |
341
e065deeb086f
Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
324
diff
changeset
|
1221 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1222 tmpAdj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(LUW("cfg_mintime"))); |
177
6e350784aa57
Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1223 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1224 tmpValue = (gint) gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(editable))->value; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1225 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1226 if (tmpValue < tmpAdj->value) |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1227 gtk_adjustment_set_value(tmpAdj, tmpValue); |
172 | 1228 } |
1229 | |
1230 | |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1231 XS_DEF_WINDOW_DELETE(configwin, configwin) |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1232 |
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1233 |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1234 /* Execute the configuration panel |
1 | 1235 */ |
1236 void xs_configure(void) | |
1237 { | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1238 gint i; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1239 gfloat tmpValue; |
579 | 1240 gchar tmpStr[64]; |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1241 GList *tmpList = NULL; |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1242 GtkWidget *tmpCurve; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1243 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1244 /* Check if the window already exists */ |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1245 if (xs_configwin) { |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1246 gdk_window_raise(xs_configwin->window); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1247 return; |
1 | 1248 } |
1249 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1250 /* Create the window */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1251 xs_configwin = create_xs_configwin(); |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1252 |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1253 /* Get lock on configuration */ |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1254 XS_MUTEX_LOCK(xs_cfg); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1255 |
593
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1256 /* Add samplerates */ |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1257 for (i = 0; i < xs_nsamplerates_table; i++) { |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1258 tmpList = g_list_append (tmpList, |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1259 (gpointer) xs_samplerates_table[i]); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1260 } |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1261 gtk_combo_set_popdown_strings(GTK_COMBO(LUW("cfg_samplerate_combo")), tmpList); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1262 g_list_free(tmpList); |
91ca76e6c23f
More work towards filter configuration.
Matti Hamalainen <ccr@tnsp.org>
parents:
592
diff
changeset
|
1263 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1264 /* Create the custom filter curve widget for libSIDPlay2 */ |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1265 xs_cfg_sp2_presets_update(); |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1266 tmpCurve = xs_curve_new(); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1267 xs_cfg_sp2_filter_update(XS_CURVE(tmpCurve), &xs_cfg.sid2Filter); |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1268 gtk_widget_set_name(tmpCurve, "cfg_sp2_filter_curve"); |
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1269 gtk_widget_ref(tmpCurve); |
552
9494fee305fa
Config item changes; Unfinished filter preset handling functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
548
diff
changeset
|
1270 gtk_object_set_data_full(GTK_OBJECT(xs_configwin), |
577
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1271 "cfg_sp2_filter_curve", tmpCurve, (GtkDestroyNotify) gtk_widget_unref); |
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1272 gtk_widget_show(tmpCurve); |
fdddab8f0c1b
Scrubbing through the filter configuration code; Configuration dialog
Matti Hamalainen <ccr@tnsp.org>
parents:
553
diff
changeset
|
1273 gtk_container_add(GTK_CONTAINER(LUW("cfg_sp2_filter_frame")), tmpCurve); |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1274 |
349
b5e54614b35a
More unused argument warning removal, bit of code for filter editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
346
diff
changeset
|
1275 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1276 /* Based on available optional parts, gray out options */ |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
1277 #ifndef HAVE_SIDPLAY1 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1278 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay1"), FALSE); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1279 gtk_widget_set_sensitive(LUW("cfg_box_sidplay1"), FALSE); |
42 | 1280 #endif |
1281 | |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1282 #ifndef HAVE_SIDPLAY2 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1283 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2"), FALSE); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1284 gtk_widget_set_sensitive(LUW("cfg_box_sidplay2"), FALSE); |
75
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
1285 #endif |
653c9b0d1320
SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents:
72
diff
changeset
|
1286 |
542 | 1287 #if !defined(HAVE_XMMSEXTRA) && !defined(AUDACIOUS_PLUGIN) |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1288 gtk_widget_set_sensitive(LUW("cfg_ftitle_override"), FALSE); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1289 xs_cfg.titleOverride = TRUE; |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1290 #endif |
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1291 |
102
cf3bbfdb90ac
Disable song-pos patch option when song-pos support is not compiled in.
Matti Hamalainen <ccr@tnsp.org>
parents:
89
diff
changeset
|
1292 #ifndef HAVE_SONG_POSITION |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1293 gtk_widget_set_sensitive(LUW("cfg_subctrl_patch"), FALSE); |
102
cf3bbfdb90ac
Disable song-pos patch option when song-pos support is not compiled in.
Matti Hamalainen <ccr@tnsp.org>
parents:
89
diff
changeset
|
1294 #endif |
78
ab522ab65c85
Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
1295 |
542 | 1296 #ifdef AUDACIOUS_PLUGIN |
1297 gtk_widget_set_sensitive(LUW("cfg_detectmagic"), FALSE); | |
1298 #endif | |
1299 | |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1300 /* Update the widget sensitivities */ |
548
ba80c052e425
Configuration widget naming cleanups and GUI-related improvements;
Matti Hamalainen <ccr@tnsp.org>
parents:
542
diff
changeset
|
1301 gtk_widget_set_sensitive(LUW("cfg_resid_frame"), FALSE); |
511
e2c7ee8998da
reSID sampling options in GUI. Not yet used, because libSIDPlay2 API does
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1302 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1303 xs_cfg_emu_filters_toggled((GtkToggleButton *) LUW("cfg_emu_filters"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1304 xs_cfg_ftitle_override_toggled((GtkToggleButton *) LUW("cfg_ftitle_override"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1305 xs_cfg_emu_sidplay1_toggled((GtkToggleButton *) LUW("cfg_emu_sidplay1"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1306 xs_cfg_emu_sidplay2_toggled((GtkToggleButton *) LUW("cfg_emu_sidplay2"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1307 xs_cfg_oversample_toggled((GtkToggleButton *) LUW("cfg_oversample"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1308 xs_cfg_mintime_enable_toggled((GtkToggleButton *) LUW("cfg_mintime_enable"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1309 xs_cfg_maxtime_enable_toggled((GtkToggleButton *) LUW("cfg_maxtime_enable"), NULL); |
589
a437571d0fc5
Work on GUI and filter config code.
Matti Hamalainen <ccr@tnsp.org>
parents:
583
diff
changeset
|
1310 xs_cfg_sldb_enable_toggled((GtkToggleButton *) LUW("cfg_sld_enable"), NULL); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1311 xs_cfg_stil_enable_toggled((GtkToggleButton *) LUW("cfg_stil_enable"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1312 xs_cfg_subauto_enable_toggled((GtkToggleButton *) LUW("cfg_subauto_enable"), NULL); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1313 xs_cfg_subauto_min_only_toggled((GtkToggleButton *) LUW("cfg_subauto_min_only"), NULL); |
77
3fca0b13a80a
Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1314 |
3 | 1315 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1316 /* Set current data to widgets */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1317 for (i = 0; i < xs_widtable_max; i++) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1318 switch (xs_widtable[i].widType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1319 case WTYPE_BGROUP: |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1320 assert(xs_widtable[i].itemType == CTYPE_INT); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1321 /* Check if current value matches the given one */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1322 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)), |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1323 (*((gint *) xs_widtable[i].itemData) == xs_widtable[i].itemSet)); |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1324 break; |
63 | 1325 |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1326 case WTYPE_COMBO: |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1327 assert(xs_widtable[i].itemType == CTYPE_INT); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1328 g_snprintf(tmpStr, sizeof(tmpStr), "%d", *(gint *) xs_widtable[i].itemData); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1329 gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)), tmpStr); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1330 break; |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1331 |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1332 case WTYPE_SPIN: |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1333 case WTYPE_SCALE: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1334 /* Get the value */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1335 switch (xs_widtable[i].itemType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1336 case CTYPE_INT: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1337 tmpValue = (gfloat) * ((gint *) xs_widtable[i].itemData); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1338 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1339 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1340 case CTYPE_FLOAT: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1341 tmpValue = *((gfloat *) xs_widtable[i].itemData); |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1342 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1343 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1344 default: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1345 tmpValue = -1; |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1346 assert(0); |
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1347 break; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1348 } |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1349 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1350 /* Set the value */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1351 switch (xs_widtable[i].widType) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1352 case WTYPE_SPIN: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1353 gtk_adjustment_set_value(gtk_spin_button_get_adjustment |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1354 (GTK_SPIN_BUTTON(LUW(xs_widtable[i].widName))), tmpValue); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1355 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1356 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1357 case WTYPE_SCALE: |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1358 gtk_adjustment_set_value(gtk_range_get_adjustment |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1359 (GTK_RANGE(LUW(xs_widtable[i].widName))), tmpValue); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1360 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1361 } |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1362 break; |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1363 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1364 case WTYPE_BUTTON: |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1365 assert(xs_widtable[i].itemType == CTYPE_BOOL); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1366 /* Set toggle-button */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1367 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(LUW(xs_widtable[i].widName)), |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1368 *((gboolean *) xs_widtable[i].itemData)); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1369 break; |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1370 |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1371 case WTYPE_TEXT: |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1372 assert(xs_widtable[i].itemType == CTYPE_STR); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1373 /* Set text to text-widget */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1374 if (*(gchar **) xs_widtable[i].itemData != NULL) { |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1375 gtk_entry_set_text(GTK_ENTRY(LUW(xs_widtable[i].widName)), |
487
6357b7fe5b0d
Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
1376 *(gchar **) xs_widtable[i].itemData); |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1377 } |
57
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1378 break; |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1379 } |
85811bcd049e
Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents:
50
diff
changeset
|
1380 } |
228
a9a5924eb10c
Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
1381 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1382 /* Release the configuration */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1383 XS_MUTEX_UNLOCK(xs_cfg); |
228
a9a5924eb10c
Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
1384 |
359
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1385 /* Show the widget */ |
b1a858b8cb1a
Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1386 gtk_widget_show(xs_configwin); |
1 | 1387 } |