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 "CriticalSection.h"
32 #include "IMsgTargetCallback.h"
48 // conditions for window retrieval
49 #define WINDOW_CONDITION_HAS_LIST_ITEMS 1
50 #define WINDOW_CONDITION_IS_MEDIA_WINDOW 2
52 #define OPERATOR_NOT 3
53 #define OPERATOR_AND 2
56 #define PLAYER_HAS_MEDIA 1
57 #define PLAYER_HAS_AUDIO 2
58 #define PLAYER_HAS_VIDEO 3
59 #define PLAYER_PLAYING 4
60 #define PLAYER_PAUSED 5
61 #define PLAYER_REWINDING 6
62 #define PLAYER_REWINDING_2x 7
63 #define PLAYER_REWINDING_4x 8
64 #define PLAYER_REWINDING_8x 9
65 #define PLAYER_REWINDING_16x 10
66 #define PLAYER_REWINDING_32x 11
67 #define PLAYER_FORWARDING 12
68 #define PLAYER_FORWARDING_2x 13
69 #define PLAYER_FORWARDING_4x 14
70 #define PLAYER_FORWARDING_8x 15
71 #define PLAYER_FORWARDING_16x 16
72 #define PLAYER_FORWARDING_32x 17
73 #define PLAYER_CAN_RECORD 18
74 #define PLAYER_RECORDING 19
75 #define PLAYER_CACHING 20
76 #define PLAYER_DISPLAY_AFTER_SEEK 21
77 #define PLAYER_PROGRESS 22
78 #define PLAYER_SEEKBAR 23
79 #define PLAYER_SEEKTIME 24
80 #define PLAYER_SEEKING 25
81 #define PLAYER_SHOWTIME 26
82 #define PLAYER_TIME 27
83 #define PLAYER_TIME_REMAINING 28
84 #define PLAYER_DURATION 29
85 #define PLAYER_SHOWCODEC 30
86 #define PLAYER_SHOWINFO 31
87 #define PLAYER_VOLUME 32
88 #define PLAYER_MUTED 33
89 #define PLAYER_HASDURATION 34
90 #define PLAYER_CHAPTER 35
91 #define PLAYER_CHAPTERCOUNT 36
92 #define PLAYER_TIME_SPEED 37
93 #define PLAYER_FINISH_TIME 38
94 #define PLAYER_CACHELEVEL 39
95 #define PLAYER_STAR_RATING 40
96 #define PLAYER_CHAPTERNAME 41
97 #define PLAYER_SUBTITLE_DELAY 42
98 #define PLAYER_AUDIO_DELAY 43
99 #define PLAYER_PASSTHROUGH 44
100 #define PLAYER_PATH 45
101 #define PLAYER_FILEPATH 46
102 #define PLAYER_SEEKOFFSET 47
104 #define WEATHER_CONDITIONS 100
105 #define WEATHER_TEMPERATURE 101
106 #define WEATHER_LOCATION 102
107 #define WEATHER_IS_FETCHED 103
108 #define WEATHER_FANART_CODE 104
109 #define WEATHER_PLUGIN 105
111 #define SYSTEM_TEMPERATURE_UNITS 106
112 #define SYSTEM_PROGRESS_BAR 107
113 #define SYSTEM_LANGUAGE 108
114 #define SYSTEM_TIME 110
115 #define SYSTEM_DATE 111
116 #define SYSTEM_CPU_TEMPERATURE 112
117 #define SYSTEM_GPU_TEMPERATURE 113
118 #define SYSTEM_FAN_SPEED 114
119 #define SYSTEM_FREE_SPACE_C 115
120 // #define SYSTEM_FREE_SPACE_D 116 //116 is reserved for space on D
121 #define SYSTEM_FREE_SPACE_E 117
122 #define SYSTEM_FREE_SPACE_F 118
123 #define SYSTEM_FREE_SPACE_G 119
124 #define SYSTEM_BUILD_VERSION 120
125 #define SYSTEM_BUILD_DATE 121
126 #define SYSTEM_ETHERNET_LINK_ACTIVE 122
127 #define SYSTEM_FPS 123
128 #define SYSTEM_ALWAYS_TRUE 125 // useful for <visible fade="10" start="hidden">true</visible>, to fade in a control
129 #define SYSTEM_ALWAYS_FALSE 126 // used for <visible fade="10">false</visible>, to fade out a control (ie not particularly useful!)
130 #define SYSTEM_MEDIA_DVD 127
131 #define SYSTEM_DVDREADY 128
132 #define SYSTEM_HAS_ALARM 129
133 #define SYSTEM_SCREEN_MODE 132
134 #define SYSTEM_SCREEN_WIDTH 133
135 #define SYSTEM_SCREEN_HEIGHT 134
136 #define SYSTEM_CURRENT_WINDOW 135
137 #define SYSTEM_CURRENT_CONTROL 136
138 #define SYSTEM_DVD_LABEL 138
139 #define SYSTEM_HAS_DRIVE_F 139
140 #define SYSTEM_HASLOCKS 140
141 #define SYSTEM_ISMASTER 141
142 #define SYSTEM_TRAYOPEN 142
143 #define SYSTEM_ALARM_POS 144
144 #define SYSTEM_LOGGEDON 145
145 #define SYSTEM_PROFILENAME 146
146 #define SYSTEM_PROFILETHUMB 147
147 #define SYSTEM_HAS_LOGINSCREEN 148
148 #define SYSTEM_HAS_DRIVE_G 149
149 #define SYSTEM_HDD_SMART 150
150 #define SYSTEM_HDD_TEMPERATURE 151
151 #define SYSTEM_HDD_MODEL 152
152 #define SYSTEM_HDD_SERIAL 153
153 #define SYSTEM_HDD_FIRMWARE 154
154 #define SYSTEM_HDD_PASSWORD 156
155 #define SYSTEM_HDD_LOCKSTATE 157
156 #define SYSTEM_HDD_LOCKKEY 158
157 #define SYSTEM_INTERNET_STATE 159
158 #define LCD_PLAY_ICON 160
159 #define LCD_PROGRESS_BAR 161
160 #define LCD_CPU_TEMPERATURE 162
161 #define LCD_GPU_TEMPERATURE 163
162 #define LCD_HDD_TEMPERATURE 164
163 #define LCD_FAN_SPEED 165
165 #define LCD_FREE_SPACE_C 167
166 // #define LCD_FREE_SPACE_D 168 // 168 is reserved for space on D
167 #define LCD_FREE_SPACE_E 169
168 #define LCD_FREE_SPACE_F 170
169 #define LCD_FREE_SPACE_G 171
170 #define LCD_TIME_21 172 // Small bigfont
171 #define LCD_TIME_22 173
172 #define LCD_TIME_W21 174 // Medum bigfont
173 #define LCD_TIME_W22 175
174 #define LCD_TIME_41 176 // Big bigfont
175 #define LCD_TIME_42 177
176 #define LCD_TIME_43 178
177 #define LCD_TIME_44 179
178 #define SYSTEM_ALARM_LESS_OR_EQUAL 180
180 #define NETWORK_IP_ADDRESS 190
181 #define NETWORK_MAC_ADDRESS 191
182 #define NETWORK_IS_DHCP 192
183 #define NETWORK_LINK_STATE 193
184 #define NETWORK_SUBNET_ADDRESS 194
185 #define NETWORK_GATEWAY_ADDRESS 195
186 #define NETWORK_DNS1_ADDRESS 196
187 #define NETWORK_DNS2_ADDRESS 197
188 #define NETWORK_DHCP_ADDRESS 198
190 #define MUSICPLAYER_TITLE 200
191 #define MUSICPLAYER_ALBUM 201
192 #define MUSICPLAYER_ARTIST 202
193 #define MUSICPLAYER_GENRE 203
194 #define MUSICPLAYER_YEAR 204
195 #define MUSICPLAYER_DURATION 205
196 #define MUSICPLAYER_TRACK_NUMBER 208
197 #define MUSICPLAYER_COVER 210
198 #define MUSICPLAYER_BITRATE 211
199 #define MUSICPLAYER_PLAYLISTLEN 212
200 #define MUSICPLAYER_PLAYLISTPOS 213
201 #define MUSICPLAYER_CHANNELS 214
202 #define MUSICPLAYER_BITSPERSAMPLE 215
203 #define MUSICPLAYER_SAMPLERATE 216
204 #define MUSICPLAYER_CODEC 217
205 #define MUSICPLAYER_DISC_NUMBER 218
206 #define MUSICPLAYER_RATING 219
207 #define MUSICPLAYER_COMMENT 220
208 #define MUSICPLAYER_LYRICS 221
209 #define MUSICPLAYER_HASPREVIOUS 222
210 #define MUSICPLAYER_HASNEXT 223
211 #define MUSICPLAYER_EXISTS 224
212 #define MUSICPLAYER_PLAYLISTPLAYING 225
213 #define MUSICPLAYER_ALBUM_ARTIST 226
215 #define VIDEOPLAYER_TITLE 250
216 #define VIDEOPLAYER_GENRE 251
217 #define VIDEOPLAYER_DIRECTOR 252
218 #define VIDEOPLAYER_YEAR 253
219 #define VIDEOPLAYER_COVER 258
220 #define VIDEOPLAYER_USING_OVERLAYS 259
221 #define VIDEOPLAYER_ISFULLSCREEN 260
222 #define VIDEOPLAYER_HASMENU 261
223 #define VIDEOPLAYER_PLAYLISTLEN 262
224 #define VIDEOPLAYER_PLAYLISTPOS 263
225 #define VIDEOPLAYER_EVENT 264
226 #define VIDEOPLAYER_ORIGINALTITLE 265
227 #define VIDEOPLAYER_PLOT 266
228 #define VIDEOPLAYER_PLOT_OUTLINE 267
229 #define VIDEOPLAYER_EPISODE 268
230 #define VIDEOPLAYER_SEASON 269
231 #define VIDEOPLAYER_RATING 270
232 #define VIDEOPLAYER_TVSHOW 271
233 #define VIDEOPLAYER_PREMIERED 272
234 #define VIDEOPLAYER_CONTENT 273
235 #define VIDEOPLAYER_STUDIO 274
236 #define VIDEOPLAYER_MPAA 275
237 #define VIDEOPLAYER_CAST 276
238 #define VIDEOPLAYER_CAST_AND_ROLE 277
239 #define VIDEOPLAYER_ARTIST 278
240 #define VIDEOPLAYER_ALBUM 279
241 #define VIDEOPLAYER_WRITER 280
242 #define VIDEOPLAYER_TAGLINE 281
243 #define VIDEOPLAYER_HAS_INFO 282
244 #define VIDEOPLAYER_TOP250 283
245 #define VIDEOPLAYER_RATING_AND_VOTES 284
246 #define VIDEOPLAYER_TRAILER 285
247 #define VIDEOPLAYER_VIDEO_CODEC 286
248 #define VIDEOPLAYER_VIDEO_RESOLUTION 287
249 #define VIDEOPLAYER_AUDIO_CODEC 288
250 #define VIDEOPLAYER_AUDIO_CHANNELS 289
251 #define VIDEOPLAYER_VIDEO_ASPECT 290
252 #define VIDEOPLAYER_HASTELETEXT 291
253 #define VIDEOPLAYER_COUNTRY 292
255 #define AUDIOSCROBBLER_ENABLED 300
256 #define AUDIOSCROBBLER_CONN_STATE 301
257 #define AUDIOSCROBBLER_SUBMIT_INT 302
258 #define AUDIOSCROBBLER_FILES_CACHED 303
259 #define AUDIOSCROBBLER_SUBMIT_STATE 304
260 #define LASTFM_RADIOPLAYING 305
261 #define LASTFM_CANLOVE 306
262 #define LASTFM_CANBAN 307
264 #define CONTAINER_SCROLL_PREVIOUS 345 // NOTE: These 5 must be kept in this consecutive order
265 #define CONTAINER_MOVE_PREVIOUS 346
266 #define CONTAINER_STATIC 347
267 #define CONTAINER_MOVE_NEXT 348
268 #define CONTAINER_SCROLL_NEXT 349
270 #define CONTAINER_HASFILES 351
271 #define CONTAINER_HASFOLDERS 352
272 #define CONTAINER_STACKED 353
273 #define CONTAINER_FOLDERNAME 354
274 #define CONTAINER_SCROLLING 355
275 #define CONTAINER_PLUGINNAME 356
276 #define CONTAINER_PROPERTY 357
277 #define CONTAINER_SORT_DIRECTION 358
278 #define CONTAINER_NUM_ITEMS 359
279 #define CONTAINER_FOLDERTHUMB 360
280 #define CONTAINER_FOLDERPATH 361
281 #define CONTAINER_CONTENT 362
282 #define CONTAINER_HAS_THUMB 363
283 #define CONTAINER_SORT_METHOD 364
285 #define CONTAINER_HAS_FOCUS 367
286 #define CONTAINER_ROW 368
287 #define CONTAINER_COLUMN 369
288 #define CONTAINER_POSITION 370
289 #define CONTAINER_VIEWMODE 371
290 #define CONTAINER_HAS_NEXT 372
291 #define CONTAINER_HAS_PREVIOUS 373
292 #define CONTAINER_SUBITEM 374
293 #define CONTAINER_TVSHOWTHUMB 375
294 #define CONTAINER_NUM_PAGES 376
295 #define CONTAINER_CURRENT_PAGE 377
296 #define CONTAINER_SEASONTHUMB 378
297 #define CONTAINER_SHOWPLOT 379
298 #define CONTAINER_TOTALTIME 380
300 #define MUSICPM_ENABLED 381
301 #define MUSICPM_SONGSPLAYED 382
302 #define MUSICPM_MATCHINGSONGS 383
303 #define MUSICPM_MATCHINGSONGSPICKED 384
304 #define MUSICPM_MATCHINGSONGSLEFT 385
305 #define MUSICPM_RELAXEDSONGSPICKED 386
306 #define MUSICPM_RANDOMSONGSPICKED 387
308 #define PLAYLIST_LENGTH 390
309 #define PLAYLIST_POSITION 391
310 #define PLAYLIST_RANDOM 392
311 #define PLAYLIST_REPEAT 393
312 #define PLAYLIST_ISRANDOM 394
313 #define PLAYLIST_ISREPEAT 395
314 #define PLAYLIST_ISREPEATONE 396
316 #define VISUALISATION_LOCKED 400
317 #define VISUALISATION_PRESET 401
318 #define VISUALISATION_NAME 402
319 #define VISUALISATION_ENABLED 403
321 #define STRING_IS_EMPTY 410
322 #define STRING_COMPARE 411
323 #define STRING_STR 412
324 #define INTEGER_GREATER_THAN 413
326 #define SKIN_HAS_THEME_START 500
327 #define SKIN_HAS_THEME_END 599 // allow for max 100 themes
329 #define SKIN_BOOL 600
330 #define SKIN_STRING 601
331 #define SKIN_HAS_MUSIC_OVERLAY 602
332 #define SKIN_HAS_VIDEO_OVERLAY 603
334 #define SYSTEM_TOTAL_MEMORY 644
335 #define SYSTEM_CPU_USAGE 645
336 #define SYSTEM_USED_MEMORY_PERCENT 646
337 #define SYSTEM_USED_MEMORY 647
338 #define SYSTEM_FREE_MEMORY 648
339 #define SYSTEM_FREE_MEMORY_PERCENT 649
340 #define SYSTEM_UPTIME 654
341 #define SYSTEM_TOTALUPTIME 655
342 #define SYSTEM_CPUFREQUENCY 656
343 #define SYSTEM_SCREEN_RESOLUTION 659
344 #define SYSTEM_VIDEO_ENCODER_INFO 660
345 #define SYSTEM_KERNEL_VERSION 667
346 #define SYSTEM_USED_SPACE_X 673
347 #define SYSTEM_FREE_SPACE_X 674
348 #define SYSTEM_USED_SPACE_Y 675
349 #define SYSTEM_FREE_SPACE_Y 676
350 #define SYSTEM_USED_SPACE_Z 677
351 #define SYSTEM_FREE_SPACE_Z 678
352 #define SYSTEM_FREE_SPACE 679
353 #define SYSTEM_USED_SPACE 680
354 #define SYSTEM_TOTAL_SPACE 681
355 #define SYSTEM_USED_SPACE_PERCENT 682
356 #define SYSTEM_FREE_SPACE_PERCENT 683
357 #define SYSTEM_USED_SPACE_C 684
358 #define SYSTEM_TOTAL_SPACE_C 685
359 #define SYSTEM_USED_SPACE_PERCENT_C 686
360 #define SYSTEM_FREE_SPACE_PERCENT_C 687
361 #define SYSTEM_USED_SPACE_E 688
362 #define SYSTEM_TOTAL_SPACE_E 689
363 #define SYSTEM_USED_SPACE_PERCENT_E 690
364 #define SYSTEM_FREE_SPACE_PERCENT_E 691
365 #define SYSTEM_USED_SPACE_F 692
366 #define SYSTEM_TOTAL_SPACE_F 693
367 #define SYSTEM_USED_SPACE_PERCENT_F 694
368 #define SYSTEM_FREE_SPACE_PERCENT_F 695
369 #define SYSTEM_USED_SPACE_G 696
370 #define SYSTEM_TOTAL_SPACE_G 697
371 #define SYSTEM_USED_SPACE_PERCENT_G 698
372 #define SYSTEM_FREE_SPACE_PERCENT_G 699
373 #define SYSTEM_DVD_TRAY_STATE 700
374 #define SYSTEM_TOTAL_SPACE_X 701
375 #define SYSTEM_TOTAL_SPACE_Y 702
376 #define SYSTEM_TOTAL_SPACE_Z 703
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
386 #define LIBRARY_HAS_MUSIC 720
387 #define LIBRARY_HAS_VIDEO 721
388 #define LIBRARY_HAS_MOVIES 722
389 #define LIBRARY_HAS_TVSHOWS 723
390 #define LIBRARY_HAS_MUSICVIDEOS 724
391 #define LIBRARY_IS_SCANNING 725
393 #define SYSTEM_PLATFORM_XBOX 740
394 #define SYSTEM_PLATFORM_LINUX 741
395 #define SYSTEM_PLATFORM_WINDOWS 742
396 #define SYSTEM_PLATFORM_OSX 743
398 #define SYSTEM_CAN_POWERDOWN 750
399 #define SYSTEM_CAN_SUSPEND 751
400 #define SYSTEM_CAN_HIBERNATE 752
401 #define SYSTEM_CAN_REBOOT 753
403 #define SKIN_THEME 800
404 #define SKIN_COLOUR_THEME 801
406 #define SLIDE_INFO_START 900
407 #define SLIDE_INFO_END 980
409 #define FANART_COLOR1 1000
410 #define FANART_COLOR2 1001
411 #define FANART_COLOR3 1002
412 #define FANART_IMAGE 1003
414 #define WINDOW_PROPERTY 9993
415 #define WINDOW_IS_TOPMOST 9994
416 #define WINDOW_IS_VISIBLE 9995
417 #define WINDOW_NEXT 9996
418 #define WINDOW_PREVIOUS 9997
419 #define WINDOW_IS_MEDIA 9998
420 #define WINDOW_IS_ACTIVE 9999
422 #define SYSTEM_IDLE_TIME_START 20000
423 #define SYSTEM_IDLE_TIME_FINISH 21000 // 1000 seconds
425 #define CONTROL_GET_LABEL 29996
426 #define CONTROL_IS_ENABLED 29997
427 #define CONTROL_IS_VISIBLE 29998
428 #define CONTROL_GROUP_HAS_FOCUS 29999
429 #define CONTROL_HAS_FOCUS 30000
430 #define BUTTON_SCROLLER_HAS_ICON 30001
432 // Version string MUST NOT contain spaces. It is used
433 // in the HTTP request user agent.
434 #define VERSION_STRING "10.0-beta4"
436 #define LISTITEM_START 35000
437 #define LISTITEM_THUMB (LISTITEM_START)
438 #define LISTITEM_LABEL (LISTITEM_START + 1)
439 #define LISTITEM_TITLE (LISTITEM_START + 2)
440 #define LISTITEM_TRACKNUMBER (LISTITEM_START + 3)
441 #define LISTITEM_ARTIST (LISTITEM_START + 4)
442 #define LISTITEM_ALBUM (LISTITEM_START + 5)
443 #define LISTITEM_YEAR (LISTITEM_START + 6)
444 #define LISTITEM_GENRE (LISTITEM_START + 7)
445 #define LISTITEM_ICON (LISTITEM_START + 8)
446 #define LISTITEM_DIRECTOR (LISTITEM_START + 9)
447 #define LISTITEM_OVERLAY (LISTITEM_START + 10)
448 #define LISTITEM_LABEL2 (LISTITEM_START + 11)
449 #define LISTITEM_FILENAME (LISTITEM_START + 12)
450 #define LISTITEM_DATE (LISTITEM_START + 13)
451 #define LISTITEM_SIZE (LISTITEM_START + 14)
452 #define LISTITEM_RATING (LISTITEM_START + 15)
453 #define LISTITEM_PROGRAM_COUNT (LISTITEM_START + 16)
454 #define LISTITEM_DURATION (LISTITEM_START + 17)
455 #define LISTITEM_ISPLAYING (LISTITEM_START + 18)
456 #define LISTITEM_ISSELECTED (LISTITEM_START + 19)
457 #define LISTITEM_PLOT (LISTITEM_START + 20)
458 #define LISTITEM_PLOT_OUTLINE (LISTITEM_START + 21)
459 #define LISTITEM_EPISODE (LISTITEM_START + 22)
460 #define LISTITEM_SEASON (LISTITEM_START + 23)
461 #define LISTITEM_TVSHOW (LISTITEM_START + 24)
462 #define LISTITEM_PREMIERED (LISTITEM_START + 25)
463 #define LISTITEM_COMMENT (LISTITEM_START + 26)
464 #define LISTITEM_ACTUAL_ICON (LISTITEM_START + 27)
465 #define LISTITEM_PATH (LISTITEM_START + 28)
466 #define LISTITEM_PICTURE_PATH (LISTITEM_START + 29)
467 #define LISTITEM_PICTURE_DATETIME (LISTITEM_START + 30)
468 #define LISTITEM_PICTURE_RESOLUTION (LISTITEM_START + 31)
469 #define LISTITEM_STUDIO (LISTITEM_START + 32)
470 #define LISTITEM_MPAA (LISTITEM_START + 33)
471 #define LISTITEM_CAST (LISTITEM_START + 34)
472 #define LISTITEM_CAST_AND_ROLE (LISTITEM_START + 35)
473 #define LISTITEM_WRITER (LISTITEM_START + 36)
474 #define LISTITEM_TAGLINE (LISTITEM_START + 37)
475 #define LISTITEM_TOP250 (LISTITEM_START + 38)
476 #define LISTITEM_RATING_AND_VOTES (LISTITEM_START + 39)
477 #define LISTITEM_TRAILER (LISTITEM_START + 40)
478 #define LISTITEM_STAR_RATING (LISTITEM_START + 41)
479 #define LISTITEM_FILENAME_AND_PATH (LISTITEM_START + 42)
480 #define LISTITEM_SORT_LETTER (LISTITEM_START + 43)
481 #define LISTITEM_ALBUM_ARTIST (LISTITEM_START + 44)
482 #define LISTITEM_FOLDERNAME (LISTITEM_START + 45)
483 #define LISTITEM_VIDEO_CODEC (LISTITEM_START + 46)
484 #define LISTITEM_VIDEO_RESOLUTION (LISTITEM_START + 47)
485 #define LISTITEM_VIDEO_ASPECT (LISTITEM_START + 48)
486 #define LISTITEM_AUDIO_CODEC (LISTITEM_START + 49)
487 #define LISTITEM_AUDIO_CHANNELS (LISTITEM_START + 50)
488 #define LISTITEM_AUDIO_LANGUAGE (LISTITEM_START + 51)
489 #define LISTITEM_SUBTITLE_LANGUAGE (LISTITEM_START + 52)
490 #define LISTITEM_IS_FOLDER (LISTITEM_START + 53)
491 #define LISTITEM_ORIGINALTITLE (LISTITEM_START + 54)
492 #define LISTITEM_COUNTRY (LISTITEM_START + 55)
494 #define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
495 #define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)
496 #define LISTITEM_END (LISTITEM_PROPERTY_END)
498 #define MUSICPLAYER_PROPERTY_OFFSET 900 // last 100 id's reserved for musicplayer props.
500 // the multiple information vector
501 #define MULTI_INFO_START 40000
502 #define MULTI_INFO_END 99999
503 #define COMBINED_VALUES_START 100000
510 // Stored in the top 8 bits of GUIInfo::m_data1
511 // therefore we only have room for 8 flags
512 #define INFOFLAG_LISTITEM_WRAP ((uint32_t) (1 << 25)) // Wrap ListItem lookups
513 #define INFOFLAG_LISTITEM_POSITION ((uint32_t) (1 << 26)) // Absolute ListItem lookups
515 // structure to hold multiple integer data
516 // for storage referenced from a single integer
520 GUIInfo(int info
, uint32_t data1
= 0, int data2
= 0, uint32_t flag
= 0)
528 bool operator ==(const GUIInfo
&right
) const
530 return (m_info
== right
.m_info
&& m_data1
== right
.m_data1
&& m_data2
== right
.m_data2
);
532 uint32_t GetInfoFlag() const;
533 uint32_t GetData1() const;
534 int GetData2() const;
537 void SetInfoFlag(uint32_t flag
);
546 class CGUIInfoManager
: public IMsgTargetCallback
549 CGUIInfoManager(void);
550 virtual ~CGUIInfoManager(void);
553 virtual bool OnMessage(CGUIMessage
&message
);
555 int TranslateString(const CStdString
&strCondition
);
556 bool GetBool(int condition
, int contextWindow
= 0, const CGUIListItem
*item
=NULL
);
557 int GetInt(int info
, int contextWindow
= 0) const;
558 CStdString
GetLabel(int info
, int contextWindow
= 0);
560 CStdString
GetImage(int info
, int contextWindow
);
562 CStdString
GetTime(TIME_FORMAT format
= TIME_FORMAT_GUESS
) const;
563 CStdString
GetLcdTime( int _eInfo
) const;
564 CStdString
GetDate(bool bNumbersOnly
= false);
565 CStdString
GetDuration(TIME_FORMAT format
= TIME_FORMAT_GUESS
) const;
567 void SetCurrentItem(CFileItem
&item
);
568 void ResetCurrentItem();
569 // Current song stuff
570 /// \brief Retrieves tag info (if necessary) and fills in our current song path.
571 void SetCurrentSong(CFileItem
&item
);
572 void SetCurrentAlbumThumb(const CStdString thumbFileName
);
573 void SetCurrentMovie(CFileItem
&item
);
574 void SetCurrentSlide(CFileItem
&item
);
575 const CFileItem
&GetCurrentSlide() const;
576 void ResetCurrentSlide();
577 void SetCurrentSongTag(const MUSIC_INFO::CMusicInfoTag
&tag
);
578 void SetCurrentVideoTag(const CVideoInfoTag
&tag
);
580 const MUSIC_INFO::CMusicInfoTag
*GetCurrentSongTag() const;
581 const CVideoInfoTag
* GetCurrentMovieTag() const;
583 CStdString
GetMusicLabel(int item
);
584 CStdString
GetMusicTagLabel(int info
, const CFileItem
*item
) const;
585 CStdString
GetVideoLabel(int item
);
586 CStdString
GetPlaylistLabel(int item
) const;
587 CStdString
GetMusicPartyModeLabel(int item
);
588 const CStdString
GetMusicPlaylistInfo(const GUIInfo
& info
) const;
589 CStdString
GetPictureLabel(int item
) const;
591 __int64
GetPlayTime() const; // in ms
592 CStdString
GetCurrentPlayTime(TIME_FORMAT format
= TIME_FORMAT_GUESS
) const;
593 int GetPlayTimeRemaining() const;
594 int GetTotalPlayTime() const;
595 CStdString
GetCurrentPlayTimeRemaining(TIME_FORMAT format
) const;
596 CStdString
GetVersion();
597 CStdString
GetBuild();
599 bool GetDisplayAfterSeek();
600 void SetDisplayAfterSeek(unsigned int timeOut
= 2500, int seekOffset
= 0);
601 void SetSeeking(bool seeking
) { m_playerSeeking
= seeking
; };
602 void SetShowTime(bool showtime
) { m_playerShowTime
= showtime
; };
603 void SetShowCodec(bool showcodec
) { m_playerShowCodec
= showcodec
; };
604 void SetShowInfo(bool showinfo
) { m_playerShowInfo
= showinfo
; };
605 void ToggleShowCodec() { m_playerShowCodec
= !m_playerShowCodec
; };
606 void ToggleShowInfo() { m_playerShowInfo
= !m_playerShowInfo
; };
607 bool m_performingSeek
;
609 std::string
GetSystemHeatInfo(int info
);
610 CTemperature
GetGPUTemperature();
613 inline float GetFPS() const { return m_fps
; };
615 void SetNextWindow(int windowID
) { m_nextWindowID
= windowID
; };
616 void SetPreviousWindow(int windowID
) { m_prevWindowID
= windowID
; };
619 void ResetPersistentCache();
621 CStdString
GetItemLabel(const CFileItem
*item
, int info
) const;
622 CStdString
GetItemImage(const CFileItem
*item
, int info
) const;
624 // Called from tuxbox service thread to update current status
625 void UpdateFromTuxBox();
627 /*! \brief containers call here to specify that the focus is changing
629 \param next true if we're moving to the next item, false if previous
630 \param scrolling true if the container is scrolling, false if the movement requires no scroll
632 void SetContainerMoving(int id
, bool next
, bool scrolling
)
634 // magnitude 2 indicates a scroll, sign indicates direction
635 m_containerMoves
[id
] = (next
? 1 : -1) * (scrolling
? 2 : 1);
638 void SetLibraryBool(int condition
, bool value
);
639 bool GetLibraryBool(int condition
);
640 void ResetLibraryBools();
641 CStdString
LocalizeTime(const CDateTime
&time
, TIME_FORMAT format
) const;
644 // routines for window retrieval
645 bool CheckWindowCondition(CGUIWindow
*window
, int condition
) const;
646 CGUIWindow
*GetWindowWithCondition(int contextWindow
, int condition
) const;
648 bool GetMultiInfoBool(const GUIInfo
&info
, int contextWindow
= 0, const CGUIListItem
*item
= NULL
);
649 CStdString
GetMultiInfoLabel(const GUIInfo
&info
, int contextWindow
= 0) const;
650 int TranslateSingleString(const CStdString
&strCondition
);
651 int TranslateListItem(const CStdString
&info
);
652 int TranslateMusicPlayerString(const CStdString
&info
) const;
653 TIME_FORMAT
TranslateTimeFormat(const CStdString
&format
);
654 bool GetItemBool(const CGUIListItem
*item
, int condition
) const;
656 // Conditional string parameters for testing are stored in a vector for later retrieval.
657 // The offset into the string parameters array is returned.
658 int ConditionalStringParameter(const CStdString
&strParameter
);
659 int AddMultiInfo(const GUIInfo
&info
);
660 int AddListItemProp(const CStdString
&str
, int offset
=0);
662 CStdString
GetAudioScrobblerLabel(int item
);
664 // Conditional string parameters are stored here
665 CStdStringArray m_stringParameters
;
667 // Array of multiple information mapped to a single integer lookup
668 std::vector
<GUIInfo
> m_multiInfo
;
669 std::vector
<std::string
> m_listitemProperties
;
671 CStdString m_currentMovieDuration
;
673 // Current playing stuff
674 CFileItem
* m_currentFile
;
675 CStdString m_currentMovieThumb
;
676 unsigned int m_lastMusicBitrateTime
;
677 unsigned int m_MusicBitrate
;
678 CFileItem
* m_currentSlide
;
681 unsigned int m_lastSysHeatInfoTime
;
683 CTemperature m_gpuTemp
;
684 CTemperature m_cpuTemp
;
686 //Fullscreen OSD Stuff
687 unsigned int m_AfterSeekTimeout
;
689 bool m_playerSeeking
;
690 bool m_playerShowTime
;
691 bool m_playerShowCodec
;
692 bool m_playerShowInfo
;
696 unsigned int m_frameCounter
;
697 unsigned int m_lastFPSTime
;
699 std::map
<int, int> m_containerMoves
; // direction of list moving
706 CStdString m_info
; // the text expression
707 int m_id
; // the id used to identify this expression
708 std::list
<int> m_postfix
; // the postfix binary expression
709 CCombinedValue
& operator=(const CCombinedValue
& mSrc
);
712 int GetOperator(const char ch
);
713 int TranslateBooleanExpression(const CStdString
&expression
);
714 bool EvaluateBooleanExpression(const CCombinedValue
&expression
, bool &result
, int contextWindow
, const CGUIListItem
*item
=NULL
);
716 std::vector
<CCombinedValue
> m_CombinedValues
;
718 // routines for caching the bool results
719 bool IsCached(int condition
, int contextWindow
, bool &result
) const;
720 void CacheBool(int condition
, int contextWindow
, bool result
, bool persistent
=false);
721 std::map
<int, bool> m_boolCache
;
724 std::map
<int, bool> m_persistentBoolCache
;
725 int m_libraryHasMusic
;
726 int m_libraryHasMovies
;
727 int m_libraryHasTVShows
;
728 int m_libraryHasMusicVideos
;
730 CCriticalSection m_critInfo
;
737 extern CGUIInfoManager g_infoManager
;