annotate src/xs_config.c @ 542:48fdc91bfea2

Fixes.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 21 Feb 2007 05:45:04 +0000
parents ce17211fae73
children ba80c052e425
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 Configuration dialog
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
324
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 308
diff changeset
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
422
d2e6682d3ef8 Copyright year update
Matti Hamalainen <ccr@tnsp.org>
parents: 412
diff changeset
7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 (at your option) any later version.
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 GNU General Public License for more details.
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
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
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
56 #include <stdio.h>
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
57 #include "xs_glade.h"
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
58 #include "xs_interface.h"
63
05220299c6e8 Kuumaa paskaa
Matti Hamalainen <ccr@tnsp.org>
parents: 57
diff changeset
59 #include "xs_support.h"
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 362
diff changeset
60 #include "xs_curve.h"
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 /*
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
63 * Global widgets
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 */
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
65 static GtkWidget *xs_configwin = NULL,
362
743167033d0a More indentation cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 361
diff changeset
66 *xs_sldb_fileselector = NULL,
743167033d0a More indentation cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 361
diff changeset
67 *xs_stil_fileselector = NULL,
743167033d0a More indentation cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 361
diff changeset
68 *xs_hvsc_pathselector = NULL;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
69
296
4279cc6a3412 No need for variadic macros here.
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
70 #define LUW(x) lookup_widget(xs_configwin, x)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 /*
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 * Configuration specific stuff
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 */
228
a9a5924eb10c Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
76 XS_MUTEX(xs_cfg);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
77 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
78
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
79 t_xs_cfg_item xs_cfgtable[] = {
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
80 { CTYPE_INT, &xs_cfg.audioBitsPerSample, "audioBitsPerSample" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
81 { CTYPE_INT, &xs_cfg.audioChannels, "audioChannels" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
82 { CTYPE_INT, &xs_cfg.audioFrequency, "audioFrequency" },
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
83
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
84 { CTYPE_BOOL, &xs_cfg.mos8580, "mos8580" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
85 { CTYPE_BOOL, &xs_cfg.forceModel, "forceModel" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
86 { CTYPE_BOOL, &xs_cfg.emulateFilters, "emulateFilters" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
87 { CTYPE_FLOAT, &xs_cfg.filterFs, "filterFs" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
88 { CTYPE_FLOAT, &xs_cfg.filterFm, "filterFm" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
89 { CTYPE_FLOAT, &xs_cfg.filterFt, "filterFt" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
90 { CTYPE_INT, &xs_cfg.memoryMode, "memoryMode" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
91 { CTYPE_INT, &xs_cfg.clockSpeed, "clockSpeed" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
92 { 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
93
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
94 { CTYPE_INT, &xs_cfg.playerEngine, "playerEngine" },
190
e036ad3350d6 Cleanup
Matti Hamalainen <ccr@tnsp.org>
parents: 177
diff changeset
95
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
96 { CTYPE_INT, &xs_cfg.sid2Builder, "sid2Builder" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
97 { CTYPE_INT, &xs_cfg.sid2OptLevel, "sid2OptLevel" },
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 72
diff changeset
98
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
99 { CTYPE_BOOL, &xs_cfg.oversampleEnable, "oversampleEnable" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
100 { CTYPE_INT, &xs_cfg.oversampleFactor, "oversampleFactor" },
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
101
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
102 { CTYPE_BOOL, &xs_cfg.playMaxTimeEnable, "playMaxTimeEnable" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
103 { CTYPE_BOOL, &xs_cfg.playMaxTimeUnknown, "playMaxTimeUnknown" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
104 { CTYPE_INT, &xs_cfg.playMaxTime, "playMaxTime" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
105 { CTYPE_BOOL, &xs_cfg.playMinTimeEnable, "playMinTimeEnable" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
106 { CTYPE_INT, &xs_cfg.playMinTime, "playMinTime" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
107 { CTYPE_BOOL, &xs_cfg.songlenDBEnable, "songlenDBEnable" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
108 { CTYPE_STR, &xs_cfg.songlenDBPath, "songlenDBPath" },
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
109
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
110 { CTYPE_BOOL, &xs_cfg.stilDBEnable, "stilDBEnable" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
111 { CTYPE_STR, &xs_cfg.stilDBPath, "stilDBPath" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
112 { CTYPE_STR, &xs_cfg.hvscPath, "hvscPath" },
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
113
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
114 { CTYPE_INT, &xs_cfg.subsongControl, "subsongControl" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
115 { CTYPE_BOOL, &xs_cfg.detectMagic, "detectMagic" },
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
116
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
117 { CTYPE_BOOL, &xs_cfg.titleOverride, "titleOverride" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
118 { CTYPE_STR, &xs_cfg.titleFormat, "titleFormat" },
258
e255f23abf33 Automatic subtune changing options added to config.
Matti Hamalainen <ccr@tnsp.org>
parents: 245
diff changeset
119
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
120 { CTYPE_BOOL, &xs_cfg.subAutoEnable, "subAutoEnable" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
121 { CTYPE_BOOL, &xs_cfg.subAutoMinOnly, "subAutoMinOnly" },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
122 { CTYPE_INT, &xs_cfg.subAutoMinTime, "subAutoMinTime" },
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
123 };
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
124
228
a9a5924eb10c Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
125 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
126
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
127
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
128 t_xs_wid_item xs_widtable[] = {
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
129 { 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
130 { 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
131 { 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
132 { 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
133 { 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
134 { 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
135 { 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
136 { 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
137
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
138 { 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
139 { 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
140 { 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
141 { 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
142 { 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
143 { 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
144
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
145 { 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
146 { 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
147 { 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
148 { 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
149 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_clock_force", &xs_cfg.forceSpeed, 0 },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
150 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_sidplay2_opt", &xs_cfg.sid2OptLevel, 0 },
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 78
diff changeset
151
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
152 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sidplay2_resid",&xs_cfg.sid2Builder, XS_BLD_RESID },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
153 { WTYPE_BGROUP, CTYPE_INT, "cfg_emu_sidplay2_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
154
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
155 { WTYPE_BUTTON, CTYPE_BOOL, "cfg_emu_filters", &xs_cfg.emulateFilters, 0 },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
156 { WTYPE_SCALE, CTYPE_FLOAT, "cfg_emu_filt_fs", &xs_cfg.filterFs, 0 },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
157 { WTYPE_SCALE, CTYPE_FLOAT, "cfg_emu_filt_fm", &xs_cfg.filterFm, 0 },
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
158 { WTYPE_SCALE, CTYPE_FLOAT, "cfg_emu_filt_ft", &xs_cfg.filterFt, 0 },
64
d3bb914e3af3 Fixes for sidplay2 stuff
Matti Hamalainen <ccr@tnsp.org>
parents: 63
diff changeset
159
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
160 { 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
161 { 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
162 { 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
163 { 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
164 { 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
165 { 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
166 { 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
167
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
168 { 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
169 { 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
170 { 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
171
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
172 { 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
173 { 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
174 { 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
175 { 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
176
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
177 { 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
178
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
179 { 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
180 { 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
181
360
3bea6584259f Indentation fixes and SID model forcing
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
182 { 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
183 { 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
184 { 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
185 };
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
186
228
a9a5924eb10c Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
187 static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(t_xs_wid_item));
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 /*
271
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
191 * Reset/initialize the configuration
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 */
271
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
193 void xs_init_configuration(void)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
195 /* Lock configuration mutex */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
196 XSDEBUG("initializing configuration ...\n");
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
197 XS_MUTEX_LOCK(xs_cfg);
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
198
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
199 /* Initialize values with sensible defaults */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
200 xs_cfg.audioBitsPerSample = XS_RES_16BIT;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
201 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
202 xs_cfg.audioFrequency = XS_AUDIO_FREQ;
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
203
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
204 xs_cfg.mos8580 = FALSE;
361
178e197f6f9a Forcemodel
Matti Hamalainen <ccr@tnsp.org>
parents: 360
diff changeset
205 xs_cfg.forceModel = FALSE;
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 228
diff changeset
206
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
207 xs_cfg.emulateFilters = TRUE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
208 xs_cfg.filterFs = XS_SIDPLAY1_FS;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
209 xs_cfg.filterFm = XS_SIDPLAY1_FM;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
210 xs_cfg.filterFt = XS_SIDPLAY1_FT;
44
90cd38b28a72 Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents: 42
diff changeset
211
90cd38b28a72 Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents: 42
diff changeset
212 #ifdef HAVE_SIDPLAY2
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
213 xs_cfg.playerEngine = XS_ENG_SIDPLAY2;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
214 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
215 #else
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
216 #ifdef HAVE_SIDPLAY1
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
217 xs_cfg.playerEngine = XS_ENG_SIDPLAY1;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
218 xs_cfg.memoryMode = XS_MPU_BANK_SWITCHING;
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
219 #else
141
7327a985aee8 Typofixes
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
220 #error This should not happen! No emulator engines configured in!
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
221 #endif
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
222 #endif
44
90cd38b28a72 Various fixes and transmogrifying for dual emulation engine environment
Matti Hamalainen <ccr@tnsp.org>
parents: 42
diff changeset
223
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
224 xs_cfg.clockSpeed = XS_CLOCK_PAL;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
225 xs_cfg.forceSpeed = FALSE;
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 72
diff changeset
226
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
227 xs_cfg.sid2OptLevel = 0;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
228 #ifdef HAVE_RESID_BUILDER
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
229 xs_cfg.sid2Builder = XS_BLD_RESID;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
230 #else
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
231 #ifdef HAVE_HARDSID_BUILDER
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
232 xs_cfg.sid2Builder = XS_BLD_HARDSID;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
233 #else
89
b3f5b731a3fe Fixed a problem with only libsidplay1 installed
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
234 #ifdef HAVE_SIDPLAY2
271
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
235 #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
236 #endif
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
237 #endif
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
238 #endif
75
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 72
diff changeset
239
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
240 xs_cfg.oversampleEnable = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
241 xs_cfg.oversampleFactor = XS_MIN_OVERSAMPLE;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
243 xs_cfg.playMaxTimeEnable = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
244 xs_cfg.playMaxTimeUnknown = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
245 xs_cfg.playMaxTime = 150;
169
676ec1a1ab93 Minimum playtime option
Matti Hamalainen <ccr@tnsp.org>
parents: 161
diff changeset
246
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
247 xs_cfg.playMinTimeEnable = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
248 xs_cfg.playMinTime = 15;
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
249
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
250 xs_cfg.songlenDBEnable = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
251 xs_pstrcpy(&xs_cfg.songlenDBPath, "~/C64Music/Songlengths.txt");
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
252
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
253 xs_cfg.stilDBEnable = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
254 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
255 xs_pstrcpy(&xs_cfg.hvscPath, "~/C64Music");
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
256
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
257 #ifdef HAVE_SONG_POSITION
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
258 xs_cfg.subsongControl = XS_SSC_PATCH;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
259 #else
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
260 xs_cfg.subsongControl = XS_SSC_POPUP;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
261 #endif
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
262
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
263 xs_cfg.detectMagic = FALSE;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
264
538
ce17211fae73 Audacious kludges
Matti Hamalainen <ccr@tnsp.org>
parents: 533
diff changeset
265 #if defined(HAVE_XMMSEXTRA) || defined(AUDACIOUS_PLUGIN)
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
266 xs_cfg.titleOverride = FALSE;
45
84214a409d19 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
267 #else
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
268 xs_cfg.titleOverride = TRUE;
45
84214a409d19 Minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 44
diff changeset
269 #endif
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
270 xs_pstrcpy(&xs_cfg.titleFormat, "%p - %t (%c) [%n/%N][%m/%C]");
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
271
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
272
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
273 xs_cfg.subAutoEnable = FALSE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
274 xs_cfg.subAutoMinOnly = TRUE;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
275 xs_cfg.subAutoMinTime = 15;
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
276
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
277
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
278 /* Unlock the configuration */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
279 XS_MUTEX_UNLOCK(xs_cfg);
271
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
280 }
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
281
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
282
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
283 /*
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
284 * Get the configuration (from file or default)
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
285 */
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
286 void xs_read_configuration(void)
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
287 {
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
288 XS_CONFIG_FILE *cfg;
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
289 gint i;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
290 gchar *tmpStr;
271
eebb38debe35 Separate xs_init_configuration() from xs_read_configuration()
Matti Hamalainen <ccr@tnsp.org>
parents: 260
diff changeset
291
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
292 /* Try to open the XMMS configuration file */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
293 XS_MUTEX_LOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
294 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
295
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
296 cfg = XS_CONFIG_OPEN();
50
dae6d3c2268d Minor fixes, updated to support default XMMS configfile
Matti Hamalainen <ccr@tnsp.org>
parents: 45
diff changeset
297
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
298 if (cfg == NULL) {
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
299 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
300 xs_write_configuration();
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
301 return;
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
302 }
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
303
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
304 /* Read the new settings from XMMS configuration file */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
305 for (i = 0; i < xs_cfgtable_max; i++) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
306 switch (xs_cfgtable[i].itemType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
307 case CTYPE_INT:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
308 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
309 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
310 (gint *) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
311 break;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
312
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
313 case CTYPE_BOOL:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
314 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
315 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
316 (gboolean *) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
317 break;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
318
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
319 case CTYPE_FLOAT:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
320 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
321 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
322 (gfloat *) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
323 break;
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
324
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
325 case CTYPE_STR:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
326 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
327 xs_cfgtable[i].itemName, (gchar **) &tmpStr)) {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
328 xs_pstrcpy((gchar **) xs_cfgtable[i].itemData, tmpStr);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
329 g_free(tmpStr);
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
330 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
331 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
332 }
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
333 }
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
334
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
335 XS_CONFIG_FREE(cfg);
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
336
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
337 XS_MUTEX_UNLOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
338 XSDEBUG("OK\n");
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
339 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
340
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
341
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
342
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
343 /*
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
344 * Write the current configuration
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
345 */
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
346 gint xs_write_configuration(void)
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
347 {
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
348 XS_CONFIG_FILE *cfg;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
349 gint i;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
350
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
351 XSDEBUG("writing configuration ...\n");
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
352 XS_MUTEX_LOCK(xs_cfg);
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
353
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
354 /* Try to open the XMMS configuration file */
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
355 cfg = XS_CONFIG_OPEN();
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
356
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
357 #ifndef AUDACIOUS_PLUGIN
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
358 if (!cfg) cfg = xmms_cfg_new();
50
dae6d3c2268d Minor fixes, updated to support default XMMS configfile
Matti Hamalainen <ccr@tnsp.org>
parents: 45
diff changeset
359 #endif
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
360
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
361 /* Write the new settings to XMMS configuration file */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
362 for (i = 0; i < xs_cfgtable_max; i++) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
363 switch (xs_cfgtable[i].itemType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
364 case CTYPE_INT:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
365 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
366 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
367 *(gint *) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
368 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
369
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
370 case CTYPE_BOOL:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
371 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
372 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
373 *(gboolean *) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
374 break;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
375
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
376 case CTYPE_FLOAT:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
377 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
378 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
379 *(gfloat *) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
380 break;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
381
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
382 case CTYPE_STR:
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
383 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
384 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
385 *(gchar **) xs_cfgtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
386 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
387 }
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
388 }
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
389
533
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
390 XS_CONFIG_WRITE(cfg);
9ca430524698 Audacious-related cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
391 XS_CONFIG_FREE(cfg);
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
392
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
393 XS_MUTEX_UNLOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
394
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
395 return 0;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
396 }
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
397
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
398
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
399 /*
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
400 * Configuration panel was canceled
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
401 */
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
402 void xs_cfg_cancel(void)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
403 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
404 gtk_widget_destroy(xs_configwin);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
405 xs_configwin = NULL;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
406 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
407
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
408
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
409 /*
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
410 * Configuration was accepted (OK), save the settings
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
411 */
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
412 void xs_cfg_ok(void)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
413 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
414 gint i;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
415 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
416 gint tmpInt;
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
417 gchar *tmpStr;
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
418
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
419 /* 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
420 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
421
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
422 XSDEBUG("get data from widgets to config...\n");
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
423
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
424 for (i = 0; i < xs_widtable_max; i++) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
425 switch (xs_widtable[i].widType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
426 case WTYPE_BGROUP:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
427 /* Check if toggle-button is active */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
428 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
429 /* Yes, set the constant value */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
430 *((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
431 }
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
432 break;
63
05220299c6e8 Kuumaa paskaa
Matti Hamalainen <ccr@tnsp.org>
parents: 57
diff changeset
433
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
434 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
435 /* 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
436 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
437 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
438 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
439
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
440 *((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
441 break;
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
442
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
443 case WTYPE_SPIN:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
444 case WTYPE_SCALE:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
445 /* Get the value */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
446 switch (xs_widtable[i].widType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
447 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
448 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
449 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
450
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
451 case WTYPE_SCALE:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
452 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
453 break;
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
454
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
455 default:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
456 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
457 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
458 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
459
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
460 /* Set the value */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
461 switch (xs_widtable[i].itemType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
462 case CTYPE_INT:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
463 *((gint *) xs_widtable[i].itemData) = (gint) tmpValue;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
464 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
465
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
466 case CTYPE_FLOAT:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
467 *((gfloat *) xs_widtable[i].itemData) = tmpValue;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
468 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
469 }
57
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
470 break;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
471
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
472 case WTYPE_BUTTON:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
473 /* Check if toggle-button is active */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
474 *((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
475 (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
476 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
477
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
478 case WTYPE_TEXT:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
479 /* Get text from text-widget */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
480 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
481 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
482 break;
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
483 }
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
484 }
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
485
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
486 /* Release lock */
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
487 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
488
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
489 /* Close window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
490 gtk_widget_destroy(xs_configwin);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
491 xs_configwin = NULL;
147
a7abcda7a86c SLDB, STIL and emulation engine settings are now updated
Matti Hamalainen <ccr@tnsp.org>
parents: 141
diff changeset
492
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
493 /* Write settings */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
494 xs_write_configuration();
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
495
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
496 /* Re-initialize */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
497 xs_reinit();
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
498 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
499
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
500
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
501 /*
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
502 * Reset filter settings to defaults
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
503 */
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
504 void xs_cfg_filter_reset(GtkButton * button, gpointer user_data)
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
505 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
506 (void) button;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
507 (void) user_data;
57
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
508
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
509 gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_emu_filt_fs"))), XS_SIDPLAY1_FS);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
510 gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_emu_filt_fm"))), XS_SIDPLAY1_FM);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
511 gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(LUW("cfg_emu_filt_ft"))), XS_SIDPLAY1_FT);
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
512 }
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
513
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
514
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
515 /*
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
516 * HVSC songlength-database file selector response-functions
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
517 */
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
518 void xs_cfg_sld_dbbrowse(GtkButton * button, gpointer user_data)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
519 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
520 (void) button;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
521 (void) user_data;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
522
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
523 if (xs_sldb_fileselector != NULL) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
524 gdk_window_raise(xs_sldb_fileselector->window);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
525 return;
42
Matti Hamalainen <ccr@tnsp.org>
parents: 40
diff changeset
526 }
Matti Hamalainen <ccr@tnsp.org>
parents: 40
diff changeset
527
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
528 xs_sldb_fileselector = create_xs_sldbfileselector();
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
529 XS_MUTEX_LOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
530 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
531 XS_MUTEX_UNLOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
532 gtk_widget_show(xs_sldb_fileselector);
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
533 }
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
534
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
535
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
536 void xs_cfg_sldb_fs_ok(void)
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
537 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
538 /* Selection was accepted! */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
539 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
540 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
541
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
542 /* Close file selector window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
543 gtk_widget_destroy(xs_sldb_fileselector);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
544 xs_sldb_fileselector = NULL;
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
545 }
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
546
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
547
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
548 void xs_cfg_sldb_fs_cancel(void)
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 /* Close file selector window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
551 gtk_widget_destroy(xs_sldb_fileselector);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
552 xs_sldb_fileselector = NULL;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
553 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
554
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
555
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
556 /*
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
557 * STIL-database file selector response-functions
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
558 */
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
559 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
560 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
561 (void) button;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
562 (void) user_data;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
563
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
564 if (xs_stil_fileselector != NULL) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
565 gdk_window_raise(xs_stil_fileselector->window);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
566 return;
42
Matti Hamalainen <ccr@tnsp.org>
parents: 40
diff changeset
567 }
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
568
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
569 xs_stil_fileselector = create_xs_stilfileselector();
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
570 XS_MUTEX_LOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
571 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
572 XS_MUTEX_UNLOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
573 gtk_widget_show(xs_stil_fileselector);
40
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
574 }
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
575
1788f4ce6a44 Numerous changes towards 0.8
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
576
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
577 void xs_cfg_stil_fs_ok(void)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
578 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
579 /* Selection was accepted! */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
580 gtk_entry_set_text(GTK_ENTRY(LUW("cfg_stil_dbpath")),
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
581 gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_stil_fileselector)));
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
582
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
583 /* Close file selector window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
584 gtk_widget_destroy(xs_stil_fileselector);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
585 xs_stil_fileselector = NULL;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
586 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
587
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
588
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
589 void xs_cfg_stil_fs_cancel(void)
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
590 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
591 /* Close file selector window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
592 gtk_widget_destroy(xs_stil_fileselector);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
593 xs_stil_fileselector = NULL;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
594 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
595
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
596
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
597 /*
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
598 * HVSC location selector response-functions
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
599 */
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
600 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
601 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
602 (void) button;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
603 (void) user_data;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
604
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
605 if (xs_hvsc_pathselector != NULL) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
606 gdk_window_raise(xs_hvsc_pathselector->window);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
607 return;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
608 }
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
609
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
610 xs_hvsc_pathselector = create_xs_hvscpathselector();
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
611 XS_MUTEX_LOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
612 gtk_file_selection_set_filename(GTK_FILE_SELECTION(xs_hvsc_pathselector), xs_cfg.hvscPath);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
613 XS_MUTEX_UNLOCK(xs_cfg);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
614 gtk_widget_show(xs_hvsc_pathselector);
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
615 }
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
616
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
617
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
618 void xs_cfg_hvsc_fs_ok(void)
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
619 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
620 /* Selection was accepted! */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
621 gtk_entry_set_text(GTK_ENTRY(LUW("cfg_hvsc_path")),
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
622 gtk_file_selection_get_filename(GTK_FILE_SELECTION(xs_hvsc_pathselector)));
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
623
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
624 /* Close file selector window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
625 gtk_widget_destroy(xs_hvsc_pathselector);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
626 xs_hvsc_pathselector = NULL;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
627 }
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
628
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
629
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
630 void xs_cfg_hvsc_fs_cancel(void)
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
631 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
632 /* Close file selector window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
633 gtk_widget_destroy(xs_hvsc_pathselector);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
634 xs_hvsc_pathselector = NULL;
127
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
635 }
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
636
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
637
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
638 /*
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
639 * Selection toggle handlers
ddb513bd2610 Improved audio format support, now supported formats are "queried" from
Matti Hamalainen <ccr@tnsp.org>
parents: 116
diff changeset
640 */
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
641 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
642 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
643 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
644
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
645 (void) user_data;
172
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
646
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
647 gtk_widget_set_sensitive(LUW("cfg_filters_notebook"), isActive);
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
648 }
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
649
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
650
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
651 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
652 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
653 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
654
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
655 (void) user_data;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
656
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
657 gtk_widget_set_sensitive(LUW("cfg_ftitle_format"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
658 gtk_widget_set_sensitive(LUW("cfg_ftitle_desc1"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
659 gtk_widget_set_sensitive(LUW("cfg_ftitle_desc2"), isActive);
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
660 }
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
661
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
662
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
663 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
664 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
665 (void) togglebutton;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
666 (void) user_data;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
667 }
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
668
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
669
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
670 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
671 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
672 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
673
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
674 (void) user_data;
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
675
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
676 gtk_widget_set_sensitive(LUW("cfg_emu_mem_real"), isActive);
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
677
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
678 gtk_widget_set_sensitive(LUW("cfg_sidplay2_grp"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
679 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_opt"), isActive);
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
680
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
681 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
682
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
683 #ifdef HAVE_RESID_BUILDER
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
684 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), isActive);
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
685 #else
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
686 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_resid"), FALSE);
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
687 #endif
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
688
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
689 #ifdef HAVE_HARDSID_BUILDER
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
690 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_hardsid"), isActive);
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
691 #else
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
692 gtk_widget_set_sensitive(LUW("cfg_emu_sidplay2_hardsid"), FALSE);
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
693 #endif
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
694 }
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
695
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
696
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
697 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
698 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
699 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
700
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
701 (void) user_data;
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
702
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
703 gtk_widget_set_sensitive(LUW("cfg_oversample_factor"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
704 gtk_widget_set_sensitive(LUW("cfg_oversample_label1"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
705 gtk_widget_set_sensitive(LUW("cfg_oversample_label2"), isActive);
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
706 }
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
707
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
708
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
709 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
710 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
711 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
712
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
713 (void) user_data;
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
714
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
715 gtk_widget_set_sensitive(LUW("cfg_mintime"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
716 gtk_widget_set_sensitive(LUW("cfg_mintime_label1"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
717 gtk_widget_set_sensitive(LUW("cfg_mintime_label2"), isActive);
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
718 }
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
719
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
720
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
721 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
722 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
723 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
724
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
725 (void) togglebutton;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
726 (void) user_data;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
727
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
728 gtk_widget_set_sensitive(LUW("cfg_maxtime_unknown"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
729 gtk_widget_set_sensitive(LUW("cfg_maxtime"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
730 gtk_widget_set_sensitive(LUW("cfg_maxtime_label1"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
731 gtk_widget_set_sensitive(LUW("cfg_maxtime_label2"), isActive);
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
732 }
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
733
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
734
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
735 void xs_cfg_sld_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
736 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
737 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
738
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
739 (void) user_data;
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
740
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
741 gtk_widget_set_sensitive(LUW("cfg_sld_dbpath"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
742 gtk_widget_set_sensitive(LUW("cfg_sld_dbbrowse"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
743 gtk_widget_set_sensitive(LUW("cfg_sld_label1"), isActive);
177
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
744 }
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
745
6e350784aa57 Various cleanups. Min-playtime option now works. Configuration has more
Matti Hamalainen <ccr@tnsp.org>
parents: 172
diff changeset
746
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
747 void xs_cfg_stil_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
748 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
749 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
750
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
751 (void) user_data;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
752
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
753 gtk_widget_set_sensitive(LUW("cfg_stil_dbpath"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
754 gtk_widget_set_sensitive(LUW("cfg_stil_browse"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
755 gtk_widget_set_sensitive(LUW("cfg_stil_label1"), isActive);
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
756
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
757 gtk_widget_set_sensitive(LUW("cfg_hvsc_path"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
758 gtk_widget_set_sensitive(LUW("cfg_hvsc_browse"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
759 gtk_widget_set_sensitive(LUW("cfg_hvsc_label1"), isActive);
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
760 }
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
761
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
762
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
763 void xs_cfg_subauto_enable_toggled(GtkToggleButton * togglebutton, gpointer user_data)
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
764 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
765 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
766
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
767 (void) user_data;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
768
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
769 gtk_widget_set_sensitive(LUW("cfg_subauto_min_only"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
770 gtk_widget_set_sensitive(LUW("cfg_subauto_mintime"), isActive);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
771 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
772
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
773
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
774 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
775 {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
776 gboolean isActive = GTK_TOGGLE_BUTTON(togglebutton)->active &&
362
743167033d0a More indentation cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 361
diff changeset
777 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
778
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
779 (void) user_data;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
780
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
781 gtk_widget_set_sensitive(LUW("cfg_subauto_mintime"), isActive);
260
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
782 }
7a23dfef023d More subauto poking.
Matti Hamalainen <ccr@tnsp.org>
parents: 258
diff changeset
783
172
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
784
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
785 void xs_cfg_mintime_changed(GtkEditable * editable, gpointer user_data)
172
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
786 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
787 gint tmpValue;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
788 GtkAdjustment *tmpAdj;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
789
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
790 (void) user_data;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
791
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
792 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
793
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
794 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
795
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
796 if (tmpValue > tmpAdj->value)
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
797 gtk_adjustment_set_value(tmpAdj, tmpValue);
172
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
798 }
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
799
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
800
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
801 void xs_cfg_maxtime_changed(GtkEditable * editable, gpointer user_data)
172
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
802 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
803 gint tmpValue;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
804 GtkAdjustment *tmpAdj;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
805
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
806 (void) user_data;
341
e065deeb086f Removed 'unused argument' warnings, some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 324
diff changeset
807
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
808 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
809
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
810 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
811
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
812 if (tmpValue < tmpAdj->value)
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
813 gtk_adjustment_set_value(tmpAdj, tmpValue);
172
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
814 }
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
815
505da1389e5c Twiddling
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
816
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
817 /*
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
818 * Execute the configuration panel
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
819 */
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
820 void xs_configure(void)
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
821 {
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
822 gint i;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
823 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
824 gchar tmpStr[32];
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
825 GtkWidget *c;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
826
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
827 /* Check if the window already exists */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
828 if (xs_configwin != NULL) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
829 gdk_window_raise(xs_configwin->window);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
830 return;
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
831 }
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
832
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
833 /* Create the window */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
834 xs_configwin = create_xs_configwin();
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
835
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
836 /* 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
837 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
838
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
839 /* Create the custom filter curve widget for libSIDPlay2 */
503
070516a21ef4 Do not include curve widget
Matti Hamalainen <ccr@tnsp.org>
parents: 500
diff changeset
840 /*
370
df6f12a00305 Work on filter curve widget begins, based on GtkCurve widget from Gtk+ 1.2.10.
Matti Hamalainen <ccr@tnsp.org>
parents: 362
diff changeset
841 c = xs_curve_new();
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
842 gtk_widget_set_name(c, "cfg_filter2_curve");
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
843 gtk_widget_ref(c);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
844 gtk_object_set_data_full(GTK_OBJECT(xs_configwin), "cfg_filter2_curve", c, (GtkDestroyNotify) gtk_widget_unref);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
845 gtk_widget_show(c);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
846 gtk_box_pack_start(GTK_BOX(LUW("cfg_box_sidplay2")), c, TRUE, TRUE, 4);
503
070516a21ef4 Do not include curve widget
Matti Hamalainen <ccr@tnsp.org>
parents: 500
diff changeset
847 */
349
b5e54614b35a More unused argument warning removal, bit of code for filter editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
848
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
849 /* 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
850 #ifndef HAVE_SIDPLAY1
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
851 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
852 gtk_widget_set_sensitive(LUW("cfg_box_sidplay1"), FALSE);
42
Matti Hamalainen <ccr@tnsp.org>
parents: 40
diff changeset
853 #endif
Matti Hamalainen <ccr@tnsp.org>
parents: 40
diff changeset
854
77
3fca0b13a80a Configuration panel tweaking
Matti Hamalainen <ccr@tnsp.org>
parents: 75
diff changeset
855 #ifndef HAVE_SIDPLAY2
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
856 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
857 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
858 #endif
653c9b0d1320 SIDPlay2 support "works" now. Borked problems with threads.
Matti Hamalainen <ccr@tnsp.org>
parents: 72
diff changeset
859
542
Matti Hamalainen <ccr@tnsp.org>
parents: 538
diff changeset
860 #if !defined(HAVE_XMMSEXTRA) && !defined(AUDACIOUS_PLUGIN)
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
861 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
862 xs_cfg.titleOverride = TRUE;
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
863 #endif
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
864
102
cf3bbfdb90ac Disable song-pos patch option when song-pos support is not compiled in.
Matti Hamalainen <ccr@tnsp.org>
parents: 89
diff changeset
865 #ifndef HAVE_SONG_POSITION
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
866 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
867 #endif
78
ab522ab65c85 Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 77
diff changeset
868
542
Matti Hamalainen <ccr@tnsp.org>
parents: 538
diff changeset
869 #ifdef AUDACIOUS_PLUGIN
Matti Hamalainen <ccr@tnsp.org>
parents: 538
diff changeset
870 gtk_widget_set_sensitive(LUW("cfg_detectmagic"), FALSE);
Matti Hamalainen <ccr@tnsp.org>
parents: 538
diff changeset
871 #endif
Matti Hamalainen <ccr@tnsp.org>
parents: 538
diff changeset
872
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
873 /* Update the widget sensitivities */
511
e2c7ee8998da reSID sampling options in GUI. Not yet used, because libSIDPlay2 API does
Matti Hamalainen <ccr@tnsp.org>
parents: 503
diff changeset
874 gtk_widget_set_sensitive(LUW("cfg_resid_grp"), FALSE);
e2c7ee8998da reSID sampling options in GUI. Not yet used, because libSIDPlay2 API does
Matti Hamalainen <ccr@tnsp.org>
parents: 503
diff changeset
875
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
876 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
877 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
878 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
879 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
880 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
881 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
882 xs_cfg_maxtime_enable_toggled((GtkToggleButton *) LUW("cfg_maxtime_enable"), NULL);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
883 xs_cfg_sld_enable_toggled((GtkToggleButton *) LUW("cfg_sld_enable"), NULL);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
884 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
885 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
886 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
887
3
279b1e12df2b Updated to version 0.8-devel
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
888
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
889 /* Set current data to widgets */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
890 for (i = 0; i < xs_widtable_max; i++) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
891 switch (xs_widtable[i].widType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
892 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
893 assert(xs_widtable[i].itemType == CTYPE_INT);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
894 /* Check if current value matches the given one */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
895 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
896 (*((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
897 break;
63
05220299c6e8 Kuumaa paskaa
Matti Hamalainen <ccr@tnsp.org>
parents: 57
diff changeset
898
487
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
899 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
900 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
901 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
902 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
903 break;
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
904
57
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
905 case WTYPE_SPIN:
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
906 case WTYPE_SCALE:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
907 /* Get the value */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
908 switch (xs_widtable[i].itemType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
909 case CTYPE_INT:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
910 tmpValue = (gfloat) * ((gint *) xs_widtable[i].itemData);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
911 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
912
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
913 case CTYPE_FLOAT:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
914 tmpValue = *((gfloat *) xs_widtable[i].itemData);
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
915 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
916
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
917 default:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
918 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
919 assert(0);
6357b7fe5b0d Added new WTYPE_COMBO, the audio frequency selection now uses a combobox.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
920 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
921 }
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
922
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
923 /* Set the value */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
924 switch (xs_widtable[i].widType) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
925 case WTYPE_SPIN:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
926 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
927 (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
928 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
929
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
930 case WTYPE_SCALE:
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
931 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
932 (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
933 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
934 }
57
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
935 break;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
936
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
937 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
938 assert(xs_widtable[i].itemType == CTYPE_BOOL);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
939 /* Set toggle-button */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
940 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
941 *((gboolean *) xs_widtable[i].itemData));
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
942 break;
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
943
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
944 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
945 assert(xs_widtable[i].itemType == CTYPE_STR);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
946 /* Set text to text-widget */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
947 if (*(gchar **) xs_widtable[i].itemData != NULL) {
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
948 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
949 *(gchar **) xs_widtable[i].itemData);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
950 }
57
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
951 break;
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
952 }
85811bcd049e Improved, re-written configuration code and lots of minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 50
diff changeset
953 }
228
a9a5924eb10c Have and use a mutex for xs_cfg configuration structure.
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
954
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
955 /* Release the configuration */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
956 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
957
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
958 /* Show the widget */
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
959 gtk_widget_show(xs_configwin);
1
183e7cbc1036 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
960 }