FS#10898 - Add a playlist viewer to the WPS. http://www.rockbox.org/wiki/CustomWPS...
[kugel-rb.git] / apps / gui / skin_engine / skin_tokens.h
blob5778f95808a26ef24dae162d9da4da71a7161fcb
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,
59 /* Battery */
60 TOKEN_MARKER_BATTERY,
61 WPS_TOKEN_BATTERY_PERCENT,
62 WPS_TOKEN_BATTERY_VOLTS,
63 WPS_TOKEN_BATTERY_TIME,
64 WPS_TOKEN_BATTERY_CHARGER_CONNECTED,
65 WPS_TOKEN_BATTERY_CHARGING,
66 WPS_TOKEN_BATTERY_SLEEPTIME,
67 WPS_TOKEN_USB_POWERED,
69 /* Sound */
70 TOKEN_MARKER_SOUND,
71 #if (CONFIG_CODEC != MAS3507D)
72 WPS_TOKEN_SOUND_PITCH,
73 #endif
74 #if (CONFIG_CODEC == SWCODEC)
75 WPS_TOKEN_SOUND_SPEED,
76 WPS_TOKEN_REPLAYGAIN,
77 WPS_TOKEN_CROSSFADE,
78 #endif
80 /* Time */
81 TOKEN_MARKER_RTC,
82 WPS_TOKEN_RTC_PRESENT,
84 /* The begin/end values allow us to know if a token is an RTC one.
85 New RTC tokens should be added between the markers. */
87 WPS_TOKENS_RTC_BEGIN, /* just the start marker, not an actual token */
89 WPS_TOKEN_RTC_DAY_OF_MONTH,
90 WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,
91 WPS_TOKEN_RTC_12HOUR_CFG,
92 WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED,
93 WPS_TOKEN_RTC_HOUR_24,
94 WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED,
95 WPS_TOKEN_RTC_HOUR_12,
96 WPS_TOKEN_RTC_MONTH,
97 WPS_TOKEN_RTC_MINUTE,
98 WPS_TOKEN_RTC_SECOND,
99 WPS_TOKEN_RTC_YEAR_2_DIGITS,
100 WPS_TOKEN_RTC_YEAR_4_DIGITS,
101 WPS_TOKEN_RTC_AM_PM_UPPER,
102 WPS_TOKEN_RTC_AM_PM_LOWER,
103 WPS_TOKEN_RTC_WEEKDAY_NAME,
104 WPS_TOKEN_RTC_MONTH_NAME,
105 WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON,
106 WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN,
108 WPS_TOKENS_RTC_END, /* just the end marker, not an actual token */
110 /* Database */
111 TOKEN_MARKER_DATABASE,
112 #ifdef HAVE_TAGCACHE
113 WPS_TOKEN_DATABASE_PLAYCOUNT,
114 WPS_TOKEN_DATABASE_RATING,
115 WPS_TOKEN_DATABASE_AUTOSCORE,
116 #endif
118 /* File */
119 TOKEN_MARKER_FILE,
120 WPS_TOKEN_FILE_BITRATE,
121 WPS_TOKEN_FILE_CODEC,
122 WPS_TOKEN_FILE_FREQUENCY,
123 WPS_TOKEN_FILE_FREQUENCY_KHZ,
124 WPS_TOKEN_FILE_NAME,
125 WPS_TOKEN_FILE_NAME_WITH_EXTENSION,
126 WPS_TOKEN_FILE_PATH,
127 WPS_TOKEN_FILE_SIZE,
128 WPS_TOKEN_FILE_VBR,
129 WPS_TOKEN_FILE_DIRECTORY,
131 /* Image */
132 TOKEN_MARKER_IMAGES,
133 #ifdef HAVE_LCD_BITMAP
134 WPS_TOKEN_IMAGE_BACKDROP,
135 WPS_TOKEN_IMAGE_PROGRESS_BAR,
136 WPS_TOKEN_IMAGE_PRELOAD,
137 WPS_TOKEN_IMAGE_PRELOAD_DISPLAY,
138 WPS_TOKEN_IMAGE_DISPLAY,
139 #endif
141 #ifdef HAVE_ALBUMART
142 /* Albumart */
143 WPS_TOKEN_ALBUMART_DISPLAY,
144 WPS_TOKEN_ALBUMART_FOUND,
145 #endif
147 /* Metadata */
148 TOKEN_MARKER_METADATA,
149 WPS_TOKEN_METADATA_ARTIST,
150 WPS_TOKEN_METADATA_COMPOSER,
151 WPS_TOKEN_METADATA_ALBUM_ARTIST,
152 WPS_TOKEN_METADATA_GROUPING,
153 WPS_TOKEN_METADATA_ALBUM,
154 WPS_TOKEN_METADATA_GENRE,
155 WPS_TOKEN_METADATA_DISC_NUMBER,
156 WPS_TOKEN_METADATA_TRACK_NUMBER,
157 WPS_TOKEN_METADATA_TRACK_TITLE,
158 WPS_TOKEN_METADATA_VERSION,
159 WPS_TOKEN_METADATA_YEAR,
160 WPS_TOKEN_METADATA_COMMENT,
162 TOKEN_MARKER_PLAYBACK_INFO,
163 /* Mode */
164 WPS_TOKEN_REPEAT_MODE,
165 WPS_TOKEN_PLAYBACK_STATUS,
166 /* Progressbar */
167 WPS_TOKEN_PROGRESSBAR,
168 #ifdef HAVE_LCD_CHARCELLS
169 WPS_TOKEN_PLAYER_PROGRESSBAR,
170 #endif
171 #ifdef HAVE_LCD_BITMAP
172 /* Peakmeter */
173 WPS_TOKEN_PEAKMETER,
174 #endif
176 /* Current track */
177 WPS_TOKEN_TRACK_ELAPSED_PERCENT,
178 WPS_TOKEN_TRACK_TIME_ELAPSED,
179 WPS_TOKEN_TRACK_TIME_REMAINING,
180 WPS_TOKEN_TRACK_LENGTH,
182 /* Playlist */
183 TOKEN_MARKER_PLAYLIST,
184 WPS_TOKEN_PLAYLIST_ENTRIES,
185 WPS_TOKEN_PLAYLIST_NAME,
186 WPS_TOKEN_PLAYLIST_POSITION,
187 WPS_TOKEN_PLAYLIST_SHUFFLE,
190 /* buttons */
191 TOKEN_MARKER_MISC,
192 WPS_TOKEN_BUTTON_VOLUME,
193 WPS_TOKEN_LASTTOUCH,
194 #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
195 /* Virtual LED */
196 WPS_TOKEN_VLED_HDD,
197 #endif
198 /* Volume level */
199 WPS_TOKEN_VOLUME,
200 /* hold */
201 WPS_TOKEN_MAIN_HOLD,
202 #ifdef HAS_REMOTE_BUTTON_HOLD
203 WPS_TOKEN_REMOTE_HOLD,
204 #endif
206 /* Setting option */
207 WPS_TOKEN_SETTING,
208 WPS_TOKEN_CURRENT_SCREEN,
209 WPS_TOKEN_LANG_IS_RTL,
211 /* Recording Tokens */
212 TOKEN_MARKER_RECORDING,
213 WPS_TOKEN_HAVE_RECORDING,
214 WPS_TOKEN_REC_FREQ,
215 WPS_TOKEN_REC_ENCODER,
216 WPS_TOKEN_REC_BITRATE, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */
217 WPS_TOKEN_REC_MONO,
219 TOKEN_MARKER_END, /* this needs to be the last value in this enum */
222 struct wps_token {
223 unsigned char type; /* enough to store the token type */
225 /* Whether the tag (e.g. track name or the album) refers the
226 current or the next song (false=current, true=next) */
227 bool next;
229 union {
230 char c;
231 unsigned short i;
232 void* data;
233 } value;
236 struct skin_token_list {
237 struct wps_token *token;
238 struct skin_token_list *next;
241 char* get_dir(char* buf, int buf_size, const char* path, int level);
243 #endif