Mercurial > audlegacy-plugins
annotate src/statusicon/si_cfg.c @ 2425:ced4a5392948
made status plugin use the main mouse wheel setting when changing the volume
(Bugzilla #184)
author | Cristi Magherusan <majeru@atheme.org> |
---|---|
date | Mon, 25 Feb 2008 13:57:28 +0200 |
parents | b8da6a0b0da2 |
children | 4d6045c20cc5 |
rev | line source |
---|---|
857 | 1 /* |
2 * | |
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2007 | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License as published by the | |
7 * Free Software Foundation; either version 2 of the License, or (at your | |
8 * option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, but | |
11 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License along | |
16 * with this program; if not, write to the Free Software Foundation, Inc., | |
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
18 * | |
19 */ | |
20 | |
21 #include "si_cfg.h" | |
22 #include "si_common.h" | |
1975
00394f91e3c6
Updated plugins depending on old configdb to #include <audacious/plugin.h> so that bmp_cfg_db_* functions are still defined.
Ben Tucker <ben.tucker@gmail.com>
parents:
918
diff
changeset
|
23 #include <audacious/plugin.h> |
857 | 24 #include <audacious/configdb.h> |
25 | |
26 si_cfg_t si_cfg; | |
27 | |
28 | |
29 void | |
30 si_cfg_load ( void ) | |
31 { | |
2124 | 32 ConfigDb *cfgfile = aud_cfg_db_open(); |
857 | 33 |
2124 | 34 if ( !aud_cfg_db_get_int( cfgfile , "statusicon" , |
857 | 35 "rclick_menu" , &(si_cfg.rclick_menu) ) ) |
36 si_cfg.rclick_menu = SI_CFG_RCLICK_MENU_AUD; | |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
915
diff
changeset
|
37 |
2124 | 38 if ( !aud_cfg_db_get_int( cfgfile , "statusicon" , |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
915
diff
changeset
|
39 "scroll_action" , &(si_cfg.scroll_action) ) ) |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
915
diff
changeset
|
40 si_cfg.scroll_action = SI_CFG_SCROLL_ACTION_VOLUME; |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
41 |
2124 | 42 if ( !aud_cfg_db_get_bool( cfgfile , "statusicon" , |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
43 "mw_visib_prevstatus" , &(si_cfg.mw_visib_prevstatus) ) ) |
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
44 si_cfg.mw_visib_prevstatus = FALSE; |
2124 | 45 if ( !aud_cfg_db_get_bool( cfgfile , "statusicon" , |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
46 "pw_visib_prevstatus" , &(si_cfg.pw_visib_prevstatus) ) ) |
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
47 si_cfg.pw_visib_prevstatus = FALSE; |
2124 | 48 if ( !aud_cfg_db_get_bool( cfgfile , "statusicon" , |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
49 "ew_visib_prevstatus" , &(si_cfg.ew_visib_prevstatus) ) ) |
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
50 si_cfg.ew_visib_prevstatus = FALSE; |
2425
ced4a5392948
made status plugin use the main mouse wheel setting when changing the volume
Cristi Magherusan <majeru@atheme.org>
parents:
2124
diff
changeset
|
51 if ( !aud_cfg_db_get_int( cfgfile , "audacious" , |
ced4a5392948
made status plugin use the main mouse wheel setting when changing the volume
Cristi Magherusan <majeru@atheme.org>
parents:
2124
diff
changeset
|
52 "mouse_wheel_change" , &(si_cfg.volume_delta) ) ) |
ced4a5392948
made status plugin use the main mouse wheel setting when changing the volume
Cristi Magherusan <majeru@atheme.org>
parents:
2124
diff
changeset
|
53 si_cfg.volume_delta = 5; |
857 | 54 |
2124 | 55 aud_cfg_db_close( cfgfile ); |
857 | 56 return; |
57 } | |
58 | |
59 | |
60 void | |
61 si_cfg_save ( void ) | |
62 { | |
2124 | 63 ConfigDb *cfgfile = aud_cfg_db_open(); |
857 | 64 |
2124 | 65 aud_cfg_db_set_int( cfgfile , "statusicon" , |
857 | 66 "rclick_menu" , si_cfg.rclick_menu ); |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
67 |
2124 | 68 aud_cfg_db_set_int( cfgfile , "statusicon" , |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
915
diff
changeset
|
69 "scroll_action" , si_cfg.scroll_action ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
915
diff
changeset
|
70 |
2124 | 71 aud_cfg_db_set_bool( cfgfile , "statusicon" , |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
72 "mw_visib_prevstatus" , si_cfg.mw_visib_prevstatus ); |
2124 | 73 aud_cfg_db_set_bool( cfgfile , "statusicon" , |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
74 "pw_visib_prevstatus" , si_cfg.pw_visib_prevstatus ); |
2124 | 75 aud_cfg_db_set_bool( cfgfile , "statusicon" , |
915
1ccc7a9c7fc2
[svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents:
857
diff
changeset
|
76 "ew_visib_prevstatus" , si_cfg.ew_visib_prevstatus ); |
857 | 77 |
2124 | 78 aud_cfg_db_close( cfgfile ); |
857 | 79 return; |
80 } |