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
{
33 TOKEN_MARKER_CONTROL_TOKENS
= -1,
39 SKIN_TOKEN_TRANSLATEDSTRING
,
42 SKIN_TOKEN_ALIGN_LEFT
,
43 SKIN_TOKEN_ALIGN_LEFT_RTL
,
44 SKIN_TOKEN_ALIGN_CENTER
,
45 SKIN_TOKEN_ALIGN_RIGHT
,
46 SKIN_TOKEN_ALIGN_RIGHT_RTL
,
47 SKIN_TOKEN_ALIGN_LANGDIRECTION
,
51 SKIN_TOKEN_SUBLINE_TIMEOUT
,
52 SKIN_TOKEN_SUBLINE_SCROLL
,
55 SKIN_TOKEN_CONDITIONAL
,
56 SKIN_TOKEN_CONDITIONAL_START
,
57 SKIN_TOKEN_CONDITIONAL_OPTION
,
58 SKIN_TOKEN_CONDITIONAL_END
,
60 /* Viewport display */
61 SKIN_TOKEN_VIEWPORT_LOAD
,
62 SKIN_TOKEN_VIEWPORT_CONDITIONAL
,
63 SKIN_TOKEN_VIEWPORT_ENABLE
,
64 SKIN_TOKEN_VIEWPORT_CUSTOMLIST
,
65 SKIN_TOKEN_UIVIEWPORT_ENABLE
,
66 SKIN_TOKEN_UIVIEWPORT_LOAD
,
67 SKIN_TOKEN_VIEWPORT_FGCOLOUR
,
68 SKIN_TOKEN_VIEWPORT_BGCOLOUR
,
72 SKIN_TOKEN_BATTERY_PERCENT
,
73 SKIN_TOKEN_BATTERY_PERCENTBAR
,
74 SKIN_TOKEN_BATTERY_VOLTS
,
75 SKIN_TOKEN_BATTERY_TIME
,
76 SKIN_TOKEN_BATTERY_CHARGER_CONNECTED
,
77 SKIN_TOKEN_BATTERY_CHARGING
,
78 SKIN_TOKEN_BATTERY_SLEEPTIME
,
79 SKIN_TOKEN_USB_POWERED
,
83 SKIN_TOKEN_SOUND_PITCH
,
84 SKIN_TOKEN_SOUND_SPEED
,
85 SKIN_TOKEN_REPLAYGAIN
,
90 SKIN_TOKEN_RTC_PRESENT
,
92 /* The begin/end values allow us to know if a token is an RTC one.
93 New RTC tokens should be added between the markers. */
95 SKIN_TOKENs_RTC_BEGIN
, /* just the start marker, not an actual token */
97 SKIN_TOKEN_RTC_DAY_OF_MONTH
,
98 SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED
,
99 SKIN_TOKEN_RTC_12HOUR_CFG
,
100 SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED
,
101 SKIN_TOKEN_RTC_HOUR_24
,
102 SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED
,
103 SKIN_TOKEN_RTC_HOUR_12
,
104 SKIN_TOKEN_RTC_MONTH
,
105 SKIN_TOKEN_RTC_MINUTE
,
106 SKIN_TOKEN_RTC_SECOND
,
107 SKIN_TOKEN_RTC_YEAR_2_DIGITS
,
108 SKIN_TOKEN_RTC_YEAR_4_DIGITS
,
109 SKIN_TOKEN_RTC_AM_PM_UPPER
,
110 SKIN_TOKEN_RTC_AM_PM_LOWER
,
111 SKIN_TOKEN_RTC_WEEKDAY_NAME
,
112 SKIN_TOKEN_RTC_MONTH_NAME
,
113 SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON
,
114 SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN
,
116 SKIN_TOKENS_RTC_END
, /* just the end marker, not an actual token */
119 TOKEN_MARKER_DATABASE
,
120 SKIN_TOKEN_DATABASE_PLAYCOUNT
,
121 SKIN_TOKEN_DATABASE_RATING
,
122 SKIN_TOKEN_DATABASE_AUTOSCORE
,
126 SKIN_TOKEN_FILE_BITRATE
,
127 SKIN_TOKEN_FILE_CODEC
,
128 SKIN_TOKEN_FILE_FREQUENCY
,
129 SKIN_TOKEN_FILE_FREQUENCY_KHZ
,
130 SKIN_TOKEN_FILE_NAME
,
131 SKIN_TOKEN_FILE_NAME_WITH_EXTENSION
,
132 SKIN_TOKEN_FILE_PATH
,
133 SKIN_TOKEN_FILE_SIZE
,
135 SKIN_TOKEN_FILE_DIRECTORY
,
139 SKIN_TOKEN_IMAGE_BACKDROP
,
140 SKIN_TOKEN_IMAGE_PROGRESS_BAR
,
141 SKIN_TOKEN_IMAGE_PRELOAD
,
142 SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY
,
143 SKIN_TOKEN_IMAGE_DISPLAY
,
146 SKIN_TOKEN_ALBUMART_LOAD
,
147 SKIN_TOKEN_ALBUMART_DISPLAY
,
148 SKIN_TOKEN_ALBUMART_FOUND
,
151 TOKEN_MARKER_METADATA
,
152 SKIN_TOKEN_METADATA_ARTIST
,
153 SKIN_TOKEN_METADATA_COMPOSER
,
154 SKIN_TOKEN_METADATA_ALBUM_ARTIST
,
155 SKIN_TOKEN_METADATA_GROUPING
,
156 SKIN_TOKEN_METADATA_ALBUM
,
157 SKIN_TOKEN_METADATA_GENRE
,
158 SKIN_TOKEN_METADATA_DISC_NUMBER
,
159 SKIN_TOKEN_METADATA_TRACK_NUMBER
,
160 SKIN_TOKEN_METADATA_TRACK_TITLE
,
161 SKIN_TOKEN_METADATA_VERSION
,
162 SKIN_TOKEN_METADATA_YEAR
,
163 SKIN_TOKEN_METADATA_COMMENT
,
165 TOKEN_MARKER_PLAYBACK_INFO
,
167 SKIN_TOKEN_REPEAT_MODE
,
168 SKIN_TOKEN_PLAYBACK_STATUS
,
170 SKIN_TOKEN_PROGRESSBAR
,
171 SKIN_TOKEN_PLAYER_PROGRESSBAR
,
173 SKIN_TOKEN_PEAKMETER
,
176 SKIN_TOKEN_TRACK_ELAPSED_PERCENT
,
177 SKIN_TOKEN_TRACK_TIME_ELAPSED
,
178 SKIN_TOKEN_TRACK_TIME_REMAINING
,
179 SKIN_TOKEN_TRACK_LENGTH
,
180 SKIN_TOKEN_TRACK_STARTING
,
181 SKIN_TOKEN_TRACK_ENDING
,
184 TOKEN_MARKER_PLAYLIST
,
185 SKIN_TOKEN_PLAYLIST_ENTRIES
,
186 SKIN_TOKEN_PLAYLIST_NAME
,
187 SKIN_TOKEN_PLAYLIST_POSITION
,
188 SKIN_TOKEN_PLAYLIST_SHUFFLE
,
192 SKIN_TOKEN_ENABLE_THEME
,
193 SKIN_TOKEN_DISABLE_THEME
,
194 SKIN_TOKEN_DRAW_INBUILTBAR
,
195 SKIN_TOKEN_LIST_TITLE_TEXT
,
196 SKIN_TOKEN_LIST_TITLE_ICON
,
198 SKIN_TOKEN_LOAD_FONT
,
201 SKIN_TOKEN_BUTTON_VOLUME
,
202 SKIN_TOKEN_LASTTOUCH
,
203 SKIN_TOKEN_TOUCHREGION
,
208 SKIN_TOKEN_VOLUMEBAR
,
210 SKIN_TOKEN_MAIN_HOLD
,
211 SKIN_TOKEN_REMOTE_HOLD
,
215 SKIN_TOKEN_CURRENT_SCREEN
,
216 SKIN_TOKEN_LANG_IS_RTL
,
218 /* Recording Tokens */
219 TOKEN_MARKER_RECORDING
,
220 SKIN_TOKEN_HAVE_RECORDING
,
221 SKIN_TOKEN_IS_RECORDING
,
223 SKIN_TOKEN_REC_ENCODER
,
224 SKIN_TOKEN_REC_BITRATE
, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */
226 SKIN_TOKEN_REC_SECONDS
,
227 SKIN_TOKEN_REC_MINUTES
,
228 SKIN_TOKEN_REC_HOURS
,
233 SKIN_TOKEN_HAVE_TUNER
,
234 SKIN_TOKEN_TUNER_TUNED
,
235 SKIN_TOKEN_TUNER_SCANMODE
,
236 SKIN_TOKEN_TUNER_STEREO
,
237 SKIN_TOKEN_TUNER_MINFREQ
, /* changes based on "region" */
238 SKIN_TOKEN_TUNER_MAXFREQ
, /* changes based on "region" */
239 SKIN_TOKEN_TUNER_CURFREQ
,
240 SKIN_TOKEN_PRESET_ID
, /* "id" of this preset.. really the array element number */
241 SKIN_TOKEN_PRESET_NAME
,
242 SKIN_TOKEN_PRESET_FREQ
,
243 SKIN_TOKEN_PRESET_COUNT
,
250 TOKEN_MARKER_END
, /* this needs to be the last value in this enum */
254 * Struct for tag parsing information
255 * name - The name of the tag, i.e. V for %V
256 * params - A string specifying all of the tags parameters, each
257 * character representing a single parameter. Valid
258 * characters for parameters are:
259 * I - Required integer
260 * i - Nullable integer
261 * S - Required string
262 * s - Nullable string
263 * F - Required file name
264 * f - Nullable file name
265 * C - Required skin code
266 * N - any amount of strings.. must be the last param in the list
267 * Any nullable parameter may be replaced in the WPS file
268 * with a '-'. To specify that parameters may be left off
269 * altogether, place a '|' in the parameter string. For
270 * instance, with the parameter string...
272 * one integer must be specified, one integer can be
273 * specified or set to default with '-', and the user can
274 * stop providing parameters at any time after that.
275 * To specify multiple instances of the same type, put a
276 * number before the character. For instance, the string...
278 * will specify two strings. An asterisk (*) at the beginning of the
279 * string will specify that you may choose to omit all arguments
284 enum skin_token_type type
;
291 * Finds a tag by name and returns its parameter list, or an empty
292 * string if the tag is not found in the table
294 struct tag_info
* find_tag(char* name
);
297 * Determines whether a character is legal to escape or not. If
298 * lookup is not found in the legal escape characters string, returns
299 * false, otherwise returns true
301 int find_escape_character(char lookup
);
307 #endif /* TAG_TABLE_H */