xbmc (version 1.3, 15 November 2005)
index
(built-in)

 
Classes
       
__builtin__.object
InfoTagMusic
InfoTagVideo
Keyboard
Language
PlayList
PlayListItem
Player

 
class InfoTagMusic(__builtin__.object)
    InfoTagMusic class.
 
  Methods defined here:
getAlbum(...)
getAlbum() -- returns a string.
getArtist(...)
getArtist() -- returns a string.
getDisc(...)
getDisc() -- returns an integer.
getDuration(...)
getDuration() -- returns an integer.
getGenre(...)
getAlbum() -- returns a string.
getReleaseDate(...)
getReleaseDate() -- returns a string.
getTitle(...)
getTitle() -- returns a string.
getTrack(...)
getTrack() -- returns an integer.
getURL(...)
getURL() -- returns a string.

 
class InfoTagVideo(__builtin__.object)
    InfoTagVideo class.
 
  Methods defined here:
getCast(...)
getCast() -- returns a string.
getDirector(...)
getDirector() -- returns a string.
getFile(...)
getFile() -- returns a string.
getGenre(...)
getGenre() -- returns a string.
getIMDBNumber(...)
getIMDBNumber() -- returns a string.
getPath(...)
getPath() -- returns a string.
getPictureURL(...)
getPictureURL() -- returns a string.
getPlot(...)
getPlot() -- returns a string.
getPlotOutline(...)
getPlotOutline() -- returns a string.
getRating(...)
getRating() -- returns a float.
getTagLine(...)
getTagLine() -- returns a string.
getTitle(...)
getTitle() -- returns a string.
getVotes(...)
getVotes() -- returns a string.
getWritingCredits(...)
getWritingCredits() -- returns a string.
getYear(...)
getYear() -- returns a integer.

 
class Keyboard(__builtin__.object)
    Keyboard class.
 
Keyboard([default, heading, hidden]) -- Creates a new Keyboard object with default text
                                heading and hidden input flag if supplied.
 
default        : [opt] string - default text entry.
heading        : [opt] string - keyboard heading.
hidden         : [opt] 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()
 
  Methods defined here:
doModal(...)
doModal() -- Show keyboard and wait for user action.
 
example:
  - kb.doModal()
getText(...)
getText() -- 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.
 
example:
  - text = kb.getText()
isConfirmed(...)
isConfirmed() -- Returns False if the user cancelled the input.
 
example:
  - if (kb.isConfirmed()):
setDefault(...)
setDefault(default) -- Set the default text entry.
 
default        : string - default text entry.
 
example:
  - kb.setDefault('password')
setHeading(...)
setHeading(heading) -- Set the keyboard heading.
 
heading        : string - keyboard heading.
 
example:
  - kb.setHeading('Enter password')
setHiddenInput(...)
setHiddenInput(hidden) -- Allows hidden text entry.
 
hidden        : boolean - True for hidden text entry.
example:
  - kb.setHiddenInput(True)

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Language(__builtin__.object)
    Language class.
 
Language(scriptPath, defaultLanguage) -- Creates a new Language class.
 
scriptPath      : string - path to script. (eg os.getcwd())
defaultLanguage : [opt] string - default language to fallback to. (default=English)
 
*Note, language folder structure is eg(language/English/strings.xml)
 
       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:
 - self.Language = xbmc.Language(os.getcwd())
 
  Methods defined here:
getLocalizedString(...)
getLocalizedString(id) -- Returns a localized 'unicode string'.
 
id             : integer - id# for string you want to localize.
 
*Note, getLocalizedString() will fallback to XBMC strings if no string found.
 
       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:
  - locstr = self.Language.getLocalizedString(id=6)

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class PlayList(__builtin__.object)
    PlayList class.
 
PlayList(int playlist) -- retrieve a reference from a valid xbmc playlist
 
int playlist 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.
 
  Methods defined here:
__getitem__(...)
x.__getitem__(y) <==> x[y]
__len__(...)
x.__len__() <==> len(x)
add(...)
add(url[, listitem, index]) -- Adds a new file to the playlist.
 
url            : string or unicode - filename or url to add.
listitem       : [opt] listitem - used with setInfo() to set different infolabels.
index          : [opt] integer - position to add playlist item. (default=end)
 
