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

 
Classes
       
__builtin__.object
InfoTagMusic
InfoTagVideo
Keyboard
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 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[, title, duration]) -- Add's a new file to the playlist.(Depreciated)
add(url[, listitem]) -- Add's a new file to the playlist.(Preferred method)
 
url            : string - filename or url to add.
listitem       : [opt] listitem - used with setInfo() to set different infolabels.
 
example:
  - playlist = xbmc.PlayList( 1 )
  - listitem = xbmcgui.ListItem('Ironman', thumbnailImage='F:\\movies\\Ironman.tbn')
  - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})
  - playlist.add(url, listitem)
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
         : - xbmc.PLAYER_CORE_MODPLAYER
 
  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]) -- Play this item.
 
item           : [opt] string - filename, url or playlist.
listitem       : [opt] listitem - used with setInfo() to set different infolabels.
 
*Note, If item is not given then the Player will try to play the current item
       in the current playlist.
 
example:
  - listitem = xbmcgui.ListItem('Ironman')
  - listitem.setInfo('video', {'Title': 'Ironman', 'Genre': 'Science Fiction'})
  - xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play(url, listitem)
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.
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(q:\\test.jpg,0,false,200,-1,90)')
executescript(...)
executescript(script) -- Execute a python script.
 
script         : string - script filename to execute.
 
example:
  - xbmc.executescript('q:\\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('[System.KaiEnabled + !Skin.String(KAI)]')
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)
 
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 'q:\skins\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 and skip certain optional arguments.
       Once you use a keyword, all following arguments require the keyword.
 
example:
  - mTypes = xbmc.getSupportedMedia('video')
log(...)
log(text) -- Write a string to XBMC's log file.
 
text           : string - text to write to log.
 
example:
  - xbmc.log('This is a test string.')
makeLegalFilename(...)
makeLegalFilename(filename[, fatX]) -- Returns a legal filename or path as a string.
 
filename       : string - 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.
 
example:
  - filename = xbmc.makeLegalFilename('F:\Trailers\Ice Age: The Meltdown.avi')
output(...)
output(text) -- Write a string to XBMC's log file and the debug window.
 
text           : string - text to output.
 
*Note, Text is written to the log only when <loglevel>1</loglevel> (DEBUG)
       or higher is set in AdvancedSettings.xml.
 
example:
  - xbmc.output('This is a test string.')
playSFX(...)
playSFX(filename) -- Plays a wav file by filename
 
filename       : string - filename of the wav file to play.
 
example:
  - xbmc.playSFX('Q:\\scripts\\dingdong.wav')
restart(...)
restart() -- Restart the xbox.
 
example:
  - xbmc.restart()
shutdown(...)
shutdown() -- Shutdown the xbox.
 
example:
  - xbmc.shutdown()
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 'T:\script_data' -> '/home/user/XBMC/UserData/script_data'
       on Linux. Would return 'T:\script_data' on the Xbox.
 
example:
  - fpath = xbmc.translatePath('T:\script_data')

 
Data
        DRIVE_NOT_READY = 1
PLAYER_CORE_AUTO = 0
PLAYER_CORE_DVDPLAYER = 1
PLAYER_CORE_MODPLAYER = 4
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@xboxmediacenter.com>'
__credits__ = 'XBMC TEAM.'
__date__ = '15 November 2005'
__platform__ = 'XBOX'
__version__ = '1.3'

 
Author
        J. Mulder <darkie@xboxmediacenter.com>

 
Credits
        XBMC TEAM.