1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Robert Bieber
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 ****************************************************************************/
31 enum skin_token_type
{
38 SKIN_TOKEN_TRANSLATEDSTRING
,
41 SKIN_TOKEN_ALIGN_LEFT
,
42 SKIN_TOKEN_ALIGN_LEFT_RTL
,
43 SKIN_TOKEN_ALIGN_CENTER
,
44 SKIN_TOKEN_ALIGN_RIGHT
,
45 SKIN_TOKEN_ALIGN_RIGHT_RTL
,
46 SKIN_TOKEN_ALIGN_LANGDIRECTION
,
50 SKIN_TOKEN_SUBLINE_TIMEOUT
,
51 SKIN_TOKEN_SUBLINE_SCROLL
,
54 SKIN_TOKEN_CONDITIONAL
,
55 SKIN_TOKEN_CONDITIONAL_START
,
56 SKIN_TOKEN_CONDITIONAL_OPTION
,
57 SKIN_TOKEN_CONDITIONAL_END
,
59 /* Viewport display */
60 SKIN_TOKEN_VIEWPORT_LOAD
,
61 SKIN_TOKEN_VIEWPORT_CONDITIONAL
,
62 SKIN_TOKEN_VIEWPORT_ENABLE
,
63 SKIN_TOKEN_VIEWPORT_CUSTOMLIST
,
64 SKIN_TOKEN_UIVIEWPORT_ENABLE
,
65 SKIN_TOKEN_UIVIEWPORT_LOAD
,
66 SKIN_TOKEN_VIEWPORT_FGCOLOUR
,
67 SKIN_TOKEN_VIEWPORT_BGCOLOUR
,
70 SKIN_TOKEN_BATTERY_PERCENT
,
71 SKIN_TOKEN_BATTERY_PERCENTBAR
,
72 SKIN_TOKEN_BATTERY_VOLTS
,
73 SKIN_TOKEN_BATTERY_TIME
,
74 SKIN_TOKEN_BATTERY_CHARGER_CONNECTED
,
75 SKIN_TOKEN_BATTERY_CHARGING
,
76 SKIN_TOKEN_BATTERY_SLEEPTIME
,
77 SKIN_TOKEN_USB_POWERED
,
80 SKIN_TOKEN_SOUND_PITCH
,
81 SKIN_TOKEN_SOUND_SPEED
,
82 SKIN_TOKEN_REPLAYGAIN
,
86 SKIN_TOKEN_RTC_PRESENT
,
88 /* The begin/end values allow us to know if a token is an RTC one.
89 New RTC tokens should be added between the markers. */
91 SKIN_TOKENs_RTC_BEGIN
, /* just the start marker, not an actual token */
93 SKIN_TOKEN_RTC_DAY_OF_MONTH
,
94 SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED
,
95 SKIN_TOKEN_RTC_12HOUR_CFG
,
96 SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED
,
97 SKIN_TOKEN_RTC_HOUR_24
,
98 SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED
,
99 SKIN_TOKEN_RTC_HOUR_12
,
100 SKIN_TOKEN_RTC_MONTH
,
101 SKIN_TOKEN_RTC_MINUTE
,
102 SKIN_TOKEN_RTC_SECOND
,
103 SKIN_TOKEN_RTC_YEAR_2_DIGITS
,
104 SKIN_TOKEN_RTC_YEAR_4_DIGITS
,
105 SKIN_TOKEN_RTC_AM_PM_UPPER
,
106 SKIN_TOKEN_RTC_AM_PM_LOWER
,
107 SKIN_TOKEN_RTC_WEEKDAY_NAME
,
108 SKIN_TOKEN_RTC_MONTH_NAME
,
109 SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON
,
110 SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN
,
112 SKIN_TOKENS_RTC_END
, /* just the end marker, not an actual token */
115 SKIN_TOKEN_DATABASE_PLAYCOUNT
,
116 SKIN_TOKEN_DATABASE_RATING
,
117 SKIN_TOKEN_DATABASE_AUTOSCORE
,
120 SKIN_TOKEN_FILE_BITRATE
,
121 SKIN_TOKEN_FILE_CODEC
,
122 SKIN_TOKEN_FILE_FREQUENCY
,
123 SKIN_TOKEN_FILE_FREQUENCY_KHZ
,
124 SKIN_TOKEN_FILE_NAME
,
125 SKIN_TOKEN_FILE_NAME_WITH_EXTENSION
,
126 SKIN_TOKEN_FILE_PATH
,
127 SKIN_TOKEN_FILE_SIZE
,
129 SKIN_TOKEN_FILE_DIRECTORY
,
132 SKIN_TOKEN_IMAGE_BACKDROP
,
133 SKIN_TOKEN_IMAGE_PROGRESS_BAR
,
134 SKIN_TOKEN_IMAGE_PRELOAD
,
135 SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY
,
136 SKIN_TOKEN_IMAGE_DISPLAY
,
139 SKIN_TOKEN_ALBUMART_LOAD
,
140 SKIN_TOKEN_ALBUMART_DISPLAY
,
141 SKIN_TOKEN_ALBUMART_FOUND
,
144 SKIN_TOKEN_METADATA_ARTIST
,
145 SKIN_TOKEN_METADATA_COMPOSER
,
146 SKIN_TOKEN_METADATA_ALBUM_ARTIST
,
147 SKIN_TOKEN_METADATA_GROUPING
,
148 SKIN_TOKEN_METADATA_ALBUM
,
149 SKIN_TOKEN_METADATA_GENRE
,
150 SKIN_TOKEN_METADATA_DISC_NUMBER
,
151 SKIN_TOKEN_METADATA_TRACK_NUMBER
,
152 SKIN_TOKEN_METADATA_TRACK_TITLE
,
153 SKIN_TOKEN_METADATA_VERSION
,
154 SKIN_TOKEN_METADATA_YEAR
,
155 SKIN_TOKEN_METADATA_COMMENT
,
158 SKIN_TOKEN_REPEAT_MODE
,
159 SKIN_TOKEN_PLAYBACK_STATUS
,
161 SKIN_TOKEN_PROGRESSBAR
,
162 SKIN_TOKEN_PLAYER_PROGRESSBAR
,
164 SKIN_TOKEN_PEAKMETER
,
167 SKIN_TOKEN_TRACK_ELAPSED_PERCENT
,
168 SKIN_TOKEN_TRACK_TIME_ELAPSED
,
169 SKIN_TOKEN_TRACK_TIME_REMAINING
,
170 SKIN_TOKEN_TRACK_LENGTH
,
171 SKIN_TOKEN_TRACK_STARTING
,
172 SKIN_TOKEN_TRACK_ENDING
,
175 SKIN_TOKEN_PLAYLIST_ENTRIES
,
176 SKIN_TOKEN_PLAYLIST_NAME
,
177 SKIN_TOKEN_PLAYLIST_POSITION
,
178 SKIN_TOKEN_PLAYLIST_SHUFFLE
,
181 SKIN_TOKEN_ENABLE_THEME
,
182 SKIN_TOKEN_DISABLE_THEME
,
183 SKIN_TOKEN_DRAW_INBUILTBAR
,
184 SKIN_TOKEN_LIST_TITLE_TEXT
,
185 SKIN_TOKEN_LIST_TITLE_ICON
,
187 SKIN_TOKEN_LOAD_FONT
,
190 SKIN_TOKEN_BUTTON_VOLUME
,
191 SKIN_TOKEN_LASTTOUCH
,
192 SKIN_TOKEN_TOUCHREGION
,
197 SKIN_TOKEN_VOLUMEBAR
,
199 SKIN_TOKEN_MAIN_HOLD
,
200 SKIN_TOKEN_REMOTE_HOLD
,
204 SKIN_TOKEN_CURRENT_SCREEN
,
205 SKIN_TOKEN_LANG_IS_RTL
,
207 /* Recording Tokens */
208 SKIN_TOKEN_HAVE_RECORDING
,
209 SKIN_TOKEN_IS_RECORDING
,
211 SKIN_TOKEN_REC_ENCODER
,
212 SKIN_TOKEN_REC_BITRATE
, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */
214 SKIN_TOKEN_REC_SECONDS
,
215 SKIN_TOKEN_REC_MINUTES
,
216 SKIN_TOKEN_REC_HOURS
,
220 SKIN_TOKEN_HAVE_TUNER
,
221 SKIN_TOKEN_TUNER_TUNED
,
222 SKIN_TOKEN_TUNER_SCANMODE
,
223 SKIN_TOKEN_TUNER_STEREO
,
224 SKIN_TOKEN_TUNER_MINFREQ
, /* changes based on "region" */
225 SKIN_TOKEN_TUNER_MAXFREQ
, /* changes based on "region" */
226 SKIN_TOKEN_TUNER_CURFREQ
,
227 SKIN_TOKEN_PRESET_ID
, /* "id" of this preset.. really the array element number */
228 SKIN_TOKEN_PRESET_NAME
,
229 SKIN_TOKEN_PRESET_FREQ
,
230 SKIN_TOKEN_PRESET_COUNT
,
239 * Struct for tag parsing information
240 * name - The name of the tag, i.e. V for %V
241 * params - A string specifying all of the tags parameters, each
242 * character representing a single parameter. Valid
243 * characters for parameters are:
244 * I - Required integer
245 * i - Nullable integer
246 * S - Required string
247 * s - Nullable string
248 * F - Required file name
249 * f - Nullable file name
250 * C - Required skin code
251 * N - any amount of strings.. must be the last param in the list
252 * \n - causes the parser to eat everything up to and including the \n
253 * MUST be the last character of the prams string
254 * Any nullable parameter may be replaced in the WPS file
255 * with a '-'. To specify that parameters may be left off
256 * altogether, place a '|' in the parameter string. For
257 * instance, with the parameter string...
259 * one integer must be specified, one integer can be
260 * specified or set to default with '-', and the user can
261 * stop providing parameters at any time after that.
262 * To specify multiple instances of the same type, put a
263 * number before the character. For instance, the string...
265 * will specify two strings. An asterisk (*) at the beginning of the
266 * string will specify that you may choose to omit all arguments
271 enum skin_token_type type
;
278 * Finds a tag by name and returns its parameter list, or an empty
279 * string if the tag is not found in the table
281 struct tag_info
* find_tag(char* name
);
284 * Determines whether a character is legal to escape or not. If
285 * lookup is not found in the legal escape characters string, returns
286 * false, otherwise returns true
288 int find_escape_character(char lookup
);
294 #endif /* TAG_TABLE_H */