*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.
 
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)
clear(...)
clear() -- clear all items in the playlist.
getposition(...)
getposition() -- returns the position of the current song in this playlist.
load(...)
load(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
remove(...)
remove(filename) -- remove an item with this filename from the playlist.
shuffle(...)
shuffle() -- shuffle the playlist.
size(...)
size() -- returns the total number of PlayListItems in this playlist.
unshuffle(...)
unshuffle() -- unshuffle the playlist.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class PlayListItem(__builtin__.object)
    PlayListItem class.
 
PlayListItem() -- Creates a new PlaylistItem which can be added to a PlayList.
 
  Methods defined here:
getdescription(...)
getdescription() -- Returns the description of this PlayListItem.
getduration(...)
getduration() -- Returns the duration of this PlayListItem.
getfilename(...)
getfilename() -- Returns the filename of this PlayListItem.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Player(__builtin__.object)
    Player class.
 
Player([core]) -- Creates a new Player with as default the xbmc music playlist.
 
core     : (optional) 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
 
  Methods defined here:
getMusicInfoTag(...)
getMusicInfoTag() -- returns the MusicInfoTag of the current playing 'Song'.
 
Throws: Exception, if player is not playing a file or current file is not a music file.
getPlayingFile(...)
getPlayingFile() -- returns the current playing file as a string.
 
Throws: Exception, if player is not playing a file.
getTime(...)
getTime() -- Returns the current time of the current playing media as fractional seconds.
 
Throws: Exception, if player is not playing a file.
getTotalTime(...)
getTotalTime() -- Returns the total time of the current playing media in
                  seconds.  This is only accurate to the full second.
 
Throws: Exception, if player is not playing a file.
getVideoInfoTag(...)
getVideoInfoTag() -- returns the VideoInfoTag of the current playing Movie.
 
Throws: 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
isPlaying(...)
isPlayingAudio() -- returns True is xbmc is playing a file.
isPlayingAudio(...)
isPlayingAudio() -- returns True is xbmc is playing an audio file.
isPlayingVideo(...)
isPlayingVideo() -- returns True if xbmc is playing a video.
onPlayBackEnded(...)
onPlayBackEnded() -- onPlayBackEnded method.
 
Will be called when xbmc stops playing a file
onPlayBackStarted(...)
onPlayBackStarted() -- onPlayBackStarted method.
 
Will be called when xbmc starts playing a file
onPlayBackStopped(...)
onPlayBackStopped() -- onPlayBackStopped method.
 
Will be called when user stops xbmc playing a file
pause(...)
pause() -- Pause playing.
play(...)
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)
playnext(...)
playnext() -- Play next item in playlist.
playprevious(...)
playprevious() -- Play previous item in playlist.
playselected(...)
playselected() -- Play a certain item from the current playlist.
seekTime(...)
seekTime() -- Seeks the specified amount of time as fractional seconds.
              The time specified is relative to the beginning of the
              currently playing media file.
 
Throws: Exception, if player is not playing a file.
setSubtitles(...)
setSubtitles() -- set subtitle file and enable subtitles
stop(...)
stop() -- Stop playing.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
Functions
       
dashboard(...)
dashboard() -- Boot to dashboard as set in My Pograms/General.
 
example:
  - xbmc.dashboard()
enableNavSounds(...)
enableNavSounds(yesNo) -- Enables/Disables nav sounds
 
yesNo          : integer - enable (True) or disable (False) nav sounds
 
example:
  - xbmc.enableNavSounds(True)
executebuiltin(...)
executebuiltin(function) -- Execute a built in XBMC function.
 
function       : string - builtin function to execute.
 
List of functions - http://xbmc.org/wiki/?title=List_of_Built_In_Functions 
 
example:
  - xbmc.executebuiltin('XBMC.RunXBE(c:\\avalaunch.xbe)')
executehttpapi(...)
executehttpapi(httpcommand) -- Execute an HTTP API command.
 
httpcommand    : string - http command to execute.
 
List of commands - http://xbmc.org/wiki/?title=WebServerHTTP-API#The_Commands 
 
example:
  - response = xbmc.executehttpapi('TakeScreenShot(special://temp/test.jpg,0,false,200,-1,90)')
executescript(...)
executescript(script) -- Execute a python script.
 
script         : string - script filename to execute.
 
example:
  - xbmc.executescript('special://home/scripts/update.py')
