Use nice quotation marks
[kugel-rb.git] / apps / gui / skin_engine / skin_tokens.h
blobf25b123d9d5f18e863800db1496ed4b25fbc03c1
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Nicolas Pennequin
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _SKIN_TOKENS_H_
23 #define _SKIN_TOKENS_H_
25 #include <stdbool.h>
28 enum wps_token_type {
30 TOKEN_MARKER_CONTROL_TOKENS = -1,
31 WPS_NO_TOKEN = 0, /* for WPS tags we don't want to save as tokens */
32 WPS_TOKEN_UNKNOWN,
34 /* Markers */
35 WPS_TOKEN_CHARACTER,
36 WPS_TOKEN_STRING,
37 WPS_TOKEN_TRANSLATEDSTRING,
39 /* Alignment */
40 WPS_TOKEN_ALIGN_LEFT,
41 WPS_TOKEN_ALIGN_LEFT_RTL,
42 WPS_TOKEN_ALIGN_CENTER,
43 WPS_TOKEN_ALIGN_RIGHT,
44 WPS_TOKEN_ALIGN_RIGHT_RTL,
46 /* Sublines */
47 WPS_TOKEN_SUBLINE_TIMEOUT,
49 /* Conditional */
50 WPS_TOKEN_CONDITIONAL,
51 WPS_TOKEN_CONDITIONAL_START,
52 WPS_TOKEN_CONDITIONAL_OPTION,
53 WPS_TOKEN_CONDITIONAL_END,
55 /* Viewport display */
56 WPS_VIEWPORT_ENABLE,
57 WPS_VIEWPORT_CUSTOMLIST,
58 WPS_TOKEN_UIVIEWPORT_ENABLE,
60 /* Battery */
61 TOKEN_MARKER_BATTERY,
62 WPS_TOKEN_BATTERY_PERCENT,
63 WPS_TOKEN_BATTERY_PERCENTBAR,
64 WPS_TOKEN_BATTERY_VOLTS,
65 WPS_TOKEN_BATTERY_TIME,
66 WPS_TOKEN_BATTERY_CHARGER_CONNECTED,
67 WPS_TOKEN_BATTERY_CHARGING,
68 WPS_TOKEN_BATTERY_SLEEPTIME,
69 WPS_TOKEN_USB_POWERED,
71 /* Sound */
72 TOKEN_MARKER_SOUND,
73 #if (CONFIG_CODEC != MAS3507D)
74 WPS_TOKEN_SOUND_PITCH,
75 #endif
76 #if (CONFIG_CODEC == SWCODEC)
77 WPS_TOKEN_SOUND_SPEED,
78 WPS_TOKEN_REPLAYGAIN,
79 WPS_TOKEN_CROSSFADE,
80 #endif
82 /* Time */
83 TOKEN_MARKER_RTC,
84 WPS_TOKEN_RTC_PRESENT,
86 /* The begin/end values allow us to know if a token is an RTC one.
87 New RTC tokens should be added between the markers. */
89 WPS_TOKENS_RTC_BEGIN, /* just the start marker, not an actual token */
91 WPS_TOKEN_RTC_DAY_OF_MONTH,
92 WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,
93 WPS_TOKEN_RTC_12HOUR_CFG,
94 WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED,
95 WPS_TOKEN_RTC_HOUR_24,
96 WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED,
97 WPS_TOKEN_RTC_HOUR_12,
98 WPS_TOKEN_RTC_MONTH,
99 WPS_TOKEN_RTC_MINUTE,
100 WPS_TOKEN_RTC_SECOND,
101 WPS_TOKEN_RTC_YEAR_2_DIGITS,
102 WPS_TOKEN_RTC_YEAR_4_DIGITS,
103 WPS_TOKEN_RTC_AM_PM_UPPER,
104 WPS_TOKEN_RTC_AM_PM_LOWER,
105 WPS_TOKEN_RTC_WEEKDAY_NAME,
106 WPS_TOKEN_RTC_MONTH_NAME,
107 WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON,
108 WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN,
110 WPS_TOKENS_RTC_END, /* just the end marker, not an actual token */
112 /* Database */
113 TOKEN_MARKER_DATABASE,
114 #ifdef HAVE_TAGCACHE
115 WPS_TOKEN_DATABASE_PLAYCOUNT,
116 WPS_TOKEN_DATABASE_RATING,
117 WPS_TOKEN_DATABASE_AUTOSCORE,
118 #endif
120 /* File */
121 TOKEN_MARKER_FILE,
122 WPS_TOKEN_FILE_BITRATE,
123 WPS_TOKEN_FILE_CODEC,
124 WPS_TOKEN_FILE_FREQUENCY,
125 WPS_TOKEN_FILE_FREQUENCY_KHZ,
126 WPS_TOKEN_FILE_NAME,
127 WPS_TOKEN_FILE_NAME_WITH_EXTENSION,
128 WPS_TOKEN_FILE_PATH,
129 WPS_TOKEN_FILE_SIZE,
130 WPS_TOKEN_FILE_VBR,
131 WPS_TOKEN_FILE_DIRECTORY,
133 /* Image */
134 TOKEN_MARKER_IMAGES,
135 #ifdef HAVE_LCD_BITMAP
136 WPS_TOKEN_IMAGE_BACKDROP,
137 WPS_TOKEN_IMAGE_PROGRESS_BAR,
138 WPS_TOKEN_IMAGE_PRELOAD,
139 WPS_TOKEN_IMAGE_PRELOAD_DISPLAY,
140 WPS_TOKEN_IMAGE_DISPLAY,
141 #endif
143 #ifdef HAVE_ALBUMART
144 /* Albumart */
145 WPS_TOKEN_ALBUMART_DISPLAY,
146 WPS_TOKEN_ALBUMART_FOUND,
147 #endif
149 /* Metadata */
150 TOKEN_MARKER_METADATA,
151 WPS_TOKEN_METADATA_ARTIST,
152 WPS_TOKEN_METADATA_COMPOSER,
153 WPS_TOKEN_METADATA_ALBUM_ARTIST,
154 WPS_TOKEN_METADATA_GROUPING,
155 WPS_TOKEN_METADATA_ALBUM,
156 WPS_TOKEN_METADATA_GENRE,
157 WPS_TOKEN_METADATA_DISC_NUMBER,
158 WPS_TOKEN_METADATA_TRACK_NUMBER,
159 WPS_TOKEN_METADATA_TRACK_TITLE,
160 WPS_TOKEN_METADATA_VERSION,
161 WPS_TOKEN_METADATA_YEAR,
162 WPS_TOKEN_METADATA_COMMENT,
164 TOKEN_MARKER_PLAYBACK_INFO,
165 /* Mode */
166 WPS_TOKEN_REPEAT_MODE,
167 WPS_TOKEN_PLAYBACK_STATUS,
168 /* Progressbar */
169 WPS_TOKEN_PROGRESSBAR,
170 #ifdef HAVE_LCD_CHARCELLS
171 WPS_TOKEN_PLAYER_PROGRESSBAR,
172 #endif
173 #ifdef HAVE_LCD_BITMAP
174 /* Peakmeter */
175 WPS_TOKEN_PEAKMETER,
176 #endif
178 /* Current track */
179 WPS_TOKEN_TRACK_ELAPSED_PERCENT,
180 WPS_TOKEN_TRACK_TIME_ELAPSED,
181 WPS_TOKEN_TRACK_TIME_REMAINING,
182 WPS_TOKEN_TRACK_LENGTH,
183 WPS_TOKEN_TRACK_STARTING,
184 WPS_TOKEN_TRACK_ENDING,
186 /* Playlist */
187 TOKEN_MARKER_PLAYLIST,
188 WPS_TOKEN_PLAYLIST_ENTRIES,
189 WPS_TOKEN_PLAYLIST_NAME,
190 WPS_TOKEN_PLAYLIST_POSITION,
191 WPS_TOKEN_PLAYLIST_SHUFFLE,
194 /* buttons */
195 TOKEN_MARKER_MISC,
196 WPS_TOKEN_DRAW_INBUILTBAR,
197 WPS_TOKEN_LIST_TITLE_TEXT,
198 WPS_TOKEN_LIST_TITLE_ICON,
199 WPS_TOKEN_BUTTON_VOLUME,
200 WPS_TOKEN_LASTTOUCH,
201 #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
202 /* Virtual LED */
203 WPS_TOKEN_VLED_HDD,
204 #endif
205 /* Volume level */
206 WPS_TOKEN_VOLUME,
207 WPS_TOKEN_VOLUMEBAR,
208 /* hold */
209 WPS_TOKEN_MAIN_HOLD,
210 #ifdef HAS_REMOTE_BUTTON_HOLD
211 WPS_TOKEN_REMOTE_HOLD,
212 #endif
214 /* Setting option */
215 WPS_TOKEN_SETTING,
216 WPS_TOKEN_CURRENT_SCREEN,
217 WPS_TOKEN_LANG_IS_RTL,
219 /* Recording Tokens */
220 TOKEN_MARKER_RECORDING,
221 WPS_TOKEN_HAVE_RECORDING,
222 WPS_TOKEN_IS_RECORDING,
223 WPS_TOKEN_REC_FREQ,
224 WPS_TOKEN_REC_ENCODER,
225 WPS_TOKEN_REC_BITRATE, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */
226 WPS_TOKEN_REC_MONO,
227 WPS_TOKEN_REC_SECONDS,
228 WPS_TOKEN_REC_MINUTES,
229 WPS_TOKEN_REC_HOURS,
232 /* Radio Tokens */
233 TOKEN_MARKER_TUNER,
234 WPS_TOKEN_HAVE_TUNER,
235 #if CONFIG_TUNER
236 WPS_TOKEN_TUNER_TUNED,
237 WPS_TOKEN_TUNER_SCANMODE,
238 WPS_TOKEN_TUNER_STEREO,
239 WPS_TOKEN_TUNER_MINFREQ, /* changes based on "region" */
240 WPS_TOKEN_TUNER_MAXFREQ, /* changes based on "region" */
241 WPS_TOKEN_TUNER_CURFREQ,
242 WPS_TOKEN_PRESET_ID, /* "id" of this preset.. really the array element number */
243 WPS_TOKEN_PRESET_NAME,
244 WPS_TOKEN_PRESET_FREQ,
245 WPS_TOKEN_PRESET_COUNT,
246 /* RDS tokens */
247 WPS_TOKEN_HAVE_RDS,
248 #ifdef HAVE_RDS_CAP
249 WPS_TOKEN_RDS_NAME,
250 WPS_TOKEN_RDS_TEXT,
251 #endif
252 #endif /* CONFIG_TUNER */
255 TOKEN_MARKER_END, /* this needs to be the last value in this enum */
258 struct wps_token {
259 unsigned char type; /* enough to store the token type */
261 /* Whether the tag (e.g. track name or the album) refers the
262 current or the next song (false=current, true=next) */
263 bool next;
265 union {
266 char c;
267 unsigned short i;
268 void* data;
269 } value;
272 struct skin_token_list {
273 struct wps_token *token;
274 struct skin_token_list *next;
277 char* get_dir(char* buf, int buf_size, const char* path, int level);
279 #endif