Mercurial > audlegacy-plugins
annotate src/lirc/lirc_cfg.c @ 2444:fd16fdf87f53
Check for Audacious >= 1.5.0 instead.
| author | Matti Hamalainen <ccr@tnsp.org> |
|---|---|
| date | Thu, 13 Mar 2008 22:32:40 +0200 |
| parents | 738914331374 |
| children | 194c2f8c2a92 fea021087241 |
| rev | line source |
|---|---|
| 2279 | 1 #include <config.h> |
| 2 | |
| 3 #include <gtk/gtk.h> | |
| 4 #include <audacious/i18n.h> | |
| 5 #include <audacious/plugin.h> | |
| 6 #include <audacious/configdb.h> | |
| 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(); | |
| 20 aud_cfg_db_get_int(db, "lirc", "enable_reconnect", &b_enable_reconnect); | |
| 21 aud_cfg_db_get_int(db, "lirc", "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)) |
|
738914331374
Add ability to enter track number using remote. (Bugzilla #115)
Andrew O. Shadoura <bugzilla@tut.by>
parents:
2279
diff
changeset
|
23 aosd_font = g_strdup("Sans 26"); |
| 2279 | 24 if (!reconnect_timeout) reconnect_timeout = 5; |
| 25 aud_cfg_db_close(db); | |
| 26 } | |
| 27 | |
| 28 void save_cfg(void) | |
| 29 { | |
| 30 ConfigDb *db; | |
| 31 db = aud_cfg_db_open(); | |
| 32 aud_cfg_db_set_int(db, "lirc", "enable_reconnect", b_enable_reconnect); | |
| 33 aud_cfg_db_set_int(db, "lirc", "reconnect_timeout", reconnect_timeout); | |
| 34 aud_cfg_db_close(db); | |
| 35 } | |
| 36 | |
| 37 void configure(void) | |
| 38 { | |
| 39 if (lirc_cfg) | |
| 40 { | |
| 41 gtk_window_present(GTK_WINDOW(lirc_cfg)); | |
| 42 return; | |
| 43 } | |
| 44 load_cfg(); | |
| 45 lirc_cfg = create_lirc_cfg(); | |
| 46 gtk_widget_show_all(lirc_cfg); | |
| 47 } |