getCacheThumbName(...)
getCacheThumbName(path) -- Returns a thumb cache filename.
 
path           : string or unicode - path to file
 
example:
  - thumb = xbmc.getCacheThumbName('f:\\videos\\movie.avi')
getCondVisibility(...)
getCondVisibility(condition) -- Returns True (1) or False (0) as a bool.
 
condition      : string - condition to check.
 
List of Conditions - http://xbmc.org/wiki/?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)]')
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()
getFreeMem(...)
getFreeMem() -- Returns the amount of free memory in MB as an integer.
 
example:
  - freemem = xbmc.getFreeMem()
getGlobalIdleTime(...)
getGlobalIdleTime() -- Returns the elapsed idle time in seconds as an integer.
 
example:
  - t = xbmc.getGlobalIdleTime()
getIPAddress(...)
getIPAddress() -- Returns the current ip address as a string.
 
example:
  - ip = xbmc.getIPAddress()
getInfoImage(...)
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://xbmc.org/wiki/?title=InfoLabels 
 
example:
  - filename = xbmc.getInfoImage('Weather.Conditions')
getInfoLabel(...)
getInfoLabel(infotag) -- Returns an InfoLabel as a string.
 
infotag        : string - infoTag for value you want returned.
 
List of InfoTags - http://xbmc.org/wiki/?title=InfoLabels 
 
example:
  - label = xbmc.getInfoLabel('Weather.Conditions')
getLanguage(...)
getLanguage() -- Returns the active language as a string.
 
example:
  - language = xbmc.getLanguage()
getLocalizedString(...)
getLocalizedString(id) -- Returns a localized 'unicode string'.
 
id             : integer - id# for string you want to localize.
 
*Note, See strings.xml in \language\{yourlanguage}\ for which id
       you need for a string.
 
example:
  - locstr = xbmc.getLocalizedString(6)
getRegion(...)
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')
getSkinDir(...)
getSkinDir() -- Returns the active skin directory as a string.
 
*Note, This is not the full path like 'special://home/skin/MediaCenter', but only 'MediaCenter'.
 
example:
  - skindir = xbmc.getSkinDir()
getSupportedMedia(...)
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')
log(...)
log(msg[, level]) -- Write a string to XBMC's log file.
 
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.log(msg='This is a test string.', level=xbmc.LOGDEBUG)
makeLegalFilename(...)
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:\Trailers\Ice Age: The Meltdown.avi')
output(...)
output(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)
playSFX(...)
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')
restart(...)
restart() -- Restart the xbox.
 
example:
  - xbmc.restart()
shutdown(...)
shutdown() -- Shutdown the xbox.
 
example:
  - xbmc.shutdown()
skinHasImage(...)
skinHasImage(image) -- Returns True if the image file exists in the skin.
 
image          : string - image filename
 
*Note, If the media resides in a subfolder include it. (eg. home-myfiles\\home-myfiles2.png)
 
       You can use the above as keywords for arguments.
 
example:
  - exists = xbmc.skinHasImage('ButtonFocusedTexture.png')
sleep(...)
sleep(time) -- Sleeps for 'time' msec.
 
time           : integer - number of msec to sleep.
 
*Note, This is useful if you have for example a Player class that is waiting
       for onPlayBackEnded() calls.
 
Throws: PyExc_TypeError, if time is not an integer.
 
example:
  - xbmc.sleep(2000) # sleeps for 2 seconds
translatePath(...)
translatePath(path) -- Returns the translated path.
 
path           : string or unicode - Path to format
 
*Note, Only useful if you are coding for both Linux and the Xbox.
       e.g. Converts 'special://masterprofile/script_data' -> '/home/user/XBMC/UserData/script_data'
       on Linux. Would return 'special://masterprofile/script_data' on the Xbox.
 
example:
  - fpath = xbmc.translatePath('special://masterprofile/script_data')

 
Data
        DRIVE_NOT_READY = 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
TRAY_CLOSED_MEDIA_PRESENT = 96
TRAY_CLOSED_NO_MEDIA = 64
TRAY_OPEN = 16
__author__ = 'J. Mulder <darkie@xbmc.org>'
__credits__ = 'XBMC TEAM.'
__date__ = '15 November 2005'
__platform__ = 'XBOX'
__version__ = '1.3'

 
Author
        J. Mulder <darkie@xbmc.org>

 
Credits
        XBMC TEAM.