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 #ifndef _I_AOSD_CFG_H
22 #define _I_AOSD_CFG_H 1
23 
24 #include <libaudcore/objects.h>
25 
26 /* in this release only one user font is supported */
27 #define AOSD_TEXT_FONTS_NUM 1
28 
29 /* transparency mode values */
30 #define AOSD_MISC_TRANSPARENCY_FAKE 0
31 #define AOSD_MISC_TRANSPARENCY_REAL 1
32 
33 #define AOSD_DECO_STYLE_MAX_COLORS 2
34 
35 enum
36 {
37   AOSD_DECO_STYLE_RECT,
38   AOSD_DECO_STYLE_ROUNDRECT,
39   AOSD_DECO_STYLE_CONCAVERECT,
40   AOSD_DECO_STYLE_NONE,
41   AOSD_NUM_DECO_STYLES
42 };
43 
44 enum
45 {
46   AOSD_POSITION_PLACEMENT_TOPLEFT = 1,
47   AOSD_POSITION_PLACEMENT_TOP,
48   AOSD_POSITION_PLACEMENT_TOPRIGHT,
49   AOSD_POSITION_PLACEMENT_MIDDLELEFT,
50   AOSD_POSITION_PLACEMENT_MIDDLE,
51   AOSD_POSITION_PLACEMENT_MIDDLERIGHT,
52   AOSD_POSITION_PLACEMENT_BOTTOMLEFT,
53   AOSD_POSITION_PLACEMENT_BOTTOM,
54   AOSD_POSITION_PLACEMENT_BOTTOMRIGHT
55 };
56 
57 enum
58 {
59   AOSD_TRIGGER_PB_START = 0,
60   AOSD_TRIGGER_PB_TITLECHANGE,
61   AOSD_TRIGGER_PB_PAUSEON,
62   AOSD_TRIGGER_PB_PAUSEOFF,
63   AOSD_NUM_TRIGGERS
64 };
65 
66 typedef struct
67 {
68   int red;
69   int green;
70   int blue;
71   int alpha;
72 }
73 aosd_color_t;
74 
75 
76 /* config portion containing osd decoration information */
77 typedef struct
78 {
79   int code;
80   aosd_color_t colors[AOSD_DECO_STYLE_MAX_COLORS];
81 }
82 aosd_cfg_osd_decoration_t;
83 
84 
85 /* config portion containing osd text information */
86 typedef struct
87 {
88   String fonts_name[AOSD_TEXT_FONTS_NUM];
89   aosd_color_t fonts_color[AOSD_TEXT_FONTS_NUM];
90   bool fonts_draw_shadow[AOSD_TEXT_FONTS_NUM];
91   aosd_color_t fonts_shadow_color[AOSD_TEXT_FONTS_NUM];
92 }
93 aosd_cfg_osd_text_t;
94 
95 
96 /* config portion containing osd animation information */
97 typedef struct
98 {
99   int timing_display;
100   int timing_fadein;
101   int timing_fadeout;
102 }
103 aosd_cfg_osd_animation_t;
104 
105 
106 /* config portion containing osd position information */
107 typedef struct
108 {
109   int placement;
110   int offset_x;
111   int offset_y;
112   int maxsize_width;
113   int multimon_id;
114 }
115 aosd_cfg_osd_position_t;
116 
117 
118 /* config portion containing osd trigger information */
119 typedef struct
120 {
121   int enabled[AOSD_NUM_TRIGGERS];
122 }
123 aosd_cfg_osd_trigger_t;
124 
125 
126 /* config portion containing osd miscellaneous information */
127 typedef struct
128 {
129   int transparency_mode;
130 }
131 aosd_cfg_osd_misc_t;
132 
133 
134 /* config portion containing all information */
135 typedef struct
136 {
137   aosd_cfg_osd_position_t position;
138   aosd_cfg_osd_animation_t animation;
139   aosd_cfg_osd_text_t text;
140   aosd_cfg_osd_decoration_t decoration;
141   aosd_cfg_osd_trigger_t trigger;
142   aosd_cfg_osd_misc_t misc;
143 }
144 aosd_cfg_t;
145 
146 
147 /* API */
148 void aosd_cfg_load (aosd_cfg_t & cfg);
149 void aosd_cfg_save (const aosd_cfg_t & cfg);
150 
151 extern aosd_cfg_t global_config;
152 
153 #endif /* !_I_AOSD_CFG_H */
154