Mercurial > audlegacy-plugins
annotate src/lirc/lirc_cfg.c @ 3047:4434b4c4a715
ported EsounD plugin
author | Andrew O. Shadoura <bugzilla@tut.by> |
---|---|
date | Fri, 17 Apr 2009 16:17:10 +0300 |
parents | 3134a0987162 |
children |
rev | line source |
---|---|
2279 | 1 #include <config.h> |
2 | |
3 #include <gtk/gtk.h> | |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2807
diff
changeset
|
4 #include <audlegacy/i18n.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2807
diff
changeset
|
5 #include <audlegacy/plugin.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2807
diff
changeset
|
6 #include <audlegacy/configdb.h> |
2279 | 7 |
8 #include "common.h" | |
9 | |
10 GtkWidget *lirc_cfg = NULL; | |
11 | |
12 gint b_enable_reconnect; | |
13 gint reconnect_timeout; | |
2305
738914331374
Add ability to enter track number using remote. (Bugzilla #115)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2279
diff
changeset
|
14 gchar *aosd_font = NULL; |
2279 | 15 |
16 void load_cfg(void) | |
17 { | |
18 ConfigDb *db; | |
19 db = aud_cfg_db_open(); | |
2807
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
20 aud_cfg_db_get_int(db, LIRC_CFGID, "enable_reconnect", &b_enable_reconnect); |
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
21 aud_cfg_db_get_int(db, LIRC_CFGID, "reconnect_timeout", &reconnect_timeout); |
2305
738914331374
Add ability to enter track number using remote. (Bugzilla #115)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2279
diff
changeset
|
22 if (!aud_cfg_db_get_string(db, "aosd", "text_fonts_name_0", &aosd_font)) |
2772
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
23 aosd_font = g_strdup("Sans 26"); |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
24 if (!reconnect_timeout) |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
25 { |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
26 reconnect_timeout = 5; |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
27 b_enable_reconnect = 1; |
fea021087241
enable lirc reconnect by default
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2305
diff
changeset
|
28 } |
2279 | 29 aud_cfg_db_close(db); |
30 } | |
31 | |
32 void save_cfg(void) | |
33 { | |
34 ConfigDb *db; | |
35 db = aud_cfg_db_open(); | |
2807
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
36 aud_cfg_db_set_int(db, LIRC_CFGID, "enable_reconnect", b_enable_reconnect); |
f06ec6936b7e
migrated some plugins to auto_CFGID
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2775
diff
changeset
|
37 aud_cfg_db_set_int(db, LIRC_CFGID, "reconnect_timeout", reconnect_timeout); |
2279 | 38 aud_cfg_db_close(db); |
39 } | |
40 | |
41 void configure(void) | |
42 { | |
43 if (lirc_cfg) | |
44 { | |
45 gtk_window_present(GTK_WINDOW(lirc_cfg)); | |
46 return; | |
47 } | |
48 load_cfg(); | |
49 lirc_cfg = create_lirc_cfg(); | |
50 gtk_widget_show_all(lirc_cfg); | |
51 } |