6 #ifndef GUIINFOMANAGER_H_
7 #define GUIINFOMANAGER_H_
10 * Copyright (C) 2005-2008 Team XBMC
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)
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.
23 * You should have received a copy of the GNU General Public License
24 * along with XBMC; see the file COPYING. If not, write to
25 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26 * http://www.gnu.org/copyleft/gpl.html
30 #include "Temperature.h"
31 #include "threads/CriticalSection.h"
32 #include "guilib/IMsgTargetCallback.h"
34 #include "XBDateTime.h"
35 #include "interfaces/info/SkinVariable.h"
54 // conditions for window retrieval
55 #define WINDOW_CONDITION_HAS_LIST_ITEMS 1
56 #define WINDOW_CONDITION_IS_MEDIA_WINDOW 2
58 #define PLAYER_HAS_MEDIA 1
59 #define PLAYER_HAS_AUDIO 2
60 #define PLAYER_HAS_VIDEO 3
61 #define PLAYER_PLAYING 4
62 #define PLAYER_PAUSED 5
63 #define PLAYER_REWINDING 6
64 #define PLAYER_REWINDING_2x 7
65 #define PLAYER_REWINDING_4x 8
66 #define PLAYER_REWINDING_8x 9
67 #define PLAYER_REWINDING_16x 10
68 #define PLAYER_REWINDING_32x 11
69 #define PLAYER_FORWARDING 12
70 #define PLAYER_FORWARDING_2x 13
71 #define PLAYER_FORWARDING_4x 14
72 #define PLAYER_FORWARDING_8x 15
73 #define PLAYER_FORWARDING_16x 16
74 #define PLAYER_FORWARDING_32x 17
75 #define PLAYER_CAN_RECORD 18
76 #define PLAYER_RECORDING 19
77 #define PLAYER_CACHING 20
78 #define PLAYER_DISPLAY_AFTER_SEEK 21
79 #define PLAYER_PROGRESS 22
80 #define PLAYER_SEEKBAR 23
81 #define PLAYER_SEEKTIME 24
82 #define PLAYER_SEEKING 25
83 #define PLAYER_SHOWTIME 26
84 #define PLAYER_TIME 27
85 #define PLAYER_TIME_REMAINING 28
86 #define PLAYER_DURATION 29
87 #define PLAYER_SHOWCODEC 30
88 #define PLAYER_SHOWINFO 31
89 #define PLAYER_VOLUME 32
90 #define PLAYER_MUTED 33
91 #define PLAYER_HASDURATION 34
92 #define PLAYER_CHAPTER 35
93 #define PLAYER_CHAPTERCOUNT 36
94 #define PLAYER_TIME_SPEED 37
95 #define PLAYER_FINISH_TIME 38
96 #define PLAYER_CACHELEVEL 39
97 #define PLAYER_STAR_RATING 40
98 #define PLAYER_CHAPTERNAME 41
99 #define PLAYER_SUBTITLE_DELAY 42
100 #define PLAYER_AUDIO_DELAY 43
101 #define PLAYER_PASSTHROUGH 44
102 #define PLAYER_PATH 45
103 #define PLAYER_FILEPATH 46
104 #define PLAYER_SEEKOFFSET 47
105 #define PLAYER_PROGRESS_CACHE 48
106 #define PLAYER_ITEM_PROPERTY 49
108 #define WEATHER_CONDITIONS 100
109 #define WEATHER_TEMPERATURE 101
110 #define WEATHER_LOCATION 102
111 #define WEATHER_IS_FETCHED 103
112 #define WEATHER_FANART_CODE 104
113 #define WEATHER_PLUGIN 105
115 #define SYSTEM_TEMPERATURE_UNITS 106
116 #define SYSTEM_PROGRESS_BAR 107
117 #define SYSTEM_LANGUAGE 108
118 #define SYSTEM_TIME 110
119 #define SYSTEM_DATE 111
120 #define SYSTEM_CPU_TEMPERATURE 112
121 #define SYSTEM_GPU_TEMPERATURE 113
122 #define SYSTEM_FAN_SPEED 114
123 #define SYSTEM_FREE_SPACE_C 115
124 // #define SYSTEM_FREE_SPACE_D 116 //116 is reserved for space on D
125 #define SYSTEM_FREE_SPACE_E 117
126 #define SYSTEM_FREE_SPACE_F 118
127 #define SYSTEM_FREE_SPACE_G 119
128 #define SYSTEM_BUILD_VERSION 120
129 #define SYSTEM_BUILD_DATE 121
130 #define SYSTEM_ETHERNET_LINK_ACTIVE 122
131 #define SYSTEM_FPS 123
132 #define SYSTEM_ALWAYS_TRUE 125 // useful for <visible fade="10" start="hidden">true</visible>, to fade in a control
133 #define SYSTEM_ALWAYS_FALSE 126 // used for <visible fade="10">false</visible>, to fade out a control (ie not particularly useful!)
134 #define SYSTEM_MEDIA_DVD 127
135 #define SYSTEM_DVDREADY 128
136 #define SYSTEM_HAS_ALARM 129
137 #define SYSTEM_SCREEN_MODE 132
138 #define SYSTEM_SCREEN_WIDTH 133
139 #define SYSTEM_SCREEN_HEIGHT 134
140 #define SYSTEM_CURRENT_WINDOW 135
141 #define SYSTEM_CURRENT_CONTROL 136
142 #define SYSTEM_DVD_LABEL 138
143 #define SYSTEM_HASLOCKS 140
144 #define SYSTEM_ISMASTER 141
145 #define SYSTEM_TRAYOPEN 142
146 #define SYSTEM_SHOW_EXIT_BUTTON 143
147 #define SYSTEM_ALARM_POS 144
148 #define SYSTEM_LOGGEDON 145
149 #define SYSTEM_PROFILENAME 146
150 #define SYSTEM_PROFILETHUMB 147
151 #define SYSTEM_HAS_LOGINSCREEN 148
152 #define SYSTEM_HDD_SMART 150
153 #define SYSTEM_HDD_TEMPERATURE 151
154 #define SYSTEM_HDD_MODEL 152
155 #define SYSTEM_HDD_SERIAL 153
156 #define SYSTEM_HDD_FIRMWARE 154
157 #define SYSTEM_HDD_PASSWORD 156
158 #define SYSTEM_HDD_LOCKSTATE 157
159 #define SYSTEM_HDD_LOCKKEY 158
160 #define SYSTEM_INTERNET_STATE 159
161 #define LCD_PLAY_ICON 160
162 #define LCD_PROGRESS_BAR 161
163 #define LCD_CPU_TEMPERATURE 162
164 #define LCD_GPU_TEMPERATURE 163
165 #define LCD_HDD_TEMPERATURE 164
166 #define LCD_FAN_SPEED 165
168 #define LCD_TIME_21 172 // Small bigfont
169 #define LCD_TIME_22 173
170 #define LCD_TIME_W21 174 // Medum bigfont
171 #define LCD_TIME_W22 175
172 #define LCD_TIME_41 176 // Big bigfont
173 #define LCD_TIME_42 177
174 #define LCD_TIME_43 178
175 #define LCD_TIME_44 179
176 #define SYSTEM_ALARM_LESS_OR_EQUAL 180
177 #define SYSTEM_PROFILECOUNT 181
178 #define SYSTEM_ISFULLSCREEN 182
179 #define SYSTEM_ISSTANDALONE 183
180 #define SYSTEM_HAS_PVR 184
182 #define NETWORK_IP_ADDRESS 190
183 #define NETWORK_MAC_ADDRESS 191
184 #define NETWORK_IS_DHCP 192
185 #define NETWORK_LINK_STATE 193
186 #define NETWORK_SUBNET_MASK 194
187 #define NETWORK_GATEWAY_ADDRESS 195
188 #define NETWORK_DNS1_ADDRESS 196
189 #define NETWORK_DNS2_ADDRESS 197
190 #define NETWORK_DHCP_ADDRESS 198
192 #define MUSICPLAYER_TITLE 200
193 #define MUSICPLAYER_ALBUM 201
194 #define MUSICPLAYER_ARTIST 202
195 #define MUSICPLAYER_GENRE 203
196 #define MUSICPLAYER_YEAR 204
197 #define MUSICPLAYER_DURATION 205
198 #define MUSICPLAYER_TRACK_NUMBER 208
199 #define MUSICPLAYER_COVER 210
200 #define MUSICPLAYER_BITRATE 211
201 #define MUSICPLAYER_PLAYLISTLEN 212
202 #define MUSICPLAYER_PLAYLISTPOS 213
203 #define MUSICPLAYER_CHANNELS 214
204 #define MUSICPLAYER_BITSPERSAMPLE 215
205 #define MUSICPLAYER_SAMPLERATE 216
206 #define MUSICPLAYER_CODEC 217
207 #define MUSICPLAYER_DISC_NUMBER 218
208 #define MUSICPLAYER_RATING 219
209 #define MUSICPLAYER_COMMENT 220
210 #define MUSICPLAYER_LYRICS 221
211 #define MUSICPLAYER_HASPREVIOUS 222
212 #define MUSICPLAYER_HASNEXT 223
213 #define MUSICPLAYER_EXISTS 224
214 #define MUSICPLAYER_PLAYLISTPLAYING 225
215 #define MUSICPLAYER_ALBUM_ARTIST 226
216 #define MUSICPLAYER_PLAYCOUNT 227
217 #define MUSICPLAYER_LASTPLAYED 228
219 #define VIDEOPLAYER_TITLE 250
220 #define VIDEOPLAYER_GENRE 251
221 #define VIDEOPLAYER_DIRECTOR 252
222 #define VIDEOPLAYER_YEAR 253
223 #define VIDEOPLAYER_HASSUBTITLES 254
224 #define VIDEOPLAYER_SUBTITLESENABLED 255
225 #define VIDEOPLAYER_COVER 258
226 #define VIDEOPLAYER_USING_OVERLAYS 259
227 #define VIDEOPLAYER_ISFULLSCREEN 260
228 #define VIDEOPLAYER_HASMENU 261
229 #define VIDEOPLAYER_PLAYLISTLEN 262
230 #define VIDEOPLAYER_PLAYLISTPOS 263
231 #define VIDEOPLAYER_EVENT 264
232 #define VIDEOPLAYER_ORIGINALTITLE 265
233 #define VIDEOPLAYER_PLOT 266
234 #define VIDEOPLAYER_PLOT_OUTLINE 267
235 #define VIDEOPLAYER_EPISODE 268
236 #define VIDEOPLAYER_SEASON 269
237 #define VIDEOPLAYER_RATING 270
238 #define VIDEOPLAYER_TVSHOW 271
239 #define VIDEOPLAYER_PREMIERED 272
240 #define VIDEOPLAYER_CONTENT 273
241 #define VIDEOPLAYER_STUDIO 274
242 #define VIDEOPLAYER_MPAA 275
243 #define VIDEOPLAYER_CAST 276
244 #define VIDEOPLAYER_CAST_AND_ROLE 277
245 #define VIDEOPLAYER_ARTIST 278
246 #define VIDEOPLAYER_ALBUM 279
247 #define VIDEOPLAYER_WRITER 280
248 #define VIDEOPLAYER_TAGLINE 281
249 #define VIDEOPLAYER_HAS_INFO 282
250 #define VIDEOPLAYER_TOP250 283
251 #define VIDEOPLAYER_RATING_AND_VOTES 284
252 #define VIDEOPLAYER_TRAILER 285
253 #define VIDEOPLAYER_VIDEO_CODEC 286
254 #define VIDEOPLAYER_VIDEO_RESOLUTION 287
255 #define VIDEOPLAYER_AUDIO_CODEC 288
256 #define VIDEOPLAYER_AUDIO_CHANNELS 289
257 #define VIDEOPLAYER_VIDEO_ASPECT 290
258 #define VIDEOPLAYER_HASTELETEXT 291
259 #define VIDEOPLAYER_COUNTRY 292
260 #define VIDEOPLAYER_PLAYCOUNT 293
261 #define VIDEOPLAYER_LASTPLAYED 294
263 #define AUDIOSCROBBLER_ENABLED 300
264 #define AUDIOSCROBBLER_CONN_STATE 301
265 #define AUDIOSCROBBLER_SUBMIT_INT 302
266 #define AUDIOSCROBBLER_FILES_CACHED 303
267 #define AUDIOSCROBBLER_SUBMIT_STATE 304
268 #define LASTFM_RADIOPLAYING 305
269 #define LASTFM_CANLOVE 306
270 #define LASTFM_CANBAN 307
272 #define CONTAINER_SCROLL_PREVIOUS 345 // NOTE: These 5 must be kept in this consecutive order
273 #define CONTAINER_MOVE_PREVIOUS 346
274 #define CONTAINER_STATIC 347
275 #define CONTAINER_MOVE_NEXT 348
276 #define CONTAINER_SCROLL_NEXT 349
278 #define CONTAINER_HASFILES 351
279 #define CONTAINER_HASFOLDERS 352
280 #define CONTAINER_STACKED 353
281 #define CONTAINER_FOLDERNAME 354
282 #define CONTAINER_SCROLLING 355
283 #define CONTAINER_PLUGINNAME 356
284 #define CONTAINER_PROPERTY 357
285 #define CONTAINER_SORT_DIRECTION 358
286 #define CONTAINER_NUM_ITEMS 359
287 #define CONTAINER_FOLDERTHUMB 360
288 #define CONTAINER_FOLDERPATH 361
289 #define CONTAINER_CONTENT 362
290 #define CONTAINER_HAS_THUMB 363
291 #define CONTAINER_SORT_METHOD 364
293 #define CONTAINER_HAS_FOCUS 367
294 #define CONTAINER_ROW 368
295 #define CONTAINER_COLUMN 369
296 #define CONTAINER_POSITION 370
297 #define CONTAINER_VIEWMODE 371
298 #define CONTAINER_HAS_NEXT 372
299 #define CONTAINER_HAS_PREVIOUS 373
300 #define CONTAINER_SUBITEM 374
301 #define CONTAINER_TVSHOWTHUMB 375
302 #define CONTAINER_NUM_PAGES 376
303 #define CONTAINER_CURRENT_PAGE 377
304 #define CONTAINER_SEASONTHUMB 378
305 #define CONTAINER_SHOWPLOT 379
306 #define CONTAINER_TOTALTIME 380
308 #define MUSICPM_ENABLED 381
309 #define MUSICPM_SONGSPLAYED 382
310 #define MUSICPM_MATCHINGSONGS 383
311 #define MUSICPM_MATCHINGSONGSPICKED 384
312 #define MUSICPM_MATCHINGSONGSLEFT 385
313 #define MUSICPM_RELAXEDSONGSPICKED 386
314 #define MUSICPM_RANDOMSONGSPICKED 387
316 #define PLAYLIST_LENGTH 390
317 #define PLAYLIST_POSITION 391
318 #define PLAYLIST_RANDOM 392
319 #define PLAYLIST_REPEAT 393
320 #define PLAYLIST_ISRANDOM 394
321 #define PLAYLIST_ISREPEAT 395
322 #define PLAYLIST_ISREPEATONE 396
324 #define VISUALISATION_LOCKED 400
325 #define VISUALISATION_PRESET 401
326 #define VISUALISATION_NAME 402
327 #define VISUALISATION_ENABLED 403
329 #define STRING_IS_EMPTY 410
330 #define STRING_COMPARE 411
331 #define STRING_STR 412
332 #define INTEGER_GREATER_THAN 413
333 #define STRING_STR_LEFT 414
334 #define STRING_STR_RIGHT 415
336 #define SKIN_BOOL 600
337 #define SKIN_STRING 601
338 #define SKIN_HAS_MUSIC_OVERLAY 602
339 #define SKIN_HAS_VIDEO_OVERLAY 603
340 #define SKIN_THEME 604
341 #define SKIN_COLOUR_THEME 605
342 #define SKIN_HAS_THEME 606
344 #define SYSTEM_TOTAL_MEMORY 644
345 #define SYSTEM_CPU_USAGE 645
346 #define SYSTEM_USED_MEMORY_PERCENT 646
347 #define SYSTEM_USED_MEMORY 647
348 #define SYSTEM_FREE_MEMORY 648
349 #define SYSTEM_FREE_MEMORY_PERCENT 649
350 #define SYSTEM_UPTIME 654
351 #define SYSTEM_TOTALUPTIME 655
352 #define SYSTEM_CPUFREQUENCY 656
353 #define SYSTEM_SCREEN_RESOLUTION 659
354 #define SYSTEM_VIDEO_ENCODER_INFO 660
355 #define SYSTEM_KERNEL_VERSION 667
356 #define SYSTEM_FREE_SPACE 679
357 #define SYSTEM_USED_SPACE 680
358 #define SYSTEM_TOTAL_SPACE 681
359 #define SYSTEM_USED_SPACE_PERCENT 682
360 #define SYSTEM_FREE_SPACE_PERCENT 683
361 #define SYSTEM_DVD_TRAY_STATE 700
362 #define SYSTEM_GET_BOOL 704
363 #define SYSTEM_GET_CORE_USAGE 705
364 #define SYSTEM_HAS_CORE_ID 706
365 #define SYSTEM_RENDER_VENDOR 707
366 #define SYSTEM_RENDER_RENDERER 708
367 #define SYSTEM_RENDER_VERSION 709
368 #define SYSTEM_SETTING 710
369 #define SYSTEM_HAS_ADDON 711
370 #define SYSTEM_ADDON_TITLE 712
371 #define SYSTEM_ADDON_ICON 713
372 #define SYSTEM_BATTERY_LEVEL 714
373 #define SYSTEM_IDLE_TIME 715
374 #define SYSTEM_FRIENDLY_NAME 716
375 #define SYSTEM_SCREENSAVER_ACTIVE 717
377 #define LIBRARY_HAS_MUSIC 720
378 #define LIBRARY_HAS_VIDEO 721
379 #define LIBRARY_HAS_MOVIES 722
380 #define LIBRARY_HAS_MOVIE_SETS 723
381 #define LIBRARY_HAS_TVSHOWS 724
382 #define LIBRARY_HAS_MUSICVIDEOS 725
383 #define LIBRARY_IS_SCANNING 726
384 #define LIBRARY_IS_SCANNING_VIDEO 727
385 #define LIBRARY_IS_SCANNING_MUSIC 728
387 #define SYSTEM_PLATFORM_XBOX 740
388 #define SYSTEM_PLATFORM_LINUX 741
389 #define SYSTEM_PLATFORM_WINDOWS 742
390 #define SYSTEM_PLATFORM_DARWIN 743
391 #define SYSTEM_PLATFORM_DARWIN_OSX 744
392 #define SYSTEM_PLATFORM_DARWIN_IOS 745
393 #define SYSTEM_PLATFORM_DARWIN_ATV2 746
395 #define SYSTEM_CAN_POWERDOWN 750
396 #define SYSTEM_CAN_SUSPEND 751
397 #define SYSTEM_CAN_HIBERNATE 752
398 #define SYSTEM_CAN_REBOOT 753
400 #define SLIDESHOW_ISPAUSED 800
401 #define SLIDESHOW_ISRANDOM 801
402 #define SLIDESHOW_ISACTIVE 802
404 #define SLIDE_INFO_START 900
405 #define SLIDE_INFO_END 980
407 #define FANART_COLOR1 1000
408 #define FANART_COLOR2 1001
409 #define FANART_COLOR3 1002
410 #define FANART_IMAGE 1003
412 #define WINDOW_PROPERTY 9993
413 #define WINDOW_IS_TOPMOST 9994
414 #define WINDOW_IS_VISIBLE 9995
415 #define WINDOW_NEXT 9996
416 #define WINDOW_PREVIOUS 9997
417 #define WINDOW_IS_MEDIA 9998
418 #define WINDOW_IS_ACTIVE 9999
420 #define CONTROL_GET_LABEL 29996
421 #define CONTROL_IS_ENABLED 29997
422 #define CONTROL_IS_VISIBLE 29998
423 #define CONTROL_GROUP_HAS_FOCUS 29999
424 #define CONTROL_HAS_FOCUS 30000
426 #define VERSION_MAJOR 12
427 #define VERSION_MINOR 0
428 #define VERSION_TAG "-ALPHA4"
430 #define LISTITEM_START 35000
431 #define LISTITEM_THUMB (LISTITEM_START)
432 #define LISTITEM_LABEL (LISTITEM_START + 1)
433 #define LISTITEM_TITLE (LISTITEM_START + 2)
434 #define LISTITEM_TRACKNUMBER (LISTITEM_START + 3)
435 #define LISTITEM_ARTIST (LISTITEM_START + 4)
436 #define LISTITEM_ALBUM (LISTITEM_START + 5)
437 #define LISTITEM_YEAR (LISTITEM_START + 6)
438 #define LISTITEM_GENRE (LISTITEM_START + 7)
439 #define LISTITEM_ICON (LISTITEM_START + 8)
440 #define LISTITEM_DIRECTOR (LISTITEM_START + 9)
441 #define LISTITEM_OVERLAY (LISTITEM_START + 10)
442 #define LISTITEM_LABEL2 (LISTITEM_START + 11)
443 #define LISTITEM_FILENAME (LISTITEM_START + 12)
444 #define LISTITEM_DATE (LISTITEM_START + 13)
445 #define LISTITEM_SIZE (LISTITEM_START + 14)
446 #define LISTITEM_RATING (LISTITEM_START + 15)
447 #define LISTITEM_PROGRAM_COUNT (LISTITEM_START + 16)
448 #define LISTITEM_DURATION (LISTITEM_START + 17)
449 #define LISTITEM_ISPLAYING (LISTITEM_START + 18)
450 #define LISTITEM_ISSELECTED (LISTITEM_START + 19)
451 #define LISTITEM_PLOT (LISTITEM_START + 20)
452 #define LISTITEM_PLOT_OUTLINE (LISTITEM_START + 21)
453 #define LISTITEM_EPISODE (LISTITEM_START + 22)
454 #define LISTITEM_SEASON (LISTITEM_START + 23)
455 #define LISTITEM_TVSHOW (LISTITEM_START + 24)
456 #define LISTITEM_PREMIERED (LISTITEM_START + 25)
457 #define LISTITEM_COMMENT (LISTITEM_START + 26)
458 #define LISTITEM_ACTUAL_ICON (LISTITEM_START + 27)
459 #define LISTITEM_PATH (LISTITEM_START + 28)
460 #define LISTITEM_PICTURE_PATH (LISTITEM_START + 29)
461 // the ordering of LISTITEM_PICTURE_* is important as they're mapped to SLIDE_* items in GUIInfoManager.cpp
462 #define LISTITEM_PICTURE_START (LISTITEM_START + 30)
463 #define LISTITEM_PICTURE_RESOLUTION (LISTITEM_PICTURE_START) // => SLIDE_RESOLUTION
464 #define LISTITEM_PICTURE_DATETIME (LISTITEM_START + 31) // => SLIDE_EXIF_DATE_TIME
465 #define LISTITEM_PICTURE_COMMENT (LISTITEM_START + 32) // => SLIDE_COMMENT
466 #define LISTITEM_PICTURE_CAPTION (LISTITEM_START + 33) // => SLIDE_IPTC_CAPTION
467 #define LISTITEM_PICTURE_DESC (LISTITEM_START + 34) // => SLIDE_EXIF_DESCRIPTION
468 #define LISTITEM_PICTURE_KEYWORDS (LISTITEM_START + 35) // => SLIDE_IPTC_KEYWORDS
469 #define LISTITEM_PICTURE_CAM_MAKE (LISTITEM_START + 36) // => SLIDE_EXIF_CAMERA_MAKE
470 #define LISTITEM_PICTURE_CAM_MODEL (LISTITEM_START + 37) // => SLIDE_EXIF_CAMERA_MODEL
471 #define LISTITEM_PICTURE_APERTURE (LISTITEM_START + 38) // => SLIDE_EXIF_APERTURE
472 #define LISTITEM_PICTURE_FOCAL_LEN (LISTITEM_START + 39) // => SLIDE_EXIF_FOCAL_LENGTH
473 #define LISTITEM_PICTURE_FOCUS_DIST (LISTITEM_START + 40) // => SLIDE_EXIF_FOCUS_DIST
474 #define LISTITEM_PICTURE_EXP_MODE (LISTITEM_START + 41) // => SLIDE_EXIF_EXPOSURE_MODE
475 #define LISTITEM_PICTURE_EXP_TIME (LISTITEM_START + 42) // => SLIDE_EXIF_EXPOSURE_TIME
476 #define LISTITEM_PICTURE_ISO (LISTITEM_START + 43) // => SLIDE_EXIF_ISO_EQUIV
477 #define LISTITEM_PICTURE_GPS_LAT (LISTITEM_START + 44) // => SLIDE_EXIF_GPS_LATITUDE
478 #define LISTITEM_PICTURE_GPS_LON (LISTITEM_START + 45) // => SLIDE_EXIF_GPS_LONGITUDE
479 #define LISTITEM_PICTURE_GPS_ALT (LISTITEM_START + 46) // => SLIDE_EXIF_GPS_ALTITUDE
480 #define LISTITEM_PICTURE_END (LISTITEM_PICTURE_GPS_ALT)
481 #define LISTITEM_STUDIO (LISTITEM_START + 47)
482 #define LISTITEM_MPAA (LISTITEM_START + 48)
483 #define LISTITEM_CAST (LISTITEM_START + 49)
484 #define LISTITEM_CAST_AND_ROLE (LISTITEM_START + 50)
485 #define LISTITEM_WRITER (LISTITEM_START + 51)
486 #define LISTITEM_TAGLINE (LISTITEM_START + 52)
487 #define LISTITEM_TOP250 (LISTITEM_START + 53)
488 #define LISTITEM_RATING_AND_VOTES (LISTITEM_START + 54)
489 #define LISTITEM_TRAILER (LISTITEM_START + 55)
490 #define LISTITEM_STAR_RATING (LISTITEM_START + 56)
491 #define LISTITEM_FILENAME_AND_PATH (LISTITEM_START + 57)
492 #define LISTITEM_SORT_LETTER (LISTITEM_START + 58)
493 #define LISTITEM_ALBUM_ARTIST (LISTITEM_START + 59)
494 #define LISTITEM_FOLDERNAME (LISTITEM_START + 60)
495 #define LISTITEM_VIDEO_CODEC (LISTITEM_START + 61)
496 #define LISTITEM_VIDEO_RESOLUTION (LISTITEM_START + 62)
497 #define LISTITEM_VIDEO_ASPECT (LISTITEM_START + 63)
498 #define LISTITEM_AUDIO_CODEC (LISTITEM_START + 64)
499 #define LISTITEM_AUDIO_CHANNELS (LISTITEM_START + 65)
500 #define LISTITEM_AUDIO_LANGUAGE (LISTITEM_START + 66)
501 #define LISTITEM_SUBTITLE_LANGUAGE (LISTITEM_START + 67)
502 #define LISTITEM_IS_FOLDER (LISTITEM_START + 68)
503 #define LISTITEM_ORIGINALTITLE (LISTITEM_START + 69)
504 #define LISTITEM_COUNTRY (LISTITEM_START + 70)
505 #define LISTITEM_PLAYCOUNT (LISTITEM_START + 71)
506 #define LISTITEM_LASTPLAYED (LISTITEM_START + 72)
507 #define LISTITEM_FOLDERPATH (LISTITEM_START + 73)
508 #define LISTITEM_DISC_NUMBER (LISTITEM_START + 74)
509 #define LISTITEM_FILE_EXTENSION (LISTITEM_START + 75)
510 #define LISTITEM_IS_RESUMABLE (LISTITEM_START + 76)
511 #define LISTITEM_PERCENT_PLAYED (LISTITEM_START + 77)
512 #define LISTITEM_DATE_ADDED (LISTITEM_START + 78)
513 #define LISTITEM_DBTYPE (LISTITEM_START + 79)
514 #define LISTITEM_DBID (LISTITEM_START + 80)
516 #define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
517 #define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)
518 #define LISTITEM_END (LISTITEM_PROPERTY_END)
520 #define MUSICPLAYER_PROPERTY_OFFSET 900 // last 100 id's reserved for musicplayer props.
522 #define CONDITIONAL_LABEL_START LISTITEM_END + 1 // 36001
523 #define CONDITIONAL_LABEL_END 37000
525 // the multiple information vector
526 #define MULTI_INFO_START 40000
527 #define MULTI_INFO_END 99999
528 #define COMBINED_VALUES_START 100000
535 // Stored in the top 8 bits of GUIInfo::m_data1
536 // therefore we only have room for 8 flags
537 #define INFOFLAG_LISTITEM_WRAP ((uint32_t) (1 << 25)) // Wrap ListItem lookups
538 #define INFOFLAG_LISTITEM_POSITION ((uint32_t) (1 << 26)) // Absolute ListItem lookups
540 // structure to hold multiple integer data
541 // for storage referenced from a single integer
545 GUIInfo(int info, uint32_t data1 = 0, int data2 = 0, uint32_t flag = 0)
553 bool operator ==(const GUIInfo &right) const
555 return (m_info == right.m_info && m_data1 == right.m_data1 && m_data2 == right.m_data2);
557 uint32_t GetInfoFlag() const;
558 uint32_t GetData1() const;
559 int GetData2() const;
562 void SetInfoFlag(uint32_t flag);
571 class CGUIInfoManager : public IMsgTargetCallback
574 CGUIInfoManager(void);
575 virtual ~CGUIInfoManager(void);
578 virtual bool OnMessage(CGUIMessage &message);
580 /*! \brief Register a boolean condition/expression
581 This routine allows controls or other clients of the info manager to register
582 to receive updates of particular expressions, in a particular context (currently windows).
584 In the future, it will allow clients to receive pushed callbacks when the expression changes.
586 \param expression the boolean condition or expression
587 \param context the context window
588 \return an identifier used to reference this expression
592 unsigned int Register(const CStdString &expression, int context = 0);
594 /*! \brief Get a previously registered boolean expression's value
595 Checks the cache and evaluates the boolean expression if required.
598 bool GetBoolValue(unsigned int expression, const CGUIListItem *item = NULL);
600 /*! \brief Evaluate a boolean expression
601 \param expression the expression to evaluate
602 \param context the context in which to evaluate the expression (currently windows)
603 \return the value of the evaluated expression.
604 \sa Register, GetBoolValue
606 bool EvaluateBool(const CStdString &expression, int context = 0);
608 int TranslateString(const CStdString &strCondition);
610 /*! \brief Get integer value of info.
611 \param value int reference to pass value of given info
612 \param info id of info
613 \param context the context in which to evaluate the expression (currently windows)
614 \param item optional listitem if want to get listitem related int
615 \return true if given info was handled
616 \sa GetItemInt, GetMultiInfoInt
618 bool GetInt(int &value, int info, int contextWindow = 0, const CGUIListItem *item = NULL) const;
619 CStdString GetLabel(int info, int contextWindow = 0, CStdString *fallback = NULL);
621 CStdString GetImage(int info, int contextWindow, CStdString *fallback = NULL);
623 CStdString GetTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
624 CStdString GetLcdTime( int _eInfo ) const;
625 CStdString GetDate(bool bNumbersOnly = false);
626 CStdString GetDuration(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
628 void SetCurrentItem(CFileItem &item);
629 void ResetCurrentItem();
630 // Current song stuff
631 /// \brief Retrieves tag info (if necessary) and fills in our current song path.
632 void SetCurrentSong(CFileItem &item);
633 void SetCurrentAlbumThumb(const CStdString thumbFileName);
634 void SetCurrentMovie(CFileItem &item);
635 void SetCurrentSlide(CFileItem &item);
636 const CFileItem &GetCurrentSlide() const;
637 void ResetCurrentSlide();
638 void SetCurrentSongTag(const MUSIC_INFO::CMusicInfoTag &tag);
639 void SetCurrentVideoTag(const CVideoInfoTag &tag);
641 const MUSIC_INFO::CMusicInfoTag *GetCurrentSongTag() const;
642 const CVideoInfoTag* GetCurrentMovieTag() const;
644 CStdString GetMusicLabel(int item);
645 CStdString GetMusicTagLabel(int info, const CFileItem *item);
646 CStdString GetVideoLabel(int item);
647 CStdString GetPlaylistLabel(int item) const;
648 CStdString GetMusicPartyModeLabel(int item);
649 const CStdString GetMusicPlaylistInfo(const GUIInfo& info);
650 CStdString GetPictureLabel(int item);
652 int64_t GetPlayTime() const; // in ms
653 CStdString GetCurrentPlayTime(TIME_FORMAT format = TIME_FORMAT_GUESS) const;
654 int GetPlayTimeRemaining() const;
655 int GetTotalPlayTime() const;
656 CStdString GetCurrentPlayTimeRemaining(TIME_FORMAT format) const;
657 CStdString GetVersion();
658 CStdString GetBuild();
660 bool GetDisplayAfterSeek();
661 void SetDisplayAfterSeek(unsigned int timeOut = 2500, int seekOffset = 0);
662 void SetSeeking(bool seeking) { m_playerSeeking = seeking; };
663 void SetShowTime(bool showtime) { m_playerShowTime = showtime; };
664 void SetShowCodec(bool showcodec) { m_playerShowCodec = showcodec; };
665 void SetShowInfo(bool showinfo) { m_playerShowInfo = showinfo; };
666 void ToggleShowCodec() { m_playerShowCodec = !m_playerShowCodec; };
667 bool ToggleShowInfo() { m_playerShowInfo = !m_playerShowInfo; return m_playerShowInfo; };
668 bool m_performingSeek;
670 std::string GetSystemHeatInfo(int info);
671 CTemperature GetGPUTemperature();
674 inline float GetFPS() const { return m_fps; };
676 void SetNextWindow(int windowID) { m_nextWindowID = windowID; };
677 void SetPreviousWindow(int windowID) { m_prevWindowID = windowID; };
680 bool GetItemInt(int &value, const CGUIListItem *item, int info) const;
681 CStdString GetItemLabel(const CFileItem *item, int info, CStdString *fallback = NULL);
682 CStdString GetItemImage(const CFileItem *item, int info, CStdString *fallback = NULL);
684 // Called from tuxbox service thread to update current status
685 void UpdateFromTuxBox();
687 /*! \brief containers call here to specify that the focus is changing
689 \param next true if we're moving to the next item, false if previous
690 \param scrolling true if the container is scrolling, false if the movement requires no scroll
692 void SetContainerMoving(int id, bool next, bool scrolling)
694 // magnitude 2 indicates a scroll, sign indicates direction
695 m_containerMoves[id] = (next ? 1 : -1) * (scrolling ? 2 : 1);
698 void SetLibraryBool(int condition, bool value);
699 bool GetLibraryBool(int condition);
700 void ResetLibraryBools();
701 CStdString LocalizeTime(const CDateTime &time, TIME_FORMAT format) const;
703 int TranslateSingleString(const CStdString &strCondition);
705 int RegisterSkinVariableString(const INFO::CSkinVariableString* info);
706 int TranslateSkinVariableString(const CStdString& name, int context);
707 CStdString GetSkinVariableString(int info, bool preferImage = false, const CGUIListItem *item=NULL);
709 friend class INFO::InfoSingle;
710 bool GetBool(int condition, int contextWindow = 0, const CGUIListItem *item=NULL);
712 // routines for window retrieval
713 bool CheckWindowCondition(CGUIWindow *window, int condition) const;
714 CGUIWindow *GetWindowWithCondition(int contextWindow, int condition) const;
716 /*! \brief class for holding information on properties
721 Property(const CStdString &property, const CStdString ¶meters);
723 const CStdString ¶m(unsigned int n = 0) const;
724 unsigned int num_params() const;
728 std::vector<CStdString> params;
731 bool GetMultiInfoBool(const GUIInfo &info, int contextWindow = 0, const CGUIListItem *item = NULL);
732 bool GetMultiInfoInt(int &value, const GUIInfo &info, int contextWindow = 0) const;
733 CStdString GetMultiInfoLabel(const GUIInfo &info, int contextWindow = 0, CStdString *fallback = NULL);
734 int TranslateListItem(const Property &info);
735 int TranslateMusicPlayerString(const CStdString &info) const;
736 TIME_FORMAT TranslateTimeFormat(const CStdString &format);
737 bool GetItemBool(const CGUIListItem *item, int condition) const;
739 /*! \brief Split an info string into it's constituent parts and parameters
742 info1(params1).info2(params2).info3(params3) ...
744 where the parameters are an optional comma separated parameter list.
746 \param infoString the original string
747 \param info the resulting pairs of info and parameters.
749 void SplitInfoString(const CStdString &infoString, std::vector<Property> &info);
751 // Conditional string parameters for testing are stored in a vector for later retrieval.
752 // The offset into the string parameters array is returned.
753 int ConditionalStringParameter(const CStdString &strParameter, bool caseSensitive = false);
754 int AddMultiInfo(const GUIInfo &info);
755 int AddListItemProp(const CStdString &str, int offset=0);
757 CStdString GetAudioScrobblerLabel(int item);
759 // Conditional string parameters are stored here
760 CStdStringArray m_stringParameters;
762 // Array of multiple information mapped to a single integer lookup
763 std::vector<GUIInfo> m_multiInfo;
764 std::vector<std::string> m_listitemProperties;
766 CStdString m_currentMovieDuration;
768 // Current playing stuff
769 CFileItem* m_currentFile;
770 CStdString m_currentMovieThumb;
771 unsigned int m_lastMusicBitrateTime;
772 unsigned int m_MusicBitrate;
773 CFileItem* m_currentSlide;
776 unsigned int m_lastSysHeatInfoTime;
778 CTemperature m_gpuTemp;
779 CTemperature m_cpuTemp;
781 //Fullscreen OSD Stuff
782 unsigned int m_AfterSeekTimeout;
784 bool m_playerSeeking;
785 bool m_playerShowTime;
786 bool m_playerShowCodec;
787 bool m_playerShowInfo;
791 unsigned int m_frameCounter;
792 unsigned int m_lastFPSTime;
794 std::map<int, int> m_containerMoves; // direction of list moving
798 std::vector<INFO::InfoBool*> m_bools;
799 std::vector<INFO::CSkinVariableString> m_skinVariableStrings;
800 unsigned int m_updateTime;
802 int m_libraryHasMusic;
803 int m_libraryHasMovies;
804 int m_libraryHasTVShows;
805 int m_libraryHasMusicVideos;
806 int m_libraryHasMovieSets;
808 CCriticalSection m_critInfo;
815 extern CGUIInfoManager g_infoManager;