Merge pull request #1187 from Karlson2k/Win32_Fix_UsbScan
[vuplus_xbmc] / xbmc / GUIInfoManager.h
1 /*!
2 \file GUIInfoManager.h
3 \brief
4 */
5
6 #ifndef GUIINFOMANAGER_H_
7 #define GUIINFOMANAGER_H_
8
9 /*
10  *      Copyright (C) 2005-2013 Team XBMC
11  *      http://xbmc.org
12  *
13  *  This Program is free software; you can redistribute it and/or modify
14  *  it under the terms of the GNU General Public License as published by
15  *  the Free Software Foundation; either version 2, or (at your option)
16  *  any later version.
17  *
18  *  This Program is distributed in the hope that it will be useful,
19  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  *  GNU General Public License for more details.
22  *
23  *  You should have received a copy of the GNU General Public License
24  *  along with XBMC; see the file COPYING.  If not, see
25  *  <http://www.gnu.org/licenses/>.
26  *
27  */
28
29 #include "Temperature.h"
30 #include "threads/CriticalSection.h"
31 #include "guilib/IMsgTargetCallback.h"
32 #include "inttypes.h"
33 #include "XBDateTime.h"
34 #include "utils/Observer.h"
35 #include "interfaces/info/SkinVariable.h"
36 #include "cores/IPlayer.h"
37
38 #include <list>
39 #include <map>
40
41 namespace MUSIC_INFO
42 {
43   class CMusicInfoTag;
44 }
45 class CVideoInfoTag;
46 class CFileItem;
47 class CGUIListItem;
48 class CDateTime;
49 namespace INFO
50 {
51   class InfoBool;
52   class InfoSingle;
53 }
54
55 // conditions for window retrieval
56 #define WINDOW_CONDITION_HAS_LIST_ITEMS  1
57 #define WINDOW_CONDITION_IS_MEDIA_WINDOW 2
58
59 #define PLAYER_HAS_MEDIA              1
60 #define PLAYER_HAS_AUDIO              2
61 #define PLAYER_HAS_VIDEO              3
62 #define PLAYER_PLAYING                4
63 #define PLAYER_PAUSED                 5
64 #define PLAYER_REWINDING              6
65 #define PLAYER_REWINDING_2x           7
66 #define PLAYER_REWINDING_4x           8
67 #define PLAYER_REWINDING_8x           9
68 #define PLAYER_REWINDING_16x         10
69 #define PLAYER_REWINDING_32x         11
70 #define PLAYER_FORWARDING            12
71 #define PLAYER_FORWARDING_2x         13
72 #define PLAYER_FORWARDING_4x         14
73 #define PLAYER_FORWARDING_8x         15
74 #define PLAYER_FORWARDING_16x        16
75 #define PLAYER_FORWARDING_32x        17
76 #define PLAYER_CAN_RECORD            18
77 #define PLAYER_RECORDING             19
78 #define PLAYER_CACHING               20
79 #define PLAYER_DISPLAY_AFTER_SEEK    21
80 #define PLAYER_PROGRESS              22
81 #define PLAYER_SEEKBAR               23
82 #define PLAYER_SEEKTIME              24
83 #define PLAYER_SEEKING               25
84 #define PLAYER_SHOWTIME              26
85 #define PLAYER_TIME                  27
86 #define PLAYER_TIME_REMAINING        28
87 #define PLAYER_DURATION              29
88 #define PLAYER_SHOWCODEC             30
89 #define PLAYER_SHOWINFO              31
90 #define PLAYER_VOLUME                32
91 #define PLAYER_MUTED                 33
92 #define PLAYER_HASDURATION           34
93 #define PLAYER_CHAPTER               35
94 #define PLAYER_CHAPTERCOUNT          36
95 #define PLAYER_TIME_SPEED            37
96 #define PLAYER_FINISH_TIME           38
97 #define PLAYER_CACHELEVEL            39
98 #define PLAYER_STAR_RATING           40
99 #define PLAYER_CHAPTERNAME           41
100 #define PLAYER_SUBTITLE_DELAY        42
101 #define PLAYER_AUDIO_DELAY           43
102 #define PLAYER_PASSTHROUGH           44
103 #define PLAYER_PATH                  45
104 #define PLAYER_FILEPATH              46
105 #define PLAYER_SEEKOFFSET            47
106 #define PLAYER_PROGRESS_CACHE        48
107 #define PLAYER_ITEM_ART              49
108 #define PLAYER_CAN_PAUSE             50
109 #define PLAYER_CAN_SEEK              51
110 #define PLAYER_START_TIME            52
111 #define PLAYER_TITLE                 53
112 #define PLAYER_ISINTERNETSTREAM      54
113 #define PLAYER_FILENAME              55
114
115 #define WEATHER_CONDITIONS          100
116 #define WEATHER_TEMPERATURE         101
117 #define WEATHER_LOCATION            102
118 #define WEATHER_IS_FETCHED          103
119 #define WEATHER_FANART_CODE         104
120 #define WEATHER_PLUGIN              105
121
122 #define SYSTEM_TEMPERATURE_UNITS    106
123 #define SYSTEM_PROGRESS_BAR         107
124 #define SYSTEM_LANGUAGE             108
125 #define SYSTEM_TIME                 110
126 #define SYSTEM_DATE                 111
127 #define SYSTEM_CPU_TEMPERATURE      112
128 #define SYSTEM_GPU_TEMPERATURE      113
129 #define SYSTEM_FAN_SPEED            114
130 #define SYSTEM_FREE_SPACE_C         115
131 // #define SYSTEM_FREE_SPACE_D         116 //116 is reserved for space on D
132 #define SYSTEM_FREE_SPACE_E         117
133 #define SYSTEM_FREE_SPACE_F         118
134 #define SYSTEM_FREE_SPACE_G         119
135 #define SYSTEM_BUILD_VERSION        120
136 #define SYSTEM_BUILD_DATE           121
137 #define SYSTEM_ETHERNET_LINK_ACTIVE 122
138 #define SYSTEM_FPS                  123
139 #define SYSTEM_ALWAYS_TRUE          125   // useful for <visible fade="10" start="hidden">true</visible>, to fade in a control
140 #define SYSTEM_ALWAYS_FALSE         126   // used for <visible fade="10">false</visible>, to fade out a control (ie not particularly useful!)
141 #define SYSTEM_MEDIA_DVD            127
142 #define SYSTEM_DVDREADY             128
143 #define SYSTEM_HAS_ALARM            129
144 #define SYSTEM_SCREEN_MODE          132
145 #define SYSTEM_SCREEN_WIDTH         133
146 #define SYSTEM_SCREEN_HEIGHT        134
147 #define SYSTEM_CURRENT_WINDOW       135
148 #define SYSTEM_CURRENT_CONTROL      136
149 #define SYSTEM_DVD_LABEL            138
150 #define SYSTEM_HASLOCKS             140
151 #define SYSTEM_ISMASTER             141
152 #define SYSTEM_TRAYOPEN             142
153 #define SYSTEM_SHOW_EXIT_BUTTON     143
154 #define SYSTEM_ALARM_POS            144
155 #define SYSTEM_LOGGEDON             145
156 #define SYSTEM_PROFILENAME          146
157 #define SYSTEM_PROFILETHUMB         147
158 #define SYSTEM_HAS_LOGINSCREEN      148
159 #define SYSTEM_HDD_SMART            150
160 #define SYSTEM_HDD_TEMPERATURE      151
161 #define SYSTEM_HDD_MODEL            152
162 #define SYSTEM_HDD_SERIAL           153
163 #define SYSTEM_HDD_FIRMWARE         154
164 #define SYSTEM_HDD_PASSWORD         156
165 #define SYSTEM_HDD_LOCKSTATE        157
166 #define SYSTEM_HDD_LOCKKEY          158
167 #define SYSTEM_INTERNET_STATE       159
168 #define SYSTEM_ALARM_LESS_OR_EQUAL  180
169 #define SYSTEM_PROFILECOUNT         181
170 #define SYSTEM_ISFULLSCREEN         182
171 #define SYSTEM_ISSTANDALONE         183
172 #define SYSTEM_ISINHIBIT            184
173 #define SYSTEM_HAS_SHUTDOWN         185
174 #define SYSTEM_HAS_PVR              186
175 #define SYSTEM_STARTUP_WINDOW       187
176 #define SYSTEM_STEREOSCOPIC_MODE    188
177
178 #define NETWORK_IP_ADDRESS          190
179 #define NETWORK_MAC_ADDRESS         191
180 #define NETWORK_IS_DHCP             192
181 #define NETWORK_LINK_STATE          193
182 #define NETWORK_SUBNET_MASK         194
183 #define NETWORK_GATEWAY_ADDRESS     195
184 #define NETWORK_DNS1_ADDRESS        196
185 #define NETWORK_DNS2_ADDRESS        197
186 #define NETWORK_DHCP_ADDRESS        198
187
188 #define MUSICPLAYER_TITLE           200
189 #define MUSICPLAYER_ALBUM           201
190 #define MUSICPLAYER_ARTIST          202
191 #define MUSICPLAYER_GENRE           203
192 #define MUSICPLAYER_YEAR            204
193 #define MUSICPLAYER_DURATION        205
194 #define MUSICPLAYER_TRACK_NUMBER    208
195 #define MUSICPLAYER_COVER           210
196 #define MUSICPLAYER_BITRATE         211
197 #define MUSICPLAYER_PLAYLISTLEN     212
198 #define MUSICPLAYER_PLAYLISTPOS     213
199 #define MUSICPLAYER_CHANNELS        214
200 #define MUSICPLAYER_BITSPERSAMPLE   215
201 #define MUSICPLAYER_SAMPLERATE      216
202 #define MUSICPLAYER_CODEC           217
203 #define MUSICPLAYER_DISC_NUMBER     218
204 #define MUSICPLAYER_RATING          219
205 #define MUSICPLAYER_COMMENT         220
206 #define MUSICPLAYER_LYRICS          221
207 #define MUSICPLAYER_HASPREVIOUS     222
208 #define MUSICPLAYER_HASNEXT         223
209 #define MUSICPLAYER_EXISTS          224
210 #define MUSICPLAYER_PLAYLISTPLAYING 225
211 #define MUSICPLAYER_ALBUM_ARTIST    226
212 #define MUSICPLAYER_PLAYCOUNT       227
213 #define MUSICPLAYER_LASTPLAYED      228
214 #define MUSICPLAYER_CHANNEL_NAME    229
215 #define MUSICPLAYER_CHANNEL_NUMBER  230
216 #define MUSICPLAYER_CHANNEL_GROUP   231
217
218 #define VIDEOPLAYER_TITLE             250
219 #define VIDEOPLAYER_GENRE             251
220 #define VIDEOPLAYER_DIRECTOR          252
221 #define VIDEOPLAYER_YEAR              253
222 #define VIDEOPLAYER_HASSUBTITLES      254
223 #define VIDEOPLAYER_SUBTITLESENABLED  255
224 #define VIDEOPLAYER_COVER             258
225 #define VIDEOPLAYER_USING_OVERLAYS    259
226 #define VIDEOPLAYER_ISFULLSCREEN      260
227 #define VIDEOPLAYER_HASMENU           261
228 #define VIDEOPLAYER_PLAYLISTLEN       262
229 #define VIDEOPLAYER_PLAYLISTPOS       263
230 #define VIDEOPLAYER_EVENT             264
231 #define VIDEOPLAYER_ORIGINALTITLE     265
232 #define VIDEOPLAYER_PLOT              266
233 #define VIDEOPLAYER_PLOT_OUTLINE      267
234 #define VIDEOPLAYER_EPISODE           268
235 #define VIDEOPLAYER_SEASON            269
236 #define VIDEOPLAYER_RATING            270
237 #define VIDEOPLAYER_TVSHOW            271
238 #define VIDEOPLAYER_PREMIERED         272
239 #define VIDEOPLAYER_CONTENT           273
240 #define VIDEOPLAYER_STUDIO            274
241 #define VIDEOPLAYER_MPAA              275
242 #define VIDEOPLAYER_CAST              276
243 #define VIDEOPLAYER_CAST_AND_ROLE     277
244 #define VIDEOPLAYER_ARTIST            278
245 #define VIDEOPLAYER_ALBUM             279
246 #define VIDEOPLAYER_WRITER            280
247 #define VIDEOPLAYER_TAGLINE           281
248 #define VIDEOPLAYER_HAS_INFO          282
249 #define VIDEOPLAYER_TOP250            283
250 #define VIDEOPLAYER_RATING_AND_VOTES  284
251 #define VIDEOPLAYER_TRAILER           285
252 #define VIDEOPLAYER_VIDEO_CODEC       286
253 #define VIDEOPLAYER_VIDEO_RESOLUTION  287
254 #define VIDEOPLAYER_AUDIO_CODEC       288
255 #define VIDEOPLAYER_AUDIO_CHANNELS    289
256 #define VIDEOPLAYER_VIDEO_ASPECT      290
257 #define VIDEOPLAYER_HASTELETEXT       291
258 #define VIDEOPLAYER_COUNTRY           292
259 #define VIDEOPLAYER_PLAYCOUNT         293
260 #define VIDEOPLAYER_LASTPLAYED        294
261
262 #define VIDEOPLAYER_STARTTIME         295
263 #define VIDEOPLAYER_ENDTIME           296
264 #define VIDEOPLAYER_NEXT_TITLE        297
265 #define VIDEOPLAYER_NEXT_GENRE        298
266 #define VIDEOPLAYER_NEXT_PLOT         299
267 #define VIDEOPLAYER_NEXT_PLOT_OUTLINE 300
268 #define VIDEOPLAYER_NEXT_STARTTIME    301
269 #define VIDEOPLAYER_NEXT_ENDTIME      302
270 #define VIDEOPLAYER_NEXT_DURATION     303
271 #define VIDEOPLAYER_CHANNEL_NAME      304
272 #define VIDEOPLAYER_CHANNEL_NUMBER    305
273 #define VIDEOPLAYER_CHANNEL_GROUP     306
274 #define VIDEOPLAYER_PARENTAL_RATING   307
275 #define VIDEOPLAYER_HAS_EPG           308
276 #define VIDEOPLAYER_VOTES             309
277 #define VIDEOPLAYER_IS_STEREOSCOPIC   310
278 #define VIDEOPLAYER_STEREOSCOPIC_MODE 311
279 #define VIDEOPLAYER_SUBTITLES_LANG    312
280 #define VIDEOPLAYER_AUDIO_LANG        313
281
282 #define CONTAINER_CAN_FILTER         342
283 #define CONTAINER_CAN_FILTERADVANCED 343
284 #define CONTAINER_FILTERED           344
285
286 #define CONTAINER_SCROLL_PREVIOUS   345 // NOTE: These 5 must be kept in this consecutive order
287 #define CONTAINER_MOVE_PREVIOUS     346
288 #define CONTAINER_STATIC            347
289 #define CONTAINER_MOVE_NEXT         348
290 #define CONTAINER_SCROLL_NEXT       349
291
292 #define CONTAINER_HASFILES          351
293 #define CONTAINER_HASFOLDERS        352
294 #define CONTAINER_STACKED           353
295 #define CONTAINER_FOLDERNAME        354
296 #define CONTAINER_SCROLLING         355
297 #define CONTAINER_PLUGINNAME        356
298 #define CONTAINER_PROPERTY          357
299 #define CONTAINER_SORT_DIRECTION    358
300 #define CONTAINER_NUM_ITEMS         359
301 #define CONTAINER_FOLDERTHUMB       360
302 #define CONTAINER_FOLDERPATH        361
303 #define CONTAINER_CONTENT           362
304 #define CONTAINER_HAS_THUMB         363
305 #define CONTAINER_SORT_METHOD       364
306
307 #define CONTAINER_HAS_FOCUS         367
308 #define CONTAINER_ROW               368
309 #define CONTAINER_COLUMN            369
310 #define CONTAINER_POSITION          370
311 #define CONTAINER_VIEWMODE          371
312 #define CONTAINER_HAS_NEXT          372
313 #define CONTAINER_HAS_PREVIOUS      373
314 #define CONTAINER_SUBITEM           374
315 #define CONTAINER_TVSHOWTHUMB       375
316 #define CONTAINER_NUM_PAGES         376
317 #define CONTAINER_CURRENT_PAGE      377
318 #define CONTAINER_SEASONTHUMB       378
319 #define CONTAINER_SHOWPLOT          379
320 #define CONTAINER_TOTALTIME         380
321
322 #define MUSICPM_ENABLED             381
323 #define MUSICPM_SONGSPLAYED         382
324 #define MUSICPM_MATCHINGSONGS       383
325 #define MUSICPM_MATCHINGSONGSPICKED 384
326 #define MUSICPM_MATCHINGSONGSLEFT   385
327 #define MUSICPM_RELAXEDSONGSPICKED  386
328 #define MUSICPM_RANDOMSONGSPICKED   387
329
330 #define PLAYLIST_LENGTH             390
331 #define PLAYLIST_POSITION           391
332 #define PLAYLIST_RANDOM             392
333 #define PLAYLIST_REPEAT             393
334 #define PLAYLIST_ISRANDOM           394
335 #define PLAYLIST_ISREPEAT           395
336 #define PLAYLIST_ISREPEATONE        396
337
338 #define VISUALISATION_LOCKED        400
339 #define VISUALISATION_PRESET        401
340 #define VISUALISATION_NAME          402
341 #define VISUALISATION_ENABLED       403
342
343 #define STRING_IS_EMPTY             410
344 #define STRING_COMPARE              411
345 #define STRING_STR                  412
346 #define INTEGER_GREATER_THAN        413
347 #define STRING_STR_LEFT             414
348 #define STRING_STR_RIGHT            415
349
350 #define SKIN_BOOL                   600
351 #define SKIN_STRING                 601
352 #define SKIN_HAS_MUSIC_OVERLAY      602
353 #define SKIN_HAS_VIDEO_OVERLAY      603
354 #define SKIN_THEME                  604
355 #define SKIN_COLOUR_THEME           605
356 #define SKIN_HAS_THEME              606
357 #define SKIN_ASPECT_RATIO           607
358
359 #define SYSTEM_TOTAL_MEMORY         644
360 #define SYSTEM_CPU_USAGE            645
361 #define SYSTEM_USED_MEMORY_PERCENT  646
362 #define SYSTEM_USED_MEMORY          647
363 #define SYSTEM_FREE_MEMORY          648
364 #define SYSTEM_FREE_MEMORY_PERCENT  649
365 #define SYSTEM_UPTIME               654
366 #define SYSTEM_TOTALUPTIME          655
367 #define SYSTEM_CPUFREQUENCY         656
368 #define SYSTEM_SCREEN_RESOLUTION    659
369 #define SYSTEM_VIDEO_ENCODER_INFO   660
370 #define SYSTEM_KERNEL_VERSION       667
371 #define SYSTEM_FREE_SPACE           679
372 #define SYSTEM_USED_SPACE           680
373 #define SYSTEM_TOTAL_SPACE          681
374 #define SYSTEM_USED_SPACE_PERCENT   682
375 #define SYSTEM_FREE_SPACE_PERCENT   683
376 #define SYSTEM_DVD_TRAY_STATE       700
377 #define SYSTEM_GET_BOOL             704
378 #define SYSTEM_GET_CORE_USAGE       705
379 #define SYSTEM_HAS_CORE_ID          706
380 #define SYSTEM_RENDER_VENDOR        707
381 #define SYSTEM_RENDER_RENDERER      708
382 #define SYSTEM_RENDER_VERSION       709
383 #define SYSTEM_SETTING              710
384 #define SYSTEM_HAS_ADDON            711
385 #define SYSTEM_ADDON_TITLE          712
386 #define SYSTEM_ADDON_ICON           713
387 #define SYSTEM_BATTERY_LEVEL        714
388 #define SYSTEM_IDLE_TIME            715
389 #define SYSTEM_FRIENDLY_NAME        716
390 #define SYSTEM_SCREENSAVER_ACTIVE   717
391 #define SYSTEM_ADDON_VERSION        718
392
393 #define LIBRARY_HAS_MUSIC           720
394 #define LIBRARY_HAS_VIDEO           721
395 #define LIBRARY_HAS_MOVIES          722
396 #define LIBRARY_HAS_MOVIE_SETS      723
397 #define LIBRARY_HAS_TVSHOWS         724
398 #define LIBRARY_HAS_MUSICVIDEOS     725
399 #define LIBRARY_IS_SCANNING         726
400 #define LIBRARY_IS_SCANNING_VIDEO   727
401 #define LIBRARY_IS_SCANNING_MUSIC   728
402
403 #define SYSTEM_PLATFORM_LINUX       741
404 #define SYSTEM_PLATFORM_WINDOWS     742
405 #define SYSTEM_PLATFORM_DARWIN      743
406 #define SYSTEM_PLATFORM_DARWIN_OSX  744
407 #define SYSTEM_PLATFORM_DARWIN_IOS  745
408 #define SYSTEM_PLATFORM_DARWIN_ATV2 746
409 #define SYSTEM_PLATFORM_ANDROID     747
410 #define SYSTEM_PLATFORM_LINUX_RASPBERRY_PI 748
411
412 #define SYSTEM_CAN_POWERDOWN        750
413 #define SYSTEM_CAN_SUSPEND          751
414 #define SYSTEM_CAN_HIBERNATE        752
415 #define SYSTEM_CAN_REBOOT           753
416
417 #define SLIDESHOW_ISPAUSED          800
418 #define SLIDESHOW_ISRANDOM          801
419 #define SLIDESHOW_ISACTIVE          802
420 #define SLIDESHOW_ISVIDEO           803
421
422 #define SLIDE_INFO_START            900
423 #define SLIDE_INFO_END              980
424
425 #define FANART_COLOR1               1000
426 #define FANART_COLOR2               1001
427 #define FANART_COLOR3               1002
428 #define FANART_IMAGE                1003
429
430 #define SYSTEM_PROFILEAUTOLOGIN     1004
431
432 #define PVR_CONDITIONS_START        1100
433 #define PVR_IS_RECORDING            (PVR_CONDITIONS_START)
434 #define PVR_HAS_TIMER               (PVR_CONDITIONS_START + 1)
435 #define PVR_HAS_NONRECORDING_TIMER  (PVR_CONDITIONS_START + 2)
436 #define PVR_HAS_EPG                 (PVR_CONDITIONS_START + 3)
437 #define PVR_HAS_TXT                 (PVR_CONDITIONS_START + 4)
438 #define PVR_HAS_DIRECTOR            (PVR_CONDITIONS_START + 5)
439 #define PVR_IS_PLAYING_TV           (PVR_CONDITIONS_START + 6)
440 #define PVR_IS_PLAYING_RADIO        (PVR_CONDITIONS_START + 7)
441 #define PVR_IS_PLAYING_RECORDING    (PVR_CONDITIONS_START + 8)
442 #define PVR_ACTUAL_STREAM_ENCRYPTED (PVR_CONDITIONS_START + 9)
443 #define PVR_CONDITIONS_END          PVR_ACTUAL_STREAM_ENCRYPTED
444
445 #define PVR_STRINGS_START           1200
446 #define PVR_NEXT_RECORDING_CHANNEL  (PVR_STRINGS_START)
447 #define PVR_NEXT_RECORDING_CHAN_ICO (PVR_STRINGS_START + 1)
448 #define PVR_NEXT_RECORDING_DATETIME (PVR_STRINGS_START + 2)
449 #define PVR_NEXT_RECORDING_TITLE    (PVR_STRINGS_START + 3)
450 #define PVR_NOW_RECORDING_CHANNEL   (PVR_STRINGS_START + 4)
451 #define PVR_NOW_RECORDING_CHAN_ICO  (PVR_STRINGS_START + 5)
452 #define PVR_NOW_RECORDING_DATETIME  (PVR_STRINGS_START + 6)
453 #define PVR_NOW_RECORDING_TITLE     (PVR_STRINGS_START + 7)
454 #define PVR_BACKEND_NAME            (PVR_STRINGS_START + 8)
455 #define PVR_BACKEND_VERSION         (PVR_STRINGS_START + 9)
456 #define PVR_BACKEND_HOST            (PVR_STRINGS_START + 10)
457 #define PVR_BACKEND_DISKSPACE       (PVR_STRINGS_START + 11)
458 #define PVR_BACKEND_CHANNELS        (PVR_STRINGS_START + 12)
459 #define PVR_BACKEND_TIMERS          (PVR_STRINGS_START + 13)
460 #define PVR_BACKEND_RECORDINGS      (PVR_STRINGS_START + 14)
461 #define PVR_BACKEND_NUMBER          (PVR_STRINGS_START + 15)
462 #define PVR_TOTAL_DISKSPACE         (PVR_STRINGS_START + 16)
463 #define PVR_NEXT_TIMER              (PVR_STRINGS_START + 17)
464 #define PVR_PLAYING_DURATION        (PVR_STRINGS_START + 18)
465 #define PVR_PLAYING_TIME            (PVR_STRINGS_START + 19)
466 #define PVR_PLAYING_PROGRESS        (PVR_STRINGS_START + 20)
467 #define PVR_ACTUAL_STREAM_CLIENT    (PVR_STRINGS_START + 21)
468 #define PVR_ACTUAL_STREAM_DEVICE    (PVR_STRINGS_START + 22)
469 #define PVR_ACTUAL_STREAM_STATUS    (PVR_STRINGS_START + 23)
470 #define PVR_ACTUAL_STREAM_SIG       (PVR_STRINGS_START + 24)
471 #define PVR_ACTUAL_STREAM_SNR       (PVR_STRINGS_START + 25)
472 #define PVR_ACTUAL_STREAM_SIG_PROGR (PVR_STRINGS_START + 26)
473 #define PVR_ACTUAL_STREAM_SNR_PROGR (PVR_STRINGS_START + 27)
474 #define PVR_ACTUAL_STREAM_BER       (PVR_STRINGS_START + 28)
475 #define PVR_ACTUAL_STREAM_UNC       (PVR_STRINGS_START + 29)
476 #define PVR_ACTUAL_STREAM_VIDEO_BR  (PVR_STRINGS_START + 30)
477 #define PVR_ACTUAL_STREAM_AUDIO_BR  (PVR_STRINGS_START + 31)
478 #define PVR_ACTUAL_STREAM_DOLBY_BR  (PVR_STRINGS_START + 32)
479 #define PVR_ACTUAL_STREAM_CRYPTION  (PVR_STRINGS_START + 33)
480 #define PVR_STRINGS_END             PVR_ACTUAL_STREAM_CRYPTION
481
482 #define WINDOW_PROPERTY             9993
483 #define WINDOW_IS_TOPMOST           9994
484 #define WINDOW_IS_VISIBLE           9995
485 #define WINDOW_NEXT                 9996
486 #define WINDOW_PREVIOUS             9997
487 #define WINDOW_IS_MEDIA             9998
488 #define WINDOW_IS_ACTIVE            9999
489
490 #define CONTROL_GET_LABEL           29996
491 #define CONTROL_IS_ENABLED          29997
492 #define CONTROL_IS_VISIBLE          29998
493 #define CONTROL_GROUP_HAS_FOCUS     29999
494 #define CONTROL_HAS_FOCUS           30000
495
496 #define VERSION_MAJOR               13
497 #define VERSION_MINOR               0
498 #define VERSION_TAG                 "-ALPHA10"
499
500 #define LISTITEM_START              35000
501 #define LISTITEM_THUMB              (LISTITEM_START)
502 #define LISTITEM_LABEL              (LISTITEM_START + 1)
503 #define LISTITEM_TITLE              (LISTITEM_START + 2)
504 #define LISTITEM_TRACKNUMBER        (LISTITEM_START + 3)
505 #define LISTITEM_ARTIST             (LISTITEM_START + 4)
506 #define LISTITEM_ALBUM              (LISTITEM_START + 5)
507 #define LISTITEM_YEAR               (LISTITEM_START + 6)
508 #define LISTITEM_GENRE              (LISTITEM_START + 7)
509 #define LISTITEM_ICON               (LISTITEM_START + 8)
510 #define LISTITEM_DIRECTOR           (LISTITEM_START + 9)
511 #define LISTITEM_OVERLAY            (LISTITEM_START + 10)
512 #define LISTITEM_LABEL2             (LISTITEM_START + 11)
513 #define LISTITEM_FILENAME           (LISTITEM_START + 12)
514 #define LISTITEM_DATE               (LISTITEM_START + 13)
515 #define LISTITEM_SIZE               (LISTITEM_START + 14)
516 #define LISTITEM_RATING             (LISTITEM_START + 15)
517 #define LISTITEM_PROGRAM_COUNT      (LISTITEM_START + 16)
518 #define LISTITEM_DURATION           (LISTITEM_START + 17)
519 #define LISTITEM_ISPLAYING          (LISTITEM_START + 18)
520 #define LISTITEM_ISSELECTED         (LISTITEM_START + 19)
521 #define LISTITEM_PLOT               (LISTITEM_START + 20)
522 #define LISTITEM_PLOT_OUTLINE       (LISTITEM_START + 21)
523 #define LISTITEM_EPISODE            (LISTITEM_START + 22)
524 #define LISTITEM_SEASON             (LISTITEM_START + 23)
525 #define LISTITEM_TVSHOW             (LISTITEM_START + 24)
526 #define LISTITEM_PREMIERED          (LISTITEM_START + 25)
527 #define LISTITEM_COMMENT            (LISTITEM_START + 26)
528 #define LISTITEM_ACTUAL_ICON        (LISTITEM_START + 27)
529 #define LISTITEM_PATH               (LISTITEM_START + 28)
530 #define LISTITEM_PICTURE_PATH       (LISTITEM_START + 29)
531 // the ordering of LISTITEM_PICTURE_* is important as they're mapped to SLIDE_* items in GUIInfoManager.cpp
532 #define LISTITEM_PICTURE_START      (LISTITEM_START + 30)
533 #define LISTITEM_PICTURE_RESOLUTION (LISTITEM_PICTURE_START) // => SLIDE_RESOLUTION
534 #define LISTITEM_PICTURE_LONGDATE   (LISTITEM_START + 31)    // => SLIDE_EXIF_LONG_DATE
535 #define LISTITEM_PICTURE_LONGDATETIME (LISTITEM_START + 32)    // => SLIDE_EXIF_LONG_DATE_TIME
536 #define LISTITEM_PICTURE_DATE       (LISTITEM_START + 33)    // => SLIDE_EXIF_DATE
537 #define LISTITEM_PICTURE_DATETIME   (LISTITEM_START + 34)    // => SLIDE_EXIF_DATE_TIME
538 #define LISTITEM_PICTURE_COMMENT    (LISTITEM_START + 35)    // => SLIDE_COMMENT
539 #define LISTITEM_PICTURE_CAPTION    (LISTITEM_START + 36)    // => SLIDE_IPTC_CAPTION
540 #define LISTITEM_PICTURE_DESC       (LISTITEM_START + 37)    // => SLIDE_EXIF_DESCRIPTION
541 #define LISTITEM_PICTURE_KEYWORDS   (LISTITEM_START + 38)    // => SLIDE_IPTC_KEYWORDS
542 #define LISTITEM_PICTURE_CAM_MAKE   (LISTITEM_START + 39)    // => SLIDE_EXIF_CAMERA_MAKE
543 #define LISTITEM_PICTURE_CAM_MODEL  (LISTITEM_START + 40)    // => SLIDE_EXIF_CAMERA_MODEL
544 #define LISTITEM_PICTURE_APERTURE   (LISTITEM_START + 41)    // => SLIDE_EXIF_APERTURE
545 #define LISTITEM_PICTURE_FOCAL_LEN  (LISTITEM_START + 42)    // => SLIDE_EXIF_FOCAL_LENGTH
546 #define LISTITEM_PICTURE_FOCUS_DIST (LISTITEM_START + 43)    // => SLIDE_EXIF_FOCUS_DIST
547 #define LISTITEM_PICTURE_EXP_MODE   (LISTITEM_START + 44)    // => SLIDE_EXIF_EXPOSURE_MODE
548 #define LISTITEM_PICTURE_EXP_TIME   (LISTITEM_START + 45)    // => SLIDE_EXIF_EXPOSURE_TIME
549 #define LISTITEM_PICTURE_ISO        (LISTITEM_START + 46)    // => SLIDE_EXIF_ISO_EQUIV
550 #define LISTITEM_PICTURE_AUTHOR           (LISTITEM_START + 47) // => SLIDE_IPTC_AUTHOR
551 #define LISTITEM_PICTURE_BYLINE           (LISTITEM_START + 48) // => SLIDE_IPTC_BYLINE
552 #define LISTITEM_PICTURE_BYLINE_TITLE     (LISTITEM_START + 49) // => SLIDE_IPTC_BYLINE_TITLE
553 #define LISTITEM_PICTURE_CATEGORY         (LISTITEM_START + 50) // => SLIDE_IPTC_CATEGORY
554 #define LISTITEM_PICTURE_CCD_WIDTH        (LISTITEM_START + 51) // => SLIDE_EXIF_CCD_WIDTH
555 #define LISTITEM_PICTURE_CITY             (LISTITEM_START + 52) // => SLIDE_IPTC_CITY
556 #define LISTITEM_PICTURE_URGENCY          (LISTITEM_START + 53) // => SLIDE_IPTC_URGENCY
557 #define LISTITEM_PICTURE_COPYRIGHT_NOTICE (LISTITEM_START + 54) // => SLIDE_IPTC_COPYRIGHT_NOTICE
558 #define LISTITEM_PICTURE_COUNTRY          (LISTITEM_START + 55) // => SLIDE_IPTC_COUNTRY
559 #define LISTITEM_PICTURE_COUNTRY_CODE     (LISTITEM_START + 56) // => SLIDE_IPTC_COUNTRY_CODE
560 #define LISTITEM_PICTURE_CREDIT           (LISTITEM_START + 57) // => SLIDE_IPTC_CREDIT
561 #define LISTITEM_PICTURE_IPTCDATE         (LISTITEM_START + 58) // => SLIDE_IPTC_DATE
562 #define LISTITEM_PICTURE_DIGITAL_ZOOM     (LISTITEM_START + 59) // => SLIDE_EXIF_DIGITAL_ZOOM
563 #define LISTITEM_PICTURE_EXPOSURE         (LISTITEM_START + 60) // => SLIDE_EXIF_EXPOSURE
564 #define LISTITEM_PICTURE_EXPOSURE_BIAS    (LISTITEM_START + 61) // => SLIDE_EXIF_EXPOSURE_BIAS
565 #define LISTITEM_PICTURE_FLASH_USED       (LISTITEM_START + 62) // => SLIDE_EXIF_FLASH_USED
566 #define LISTITEM_PICTURE_HEADLINE         (LISTITEM_START + 63) // => SLIDE_IPTC_HEADLINE
567 #define LISTITEM_PICTURE_COLOUR           (LISTITEM_START + 64) // => SLIDE_COLOUR
568 #define LISTITEM_PICTURE_LIGHT_SOURCE     (LISTITEM_START + 65) // => SLIDE_EXIF_LIGHT_SOURCE
569 #define LISTITEM_PICTURE_METERING_MODE    (LISTITEM_START + 66) // => SLIDE_EXIF_METERING_MODE
570 #define LISTITEM_PICTURE_OBJECT_NAME      (LISTITEM_START + 67) // => SLIDE_IPTC_OBJECT_NAME
571 #define LISTITEM_PICTURE_ORIENTATION      (LISTITEM_START + 68) // => SLIDE_EXIF_ORIENTATION
572 #define LISTITEM_PICTURE_PROCESS          (LISTITEM_START + 69) // => SLIDE_PROCESS
573 #define LISTITEM_PICTURE_REF_SERVICE      (LISTITEM_START + 70) // => SLIDE_IPTC_REF_SERVICE
574 #define LISTITEM_PICTURE_SOURCE           (LISTITEM_START + 71) // => SLIDE_IPTC_SOURCE
575 #define LISTITEM_PICTURE_SPEC_INSTR       (LISTITEM_START + 72) // => SLIDE_IPTC_SPEC_INSTR
576 #define LISTITEM_PICTURE_STATE            (LISTITEM_START + 73) // => SLIDE_IPTC_STATE
577 #define LISTITEM_PICTURE_SUP_CATEGORIES   (LISTITEM_START + 74) // => SLIDE_IPTC_SUP_CATEGORIES
578 #define LISTITEM_PICTURE_TX_REFERENCE     (LISTITEM_START + 75) // => SLIDE_IPTC_TX_REFERENCE
579 #define LISTITEM_PICTURE_WHITE_BALANCE    (LISTITEM_START + 76) // => SLIDE_EXIF_WHITE_BALANCE
580 #define LISTITEM_PICTURE_IMAGETYPE        (LISTITEM_START + 77) // => SLIDE_IPTC_IMAGETYPE
581 #define LISTITEM_PICTURE_SUBLOCATION      (LISTITEM_START + 78) // => SLIDE_IPTC_SUBLOCATION
582 #define LISTITEM_PICTURE_TIMECREATED      (LISTITEM_START + 79) // => SLIDE_IPTC_TIMECREATED
583 #define LISTITEM_PICTURE_GPS_LAT    (LISTITEM_START + 80)    // => SLIDE_EXIF_GPS_LATITUDE
584 #define LISTITEM_PICTURE_GPS_LON    (LISTITEM_START + 81)    // => SLIDE_EXIF_GPS_LONGITUDE
585 #define LISTITEM_PICTURE_GPS_ALT    (LISTITEM_START + 82)    // => SLIDE_EXIF_GPS_ALTITUDE
586 #define LISTITEM_PICTURE_END        (LISTITEM_PICTURE_GPS_ALT)
587 #define LISTITEM_STUDIO             (LISTITEM_START + 83)
588 #define LISTITEM_MPAA               (LISTITEM_START + 84)
589 #define LISTITEM_CAST               (LISTITEM_START + 85)
590 #define LISTITEM_CAST_AND_ROLE      (LISTITEM_START + 86)
591 #define LISTITEM_WRITER             (LISTITEM_START + 87)
592 #define LISTITEM_TAGLINE            (LISTITEM_START + 88)
593 #define LISTITEM_TOP250             (LISTITEM_START + 89)
594 #define LISTITEM_RATING_AND_VOTES   (LISTITEM_START + 90)
595 #define LISTITEM_TRAILER            (LISTITEM_START + 91)
596 #define LISTITEM_STAR_RATING        (LISTITEM_START + 92)
597 #define LISTITEM_FILENAME_AND_PATH  (LISTITEM_START + 93)
598 #define LISTITEM_SORT_LETTER        (LISTITEM_START + 94)
599 #define LISTITEM_ALBUM_ARTIST       (LISTITEM_START + 95)
600 #define LISTITEM_FOLDERNAME         (LISTITEM_START + 96)
601 #define LISTITEM_VIDEO_CODEC        (LISTITEM_START + 97)
602 #define LISTITEM_VIDEO_RESOLUTION   (LISTITEM_START + 98)
603 #define LISTITEM_VIDEO_ASPECT       (LISTITEM_START + 99)
604 #define LISTITEM_AUDIO_CODEC        (LISTITEM_START + 100)
605 #define LISTITEM_AUDIO_CHANNELS     (LISTITEM_START + 101)
606 #define LISTITEM_AUDIO_LANGUAGE     (LISTITEM_START + 102)
607 #define LISTITEM_SUBTITLE_LANGUAGE  (LISTITEM_START + 103)
608 #define LISTITEM_IS_FOLDER          (LISTITEM_START + 104)
609 #define LISTITEM_ORIGINALTITLE      (LISTITEM_START + 105)
610 #define LISTITEM_COUNTRY            (LISTITEM_START + 106)
611 #define LISTITEM_PLAYCOUNT          (LISTITEM_START + 107)
612 #define LISTITEM_LASTPLAYED         (LISTITEM_START + 108)
613 #define LISTITEM_FOLDERPATH         (LISTITEM_START + 109)
614 #define LISTITEM_DISC_NUMBER        (LISTITEM_START + 110)
615 #define LISTITEM_FILE_EXTENSION     (LISTITEM_START + 111)
616 #define LISTITEM_IS_RESUMABLE       (LISTITEM_START + 112)
617 #define LISTITEM_PERCENT_PLAYED     (LISTITEM_START + 113)
618 #define LISTITEM_DATE_ADDED         (LISTITEM_START + 114)
619 #define LISTITEM_DBTYPE             (LISTITEM_START + 115)
620 #define LISTITEM_DBID               (LISTITEM_START + 116)
621
622 #define LISTITEM_STARTTIME          (LISTITEM_START + 117)
623 #define LISTITEM_ENDTIME            (LISTITEM_START + 118)
624 #define LISTITEM_STARTDATE          (LISTITEM_START + 119)
625 #define LISTITEM_ENDDATE            (LISTITEM_START + 120)
626 #define LISTITEM_NEXT_TITLE         (LISTITEM_START + 121)
627 #define LISTITEM_NEXT_GENRE         (LISTITEM_START + 122)
628 #define LISTITEM_NEXT_PLOT          (LISTITEM_START + 123)
629 #define LISTITEM_NEXT_PLOT_OUTLINE  (LISTITEM_START + 124)
630 #define LISTITEM_NEXT_STARTTIME     (LISTITEM_START + 125)
631 #define LISTITEM_NEXT_ENDTIME       (LISTITEM_START + 126)
632 #define LISTITEM_NEXT_STARTDATE     (LISTITEM_START + 127)
633 #define LISTITEM_NEXT_ENDDATE       (LISTITEM_START + 128)
634 #define LISTITEM_NEXT_DURATION      (LISTITEM_START + 129)
635 #define LISTITEM_CHANNEL_NAME       (LISTITEM_START + 130)
636 #define LISTITEM_CHANNEL_NUMBER     (LISTITEM_START + 131)
637 #define LISTITEM_CHANNEL_GROUP      (LISTITEM_START + 132)
638 #define LISTITEM_HASTIMER           (LISTITEM_START + 133)
639 #define LISTITEM_ISRECORDING        (LISTITEM_START + 134)
640 #define LISTITEM_ISENCRYPTED        (LISTITEM_START + 135)
641 #define LISTITEM_PARENTALRATING     (LISTITEM_START + 136)
642 #define LISTITEM_PROGRESS           (LISTITEM_START + 137)
643 #define LISTITEM_HAS_EPG            (LISTITEM_START + 138)
644 #define LISTITEM_VOTES              (LISTITEM_START + 139)
645 #define LISTITEM_STEREOSCOPIC_MODE  (LISTITEM_START + 140)
646 #define LISTITEM_IS_STEREOSCOPIC    (LISTITEM_START + 141)
647
648 #define LISTITEM_PROPERTY_START     (LISTITEM_START + 200)
649 #define LISTITEM_PROPERTY_END       (LISTITEM_PROPERTY_START + 1000)
650 #define LISTITEM_END                (LISTITEM_PROPERTY_END)
651
652 #define MUSICPLAYER_PROPERTY_OFFSET 800 // 100 id's reserved for musicplayer props.
653 #define LISTITEM_ART_OFFSET         900 // 100 id's reserved for listitem art.
654
655 #define CONDITIONAL_LABEL_START       LISTITEM_END + 1 // 36001
656 #define CONDITIONAL_LABEL_END         37000
657
658 // the multiple information vector
659 #define MULTI_INFO_START              40000
660 #define MULTI_INFO_END                99999
661 #define COMBINED_VALUES_START        100000
662
663 // forward
664 class CInfoLabel;
665 class CGUIWindow;
666 namespace EPG { class CEpgInfoTag; }
667
668 // Info Flags
669 // Stored in the top 8 bits of GUIInfo::m_data1
670 // therefore we only have room for 8 flags
671 #define INFOFLAG_LISTITEM_WRAP        ((uint32_t) (1 << 25))  // Wrap ListItem lookups
672 #define INFOFLAG_LISTITEM_POSITION    ((uint32_t) (1 << 26))  // Absolute ListItem lookups
673
674 // structure to hold multiple integer data
675 // for storage referenced from a single integer
676 class GUIInfo
677 {
678 public:
679   GUIInfo(int info, uint32_t data1 = 0, int data2 = 0, uint32_t flag = 0)
680   {
681     m_info = info;
682     m_data1 = data1;
683     m_data2 = data2;
684     if (flag)
685       SetInfoFlag(flag);
686   }
687   bool operator ==(const GUIInfo &right) const
688   {
689     return (m_info == right.m_info && m_data1 == right.m_data1 && m_data2 == right.m_data2);
690   };
691   uint32_t GetInfoFlag() const;
692   uint32_t GetData1() const;
693   int GetData2() const;
694   int m_info;
695 private:
696   void SetInfoFlag(uint32_t flag);
697   uint32_t m_data1;
698   int m_data2;
699 };
700
701 /*!
702  \ingroup strings
703  \brief
704  */
705 class CGUIInfoManager : public IMsgTargetCallback, public Observable
706 {
707 public:
708   CGUIInfoManager(void);
709   virtual ~CGUIInfoManager(void);
710
711   void Clear();
712   virtual bool OnMessage(CGUIMessage &message);
713
714   /*! \brief Register a boolean condition/expression
715    This routine allows controls or other clients of the info manager to register
716    to receive updates of particular expressions, in a particular context (currently windows).
717
718    In the future, it will allow clients to receive pushed callbacks when the expression changes.
719
720    \param expression the boolean condition or expression
721    \param context the context window
722    \return an identifier used to reference this expression
723
724    \sa GetBoolValue
725    */
726   unsigned int Register(const CStdString &expression, int context = 0);
727
728   /*! \brief Get a previously registered boolean expression's value
729    Checks the cache and evaluates the boolean expression if required.
730    \sa Register
731    */
732   bool GetBoolValue(unsigned int expression, const CGUIListItem *item = NULL);
733
734   /*! \brief Evaluate a boolean expression
735    \param expression the expression to evaluate
736    \param context the context in which to evaluate the expression (currently windows)
737    \return the value of the evaluated expression.
738    \sa Register, GetBoolValue
739    */
740   bool EvaluateBool(const CStdString &expression, int context = 0);
741
742   int TranslateString(const CStdString &strCondition);
743
744   /*! \brief Get integer value of info.
745    \param value int reference to pass value of given info
746    \param info id of info
747    \param context the context in which to evaluate the expression (currently windows)
748    \param item optional listitem if want to get listitem related int
749    \return true if given info was handled
750    \sa GetItemInt, GetMultiInfoInt
751    */
752   bool GetInt(int &value, int info, int contextWindow = 0, const CGUIListItem *item = NULL) const;
753   CStdString GetLabel(int info, int contextWindow = 0, CStdString *fallback = NULL);
754
755   CStdString GetImage(int info, int contextWindow, CStdString *fallback = NULL);
756
757   CStdString GetTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
758   CStdString GetDate(bool bNumbersOnly = false);
759   CStdString GetDuration(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
760
761   void SetCurrentItem(CFileItem &item);
762   void ResetCurrentItem();
763   // Current song stuff
764   /// \brief Retrieves tag info (if necessary) and fills in our current song path.
765   void SetCurrentSong(CFileItem &item);
766   void SetCurrentAlbumThumb(const CStdString thumbFileName);
767   void SetCurrentMovie(CFileItem &item);
768   void SetCurrentSlide(CFileItem &item);
769   const CFileItem &GetCurrentSlide() const;
770   void ResetCurrentSlide();
771   void SetCurrentSongTag(const MUSIC_INFO::CMusicInfoTag &tag);
772   void SetCurrentVideoTag(const CVideoInfoTag &tag);
773
774   const MUSIC_INFO::CMusicInfoTag *GetCurrentSongTag() const;
775   const CVideoInfoTag* GetCurrentMovieTag() const;
776
777   CStdString GetMusicLabel(int item);
778   CStdString GetMusicTagLabel(int info, const CFileItem *item);
779   CStdString GetVideoLabel(int item);
780   CStdString GetPlaylistLabel(int item, int playlistid = -1 /* PLAYLIST_NONE */) const;
781   CStdString GetMusicPartyModeLabel(int item);
782   const CStdString GetMusicPlaylistInfo(const GUIInfo& info);
783   CStdString GetPictureLabel(int item);
784
785   int64_t GetPlayTime() const;  // in ms
786   CStdString GetCurrentPlayTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
787   CStdString GetCurrentSeekTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
788   int GetPlayTimeRemaining() const;
789   int GetTotalPlayTime() const;
790   CStdString GetCurrentPlayTimeRemaining(TIME_FORMAT format) const;
791   CStdString GetVersion();
792   CStdString GetBuild();
793
794   bool GetDisplayAfterSeek();
795   void SetDisplayAfterSeek(unsigned int timeOut = 2500, int seekOffset = 0);
796   void SetSeeking(bool seeking) { m_playerSeeking = seeking; };
797   void SetShowTime(bool showtime) { m_playerShowTime = showtime; };
798   void SetShowCodec(bool showcodec) { m_playerShowCodec = showcodec; };
799   void SetShowInfo(bool showinfo) { m_playerShowInfo = showinfo; };
800   void ToggleShowCodec() { m_playerShowCodec = !m_playerShowCodec; };
801   bool ToggleShowInfo() { m_playerShowInfo = !m_playerShowInfo; return m_playerShowInfo; };
802   bool m_performingSeek;
803
804   std::string GetSystemHeatInfo(int info);
805   CTemperature GetGPUTemperature();
806
807   void UpdateFPS();
808   void UpdateAVInfo();
809   inline float GetFPS() const { return m_fps; };
810
811   void SetNextWindow(int windowID) { m_nextWindowID = windowID; };
812   void SetPreviousWindow(int windowID) { m_prevWindowID = windowID; };
813
814   void ResetCache();
815   bool GetItemInt(int &value, const CGUIListItem *item, int info) const;
816   CStdString GetItemLabel(const CFileItem *item, int info, CStdString *fallback = NULL);
817   CStdString GetItemImage(const CFileItem *item, int info, CStdString *fallback = NULL);
818
819   // Called from tuxbox service thread to update current status
820   void UpdateFromTuxBox();
821
822   /*! \brief containers call here to specify that the focus is changing
823    \param id control id
824    \param next true if we're moving to the next item, false if previous
825    \param scrolling true if the container is scrolling, false if the movement requires no scroll
826    */
827   void SetContainerMoving(int id, bool next, bool scrolling)
828   {
829     // magnitude 2 indicates a scroll, sign indicates direction
830     m_containerMoves[id] = (next ? 1 : -1) * (scrolling ? 2 : 1);
831   }
832
833   void SetLibraryBool(int condition, bool value);
834   bool GetLibraryBool(int condition);
835   void ResetLibraryBools();
836   CStdString LocalizeTime(const CDateTime &time, TIME_FORMAT format) const;
837
838   int TranslateSingleString(const CStdString &strCondition);
839
840   int RegisterSkinVariableString(const INFO::CSkinVariableString* info);
841   int TranslateSkinVariableString(const CStdString& name, int context);
842   CStdString GetSkinVariableString(int info, bool preferImage = false, const CGUIListItem *item=NULL);
843
844   /// \brief iterates through boolean conditions and compares their stored values to current values. Returns true if any condition changed value.
845   bool ConditionsChangedValues(const std::map<int, bool>& map);
846
847   bool m_AVInfoValid;
848
849 protected:
850   friend class INFO::InfoSingle;
851   bool GetBool(int condition, int contextWindow = 0, const CGUIListItem *item=NULL);
852
853   // routines for window retrieval
854   bool CheckWindowCondition(CGUIWindow *window, int condition) const;
855   CGUIWindow *GetWindowWithCondition(int contextWindow, int condition) const;
856
857   /*! \brief class for holding information on properties
858    */
859   class Property
860   {
861   public:
862     Property(const CStdString &property, const CStdString &parameters);
863
864     const CStdString &param(unsigned int n = 0) const;
865     unsigned int num_params() const;
866
867     CStdString name;
868   private:
869     std::vector<CStdString> params;
870   };
871
872   bool GetMultiInfoBool(const GUIInfo &info, int contextWindow = 0, const CGUIListItem *item = NULL);
873   bool GetMultiInfoInt(int &value, const GUIInfo &info, int contextWindow = 0) const;
874   CStdString GetMultiInfoLabel(const GUIInfo &info, int contextWindow = 0, CStdString *fallback = NULL);
875   int TranslateListItem(const Property &info);
876   int TranslateMusicPlayerString(const CStdString &info) const;
877   TIME_FORMAT TranslateTimeFormat(const CStdString &format);
878   bool GetItemBool(const CGUIListItem *item, int condition) const;
879
880   /*! \brief Split an info string into it's constituent parts and parameters
881    Format is:
882      
883      info1(params1).info2(params2).info3(params3) ...
884    
885    where the parameters are an optional comma separated parameter list.
886    
887    \param infoString the original string
888    \param info the resulting pairs of info and parameters.
889    */
890   void SplitInfoString(const CStdString &infoString, std::vector<Property> &info);
891
892   // Conditional string parameters for testing are stored in a vector for later retrieval.
893   // The offset into the string parameters array is returned.
894   int ConditionalStringParameter(const CStdString &strParameter, bool caseSensitive = false);
895   int AddMultiInfo(const GUIInfo &info);
896   int AddListItemProp(const CStdString &str, int offset=0);
897
898   /*!
899    * @brief Get the EPG tag that is currently active
900    * @param tag The active tag
901    * @return True if an EPG tag is active and 'tag' was updated, false otherwise
902    */
903   bool GetEpgInfoTag(EPG::CEpgInfoTag& tag) const;
904
905   // Conditional string parameters are stored here
906   CStdStringArray m_stringParameters;
907
908   // Array of multiple information mapped to a single integer lookup
909   std::vector<GUIInfo> m_multiInfo;
910   std::vector<std::string> m_listitemProperties;
911
912   CStdString m_currentMovieDuration;
913
914   // Current playing stuff
915   CFileItem* m_currentFile;
916   CStdString m_currentMovieThumb;
917   CFileItem* m_currentSlide;
918
919   // fan stuff
920   unsigned int m_lastSysHeatInfoTime;
921   int m_fanSpeed;
922   CTemperature m_gpuTemp;
923   CTemperature m_cpuTemp;
924
925   //Fullscreen OSD Stuff
926   unsigned int m_AfterSeekTimeout;
927   int m_seekOffset;
928   bool m_playerSeeking;
929   bool m_playerShowTime;
930   bool m_playerShowCodec;
931   bool m_playerShowInfo;
932
933   // FPS counters
934   float m_fps;
935   unsigned int m_frameCounter;
936   unsigned int m_lastFPSTime;
937
938   std::map<int, int> m_containerMoves;  // direction of list moving
939   int m_nextWindowID;
940   int m_prevWindowID;
941
942   std::vector<INFO::InfoBool*> m_bools;
943   std::vector<INFO::CSkinVariableString> m_skinVariableStrings;
944   unsigned int m_updateTime;
945
946   int m_libraryHasMusic;
947   int m_libraryHasMovies;
948   int m_libraryHasTVShows;
949   int m_libraryHasMusicVideos;
950   int m_libraryHasMovieSets;
951
952   SPlayerVideoStreamInfo m_videoInfo;
953   SPlayerAudioStreamInfo m_audioInfo;
954
955   CCriticalSection m_critInfo;
956 };
957
958 /*!
959  \ingroup strings
960  \brief
961  */
962 extern CGUIInfoManager g_infoManager;
963 #endif
964
965
966
967