| |
- __builtin__.object
-
- InfoTagMusic
- InfoTagVideo
- Keyboard
- PlayList
- PlayListItem
- Player
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 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
| |