forked from romanvm/Kodistubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xbmc.py
1089 lines (832 loc) · 28.5 KB
/
xbmc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## @package xbmc
# Various classes and functions to interact with XBMC.
#
CAPTURE_FLAG_CONTINUOUS = 1
CAPTURE_FLAG_IMMEDIATELY = 2
CAPTURE_STATE_DONE = 3
CAPTURE_STATE_FAILED = 4
CAPTURE_STATE_WORKING = 0
DRIVE_NOT_READY = 1
ENGLISH_NAME = 2
ISO_639_1 = 0
ISO_639_2 = 1
LOGDEBUG = 0
LOGERROR = 4
LOGFATAL = 6
LOGINFO = 1
LOGNONE = 7
LOGNOTICE = 2
LOGSEVERE = 5
LOGWARNING = 3
PLAYER_CORE_AUTO = 0
PLAYER_CORE_DVDPLAYER = 1
PLAYER_CORE_MPLAYER = 2
PLAYER_CORE_PAPLAYER = 3
PLAYLIST_MUSIC = 0
PLAYLIST_VIDEO = 1
SERVER_AIRPLAYSERVER = 2
SERVER_EVENTSERVER = 6
SERVER_JSONRPCSERVER = 3
SERVER_UPNPRENDERER = 4
SERVER_UPNPSERVER = 5
SERVER_WEBSERVER = 1
SERVER_ZEROCONF = 7
TRAY_CLOSED_MEDIA_PRESENT = 96
TRAY_CLOSED_NO_MEDIA = 64
TRAY_OPEN = 16
__author__ = 'Team XBMC <http://xbmc.org>'
__credits__ = 'Team XBMC'
__date__ = 'Sun Aug 18 16:43:16 CEST 2013'
__platform__ = 'ALL'
__version__ = '2.0'
abortRequested = False
#noinspection PyUnusedLocal
class Keyboard(object):
def __init__(self, default=None, heading=None, hidden=False):
"""Creates a new Keyboard object with default text heading and hidden input flag if supplied.
default: string - default text entry.
heading: string - keyboard heading.
hidden: boolean - True for hidden text entry.
Example:
kb = xbmc.Keyboard('default', 'heading', True)
kb.setDefault('password') # optional
kb.setHeading('Enter password') # optional
kb.setHiddenInput(True) # optional
kb.doModal()
if (kb.isConfirmed()):
text = kb.getText()
"""
pass
def doModal(self, autoclose=0):
"""Show keyboard and wait for user action.
autoclose: integer - milliseconds to autoclose dialog.
Note:
autoclose = 0 - This disables autoclose
Example:
kb.doModal(30000)
"""
pass
def setDefault(self, default):
"""Set the default text entry.
default: string - default text entry.
Example:
kb.setDefault('password')
"""
pass
def setHiddenInput(self, hidden):
"""Allows hidden text entry.
hidden: boolean - True for hidden text entry.
Example:
kb.setHiddenInput(True)
"""
pass
def setHeading(self, heading):
"""Set the keyboard heading.
heading: string - keyboard heading.
Example:
kb.setHeading('Enter password')
"""
pass
def getText(self):
"""Returns the user input as a string.
Note:
This will always return the text entry even if you cancel the keyboard.
Use the isConfirmed() method to check if user cancelled the keyboard.
"""
return str
def isConfirmed(self):
"""Returns False if the user cancelled the input.
example:
- if (kb.isConfirmed()):"""
return bool
#noinspection PyUnusedLocal
class Player(object):
def __init__(self, core=None):
"""Creates a new Player with as default the xbmc music playlist.
Args:
core: Use a specified playcore instead of letting xbmc decide the playercore to use.
- xbmc.PLAYER_CORE_AUTO
- xbmc.PLAYER_CORE_DVDPLAYER
- xbmc.PLAYER_CORE_MPLAYER
- xbmc.PLAYER_CORE_PAPLAYER
"""
pass
def play(self, item=None, listitem=None, windowed=False):
"""
play([item, listitem, windowed]) -- Play this item.
item : [opt] string - filename, url or playlist.
listitem : [opt] listitem - used with setInfo() to set different infolabels.
windowed : [opt] bool - true=play video windowed, false=play users preference.(default)
*Note, If item is not given then the Player will try to play the current item
in the current playlist.
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
example:
- listitem = xbmcgui.ListItem('Ironman')
- listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})
- xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play(url, listitem, windowed)
"""
pass
def stop(self):
"""Stop playing."""
pass
def pause(self):
"""Pause playing."""
pass
def playnext(self):
"""Play next item in playlist."""
pass
def playprevious(self):
"""Play previous item in playlist."""
pass
def playselected(self):
"""Play a certain item from the current playlist."""
pass
def onPlayBackStarted(self):
"""Will be called when xbmc starts playing a file."""
pass
def onPlayBackEnded(self):
"""Will be called when xbmc stops playing a file."""
pass
def onPlayBackStopped(self):
"""Will be called when user stops xbmc playing a file."""
def onPlayBackPaused(self):
"""Will be called when user pauses a playing file."""
pass
def onPlayBackResumed(self):
"""Will be called when user resumes a paused file."""
pass
def onPlayBackSeek(self, time, seekOffset):
"""
onPlayBackSeek(time, seekOffset) -- onPlayBackSeek method.
time : integer - time to seek to.
seekOffset : integer - ?.
Will be called when user seeks to a time
"""
pass
def onPlayBackSeekChapter(self, chapter):
"""
onPlayBackSeekChapter(chapter) -- onPlayBackSeekChapter method.
chapter : integer - chapter to seek to.
Will be called when user performs a chapter seek
"""
pass
def onPlayBackSpeedChanged(self, speed):
"""
onPlayBackSpeedChanged(speed) -- onPlayBackSpeedChanged method.
speed : integer - current speed of player.
*Note, negative speed means player is rewinding, 1 is normal playback speed.
Will be called when players speed changes. (eg. user FF/RW)
"""
pass
def onQueueNextItem(self):
"""
onQueueNextItem() -- onQueueNextItem method.
Will be called when player requests next item
"""
pass
def isPlaying(self):
"""Returns True is xbmc is playing a file."""
return bool
def isPlayingAudio(self):
"""Returns True is xbmc is playing an audio file."""
return bool
def isPlayingVideo(self):
"""Returns True if xbmc is playing a video."""
return bool
def getPlayingFile(self):
"""Returns the current playing file as a string.
Raises:
Exception: If player is not playing a file.
"""
return str
def getVideoInfoTag(self):
"""Returns the VideoInfoTag of the current playing Movie.
Raises:
Exception: If player is not playing a file or current file is not a movie file.
Note:
This doesn't work yet, it's not tested.
"""
return object
def getMusicInfoTag(self):
"""Returns the MusicInfoTag of the current playing 'Song'.
Raises:
Exception: If player is not playing a file or current file is not a music file.
"""
return object
def getTotalTime(self):
"""Returns the total time of the current playing media in seconds.
This is only accurate to the full second.
Raises:
Exception: If player is not playing a file.
"""
return float
def getTime(self):
"""Returns the current time of the current playing media as fractional seconds.
Raises:
Exception: If player is not playing a file.
"""
return float
def seekTime(self, pTime):
"""Seeks the specified amount of time as fractional seconds.
The time specified is relative to the beginning of the currently playing media file.
Raises:
Exception: If player is not playing a file.
"""
pass
def setSubtitles(self, path):
"""Set subtitle file and enable subtitles.
path: string or unicode - Path to subtitle.
Example:
setSubtitles('/path/to/subtitle/test.srt')
"""
pass
def getSubtitles(self):
"""Get subtitle stream name."""
return str
def disableSubtitles(self):
"""Disable subtitles."""
pass
def getAvailableAudioStreams(self):
"""Get audio stream names."""
return list
def getAvailableSubtitleStreams(self):
"""
getAvailableSubtitleStreams() -- get Subtitle stream names
"""
return list
def setAudioStream(self, stream):
"""Set audio stream.
stream: int
"""
pass
#noinspection PyUnusedLocal
class PlayList(object):
def __init__(self, playlist):
"""Retrieve a reference from a valid xbmc playlist
playlist: int - can be one of the next values:
0: xbmc.PLAYLIST_MUSIC
1: xbmc.PLAYLIST_VIDEO
Use PlayList[int position] or __getitem__(int position) to get a PlayListItem.
"""
pass
def __getitem__(self, item):
return None
def __len__(self):
return 0
def add(self, url, listitem=None, index=-1):
"""Adds a new file to the playlist.
url: string or unicode - filename or url to add.
listitem: listitem - used with setInfo() to set different infolabels.
index: integer - position to add playlist item.
Example:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
video = 'F:\\movies\\Ironman.mov'
listitem = xbmcgui.ListItem('Ironman', thumbnailImage='F:\\movies\\Ironman.tbn')
listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})
playlist.add(url=video, listitem=listitem, index=7)
"""
pass
def load(self, filename):
"""Load a playlist.
Clear current playlist and copy items from the file to this Playlist filename can be like .pls or .m3u ...
Returns False if unable to load playlist, True otherwise.
"""
return bool
def remove(self, filename):
"""Remove an item with this filename from the playlist."""
pass
def clear(self):
"""Clear all items in the playlist."""
pass
def shuffle(self):
"""Shuffle the playlist."""
pass
def unshuffle(self):
"""Unshuffle the playlist."""
pass
def size(self):
"""Returns the total number of PlayListItems in this playlist."""
return int
def getposition(self):
"""Returns the position of the current song in this playlist."""
return int
#noinspection PyUnusedLocal
class PlayListItem(object):
"""Creates a new PlaylistItem which can be added to a PlayList."""
def getdescription(self):
"""Returns the description of this PlayListItem."""
return str
def getduration(self):
"""Returns the duration of this PlayListItem."""
return long
def getfilename(self):
"""Returns the filename of this PlayListItem."""
return str
#noinspection PyUnusedLocal
class InfoTagMusic(object):
def getURL(self):
"""Returns a string."""
return str
def getTitle(self):
"""Returns a string."""
return str
def getArtist(self):
"""Returns a string."""
return str
def getAlbumArtist(self):
"""Returns a string."""
return str
def getAlbum(self):
"""Returns a string."""
return str
def getGenre(self):
"""Returns a string."""
return str
def getDuration(self):
"""Returns an integer."""
return int
def getTrack(self):
"""Returns an integer."""
return int
def getDisc(self):
"""Returns an integer."""
return int
def getTrackAndDisc(self):
"""Returns an integer."""
return int
def getReleaseDate(self):
"""Returns a string."""
return str
def getListeners(self):
"""Returns an integer."""
return int
def getPlayCount(self):
"""Returns an integer."""
return int
def getLastPlayed(self):
"""Returns a string."""
return str
def getComment(self):
"""Returns a string."""
return str
def getLyrics(self):
"""Returns a string."""
return str
#noinspection PyUnusedLocal
class InfoTagVideo(object):
def getDirector(self):
"""Returns a string."""
return str
def getWritingCredits(self):
"""Returns a string."""
return str
def getGenre(self):
"""Returns a string."""
return str
def getTagLine(self):
"""Returns a string."""
return str
def getPlotOutline(self):
"""Returns a string."""
return str
def getPlot(self):
"""Returns a string."""
return str
def getPictureURL(self):
"""Returns a string."""
return str
def getTitle(self):
"""Returns a string."""
return str
def getOriginalTitle(self):
"""Returns a string."""
return str
def getVotes(self):
"""Returns a string."""
return str
def getCast(self):
"""Returns a string."""
return str
def getFile(self):
"""Returns a string."""
return str
def getPath(self):
"""Returns a string."""
return str
def getIMDBNumber(self):
"""Returns a string."""
return str
def getYear(self):
"""Returns an integer."""
return int
def getPremiered(self):
"""Returns a string."""
return str
def getFirstAired(self):
"""Returns a string."""
return str
def getRating(self):
"""Returns a float."""
return float
def getPlayCount(self):
"""Returns an integer."""
return int
def getLastPlayed(self):
"""Returns a string."""
return str
#noinspection PyUnusedLocal
class Monitor(object):
"""
Monitor class.
Monitor() -- Creates a new Monitor to notify addon about changes.
"""
def onAbortRequested(self):
"""
onAbortRequested() -- onAbortRequested method.
Will be called when XBMC requests Abort
"""
pass
def onDatabaseUpdated(self, database):
"""
onDatabaseUpdated(database) -- onDatabaseUpdated method.
database - video/music as string
Will be called when database gets updated and return video or music to indicate which DB has been changed
"""
pass
def onScreensaverActivated(self):
"""
onScreensaverActivated() -- onScreensaverActivated method.
Will be called when screensaver kicks in
"""
pass
def onScreensaverDeactivated(self):
"""
onScreensaverDeactivated() -- onScreensaverDeactivated method.
Will be called when screensaver goes off
"""
pass
def onSettingsChanged(self):
"""
onSettingsChanged() -- onSettingsChanged method.
Will be called when addon settings are changed
"""
pass
def onDatabaseScanStarted(self, database):
"""
onDatabaseScanStarted(database)--onDatabaseScanStarted method.
database : video/music as string
Will be called when database update starts and return video or music to indicate which DB is being updated
"""
return str
def onNotification(self, sender, method, data):
"""
onNotification(sender, method, data)--onNotification method.
sender : sender of the notification
method : name of the notification
data : JSON-encoded data of the notification
Will be called when XBMC receives or sends a notification
"""
pass
#noinspection PyUnusedLocal
class RenderCapture(object):
def capture(self, width, height, flags=None):
"""
capture(width, height [, flags])--issue capture request.
width : Width capture image should be rendered to
height : Height capture image should should be rendered to
flags : Optional. Flags that control the capture processing.
The value for 'flags' could be or'ed from the following constants:
- xbmc.CAPTURE_FLAG_CONTINUOUS : after a capture is done, issue a new capture request immediately
- xbmc.CAPTURE_FLAG_IMMEDIATELY : read out immediately whencapture() is called, this can cause a busy wait
"""
pass
def getAspectRatio(self):
"""
getAspectRatio() --returns aspect ratio of currently displayed video.
"""
return asp_ratio
def getCaptureState(self):
"""
getCaptureState() --returns processing state of capture request.
The returned value could be compared against the following constants:
- xbmc.CAPTURE_STATE_WORKING : Capture request in progress.
- xbmc.CAPTURE_STATE_DONE : Capture request done. The image could be retrieved withgetImage()
- xbmc.CAPTURE_STATE_FAILED : Capture request failed.
"""
return int
def getHeight(self):
"""
getHeight() --returns height of captured image.
"""
return int
def getImage(self):
"""
getImage() --returns captured image as a bytearray.
The size of the image isgetWidth() *getHeight() * 4
"""
return bytearray
def getImageFormat(self):
"""
getImageFormat() --returns format of captured image: 'BGRA' or 'RGBA'.
"""
return str
def getWidth(self):
"""
getWidth() --returns width of captured image.
"""
return int
def waitForCaptureStateChangeEvent(self, msec):
"""
waitForCaptureStateChangeEvent([msecs])--wait for capture state change event.
msecs : Milliseconds to wait. Waits forever if not specified.
The method will return 1 if the Event was triggered. Otherwise it will return 0.
"""
return int
#noinspection PyUnusedLocal
def audioResume():
"""
audioResume()--Resume Audio engine.
example: xbmc.audioResume()
"""
pass
def audioSuspend():
"""
audioSuspend()--Suspend Audio engine.
example:
- xbmc.audioSuspend()
"""
pass
def convertLanguage(language, format_):
"""
convertLanguage(language, format)--Returns the given language converted to the given format as a string.
language: string either as name in English, two letter code (ISO 639-1), or three letter code (ISO 639-2/T(B)
format: format of the returned language string
xbmc.ISO_639_1: two letter code as defined in ISO 639-1
xbmc.ISO_639_2: three letter code as defined in ISO 639-2/T or ISO 639-2/B
xbmc.ENGLISH_NAME: full language name in English (default)
example:
- language = xbmc.convertLanguage(English, xbmc.ISO_639_2)
"""
return str
def enableNavSounds(yesNo):
"""
enableNavSounds(yesNo)--Enables/Disables nav sounds
yesNo : integer - enable (True) or disable (False) nav sounds
example:
- xbmc.enableNavSounds(True)
"""
pass
def executeJSONRPC(jsonrpccommand):
"""
executeJSONRPC(jsonrpccommand)--Execute an JSONRPC command.
jsonrpccommand : string - jsonrpc command to execute.
List of commands - http://wiki.xbmc.org/?title=JSON-RPC_API
example:
- response = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "method": "JSONRPC.Introspect", "id": 1 }')
"""
return str
def executebuiltin(function):
"""
executebuiltin(function)--Execute a built in XBMC function.
function : string - builtin function to execute.
List of functions - http://wiki.xbmc.org/?title=List_of_Built_In_Functions
example:
- xbmc.executebuiltin('XBMC.RunXBE(c:\avalaunch.xbe)')
"""
pass
def executescript(script):
"""
executescript(script)--Execute a python script.
script : string - script filename to execute.
example:
- xbmc.executescript('special://home/scripts/update.py')
"""
pass
def getCacheThumbName(path):
"""
getCacheThumbName(path)--Returns a thumb cache filename.
path : string or unicode - path to file
example:
- thumb = xbmc.getCacheThumbName('f:\videos\movie.avi')
"""
return str
def getCleanMovieTitle(path, usefoldername):
"""
getCleanMovieTitle(path[, usefoldername])--Returns a clean movie title and year string if available.
path : string or unicode - String to clean
bool : [opt] bool - use folder names (defaults to false)
example:
- title, year = xbmc.getCleanMovieTitle('/path/to/moviefolder/test.avi', True)
"""
return str
def getCondVisibility(condition):
"""
getCondVisibility(condition)--Returns True (1) or False (0) as a bool.
condition : string - condition to check.
List of Conditions -http://wiki.xbmc.org/?title=List_of_Boolean_Conditions
*Note, You can combine two (or more) of the above settings by using "+" as an AND operator,
"|" as an OR operator, "!" as a NOT operator, and "[" and "]" to bracket expressions.
example:
- visible = xbmc.getCondVisibility('[Control.IsVisible(41) + !Control.IsVisible(12)]')
"""
return bool
def getDVDState():
"""
getDVDState()--Returns the dvd state as an integer.
return values are:
- 1 : xbmc.DRIVE_NOT_READY
- 16 : xbmc.TRAY_OPEN
- 64 : xbmc.TRAY_CLOSED_NO_MEDIA
- 96 : xbmc.TRAY_CLOSED_MEDIA_PRESENT
example:
- dvdstate = xbmc.getDVDState()
"""
return int
def getFreeMem():
"""
getFreeMem()--Returns the amount of free memory in MB as an integer.
example:
- freemem = xbmc.getFreeMem()
"""
return int
def getGlobalIdleTime():
"""
getGlobalIdleTime()--Returns the elapsed idle time in seconds as an integer.
example:
- t = xbmc.getGlobalIdleTime()
"""
return int
def getIPAddress():
"""
getIPAddress()--Returns the current ip address as a string.
example:
- ip = xbmc.getIPAddress()
"""
return str
def getInfoImage(infotag):
"""
getInfoImage(infotag)--Returns a filename including path to the InfoImage's thumbnail as a string.
infotag : string - infotag for value you want returned.
List of InfoTags -http://wiki.xbmc.org/?title=InfoLabels
example:
- filename = xbmc.getInfoImage('Weather.Conditions')
"""
return str
def getInfoLabel(infotag):
"""
getInfoLabel(infotag)--Returns an InfoLabel as a string.
infotag : string - infoTag for value you want returned.
List of InfoTags -http://wiki.xbmc.org/?title=InfoLabels
example:
- label = xbmc.getInfoLabel('Weather.Conditions')
"""
return str
def getLanguage(format_, region):
"""
getLanguage([format], [region])--Returns the active language as a string.
format: [opt] format of the returned language string
- xbmc.ISO_639_1: two letter code as defined in ISO 639-1
- xbmc.ISO_639_2: three letter code as defined in ISO 639-2/T or ISO 639-2/B
- xbmc.ENGLISH_NAME: full language name in English (default)
region: [opt] append the region delimited by "-" of the language (setting) to the returned language string
example:
- language = xbmc.getLanguage(xbmc.ENGLISH_NAME)
"""
return str
def getLocalizedString(id_):
"""
getLocalizedString(id)--Returns a localized 'unicode string'.
id : integer - id# for string you want to localize.
*Note, See strings.po in language folders for which id
you need for a string.
example:
- locstr = xbmc.getLocalizedString(6)
"""
return unicode
def getRegion(id_):
"""
getRegion(id)--Returns your regions setting as a string for the specified id.
id : string - id of setting to return
*Note, choices are (dateshort, datelong, time, meridiem, tempunit, speedunit)You can use the above as keywords for arguments.
example:
- date_long_format = xbmc.getRegion('datelong')
"""
return str
def getSkinDir():
"""
getSkinDir()--Returns the active skin directory as a string.
*Note, This is not the full path like 'special://home/addons/MediaCenter', but only 'MediaCenter'.
example:
- skindir = xbmc.getSkinDir()
"""
return str
def getSupportedMedia(media):
"""
getSupportedMedia(media)--Returns the supported file types for the specific media as a string.
media : string - media type
*Note, media type can be (video, music, picture).The return value is a pipe separated string of filetypes (eg. '.mov|.avi').
You can use the above as keywords for arguments.
example:
- mTypes = xbmc.getSupportedMedia('video')
"""
return str
def log(msg, level=LOGNOTICE):
"""
log(msg[, level])--Write a string to XBMC's log file and the debug window.
msg : string - text to output.
level : [opt] integer - log level to ouput at. (default=LOGNOTICE)
*Note, You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
Text is written to the log for the following conditions.
XBMC loglevel == -1 (NONE, nothing at all is logged)
XBMC loglevel == 0 (NORMAL, shows LOGNOTICE, LOGERROR, LOGSEVERE and LOGFATAL) * XBMC loglevel == 1 (DEBUG, shows all)
See pydocs for valid values for level.
example:
- xbmc.output(msg='This is a test string.', level=xbmc.LOGDEBUG));
"""
pass
def makeLegalFilename(filename, fatX):
"""
makeLegalFilename(filename[, fatX])--Returns a legal filename or path as a string.
filename : string or unicode - filename/path to make legal
fatX : [opt] bool - True=Xbox file system(Default)
*Note, If fatX is true you should pass a full path. If fatX is false only pass the basename of the path.
You can use the above as keywords for arguments and skip certain optional arguments. Once you use a keyword, all following arguments require the keyword.
example:
- filename = xbmc.makeLegalFilename('F: Age: The Meltdown.avi')
"""
return str
def playSFX(filename):
"""
playSFX(filename)--Plays a wav file by filename
filename : string - filename of the wav file to play.
example:
- xbmc.playSFX('special://xbmc/scripts/dingdong.wav')
"""
pass
def restart():