annotate src/lirc/lirc_cfg.c @ 3203:f5456241bff9 default tip

changed include path from audacious to audlegacy.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 10 Nov 2009 05:19:25 +0900
parents 3134a0987162
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2279
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1 #include <config.h>
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
2
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
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
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
7
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
8 #include "common.h"
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
9
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
10 GtkWidget *lirc_cfg = NULL;
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
11
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
12 gint b_enable_reconnect;
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
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
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
15
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
16 void load_cfg(void)
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
17 {
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
18 ConfigDb *db;
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
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
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
29 aud_cfg_db_close(db);
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
30 }
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
31
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
32 void save_cfg(void)
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
33 {
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
34 ConfigDb *db;
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
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
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
38 aud_cfg_db_close(db);
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
39 }
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
40
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
41 void configure(void)
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
42 {
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
43 if (lirc_cfg)
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
44 {
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
45 gtk_window_present(GTK_WINDOW(lirc_cfg));
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
46 return;
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
47 }
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
48 load_cfg();
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
49 lirc_cfg = create_lirc_cfg();
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
50 gtk_widget_show_all(lirc_cfg);
90d9e13d2e18 Add missing files.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
51 }