New python controls in cvs
#1
Thumbs Up 
i noticed in the changelog
Quote: - 11-03-2005 added: [ 1160414 ] added new methods to xbmc.player python class. onplaybackstopped() (user stop), gettotaltime() (duration of current media),
gettime() (position of current media), seektime( double pos ) (seek to specified position) - thanks to gimblefoot
- 11-03-2005 added: [ 1160400 ] added controlcheckmark in python - thanks to gimblefoot
havent seen this 'gimblefoot' post anything about it here so i thought i'd give it a go.

just to be clear though these will only work in newer builds and if you intend on using them you might want to throw a try statement around it... probably put up an error message if it fails.

the controlcheckmark is something that i was going to try to emulate myself and sounds great for togglable settings.

the extentions to the player class sound great and i know i've seen requests for that functionality.
Reply
#2
yeah, i have yet to try these functions, but it's been high on my wishlist and if gimblefoot ever reads this - thank you very much! :lol:
xbmcscripts.com administrator
Reply
#3
unfortunately i think the seektime will not work in changing the stream start.
i tested the seektime(from httpapi, where i implaneted it myself) on wmv files and it did't work to well.(i tested it on mov files and that worked perfect, exept for the buffer thing break)
but i think we need the start offset in the play function.
i have not tried it in phyton yet, so i will not conclude that it don't work in that way.
if i'm right when seeking in a stream will break the buffer thing.

respects to the dev guys on updating phyton modul. Wink
Reply
#4
while none of the python docs have been updated i was able to grab this out of the cvs.

Quote:controlcheckmark class.

controlcheckmark(int x, int y, int width, int height[, label, focustexture, nofocustexture, checkwidth, checkheight, align])

label : string or unicode string
focustexture : filename for focus texture
nofocustexture : filename for no focus texture
checkwidth : width of checkmark
checkheight : height of checkmark
alignment : alignment of checkmark label

setdisabledcolor(string hexcolor) -- .
hexcolor : hexstring (example, '0xffff3300')

setlabel(string label[, string fontname[, string textcolor]]) -- set's text for this button.
label : string or unicode string
fontname : name of font
textcolor : label text color

getselected() -- returns the selected value for the check mark.

setselected(bool ison) -- sets the check mark on or off.
ison : true if selected, false if not selected

the api is pretty similar to the controlbutton api (which is logical) except for the get/set selected.

i wish the label control was this good .. you cant select alignment on a label nor can you change the color of a label after you've created it at least to my knowledge. i had to work around this by creating different colored versions of the same label and toggling visibilities accordingly.
Reply
#5
do you know that docs are updated every time someone put changes in the cvs, docs are genereated by the docs vars put in sourcecode by developers.

xbmc.html

xbmcgui.html
Reply
#6
(thor918 @ mar. 13 2005,10:51 Wrote:do you know that docs are updated every time someone put changes in the cvs, docs are genereated by the docs vars put in sourcecode by developers.

xbmc.html

xbmcgui.html
i know they are autogenerated but there isnt a live copy on cvs afaik and i thought you'd have to actually build it. all the copies ive seen online were last updated in august. thx for hosting the updated docs.
Reply
#7
your right you got to run a generator script on a fresh cvs build.
>thx for hosting the updated docs.
Wink no problem
Reply
#8
yep, i've been updating the inline python documentation as i add new features to the xbmc python module. if i touch an existing one, i've also been updating the documentation if it is out of date. also, one thing i like adding in is the ability to use keyword arguments in python.

Quote:
c = xbmcgui.controlbutton( x,y,w,h,l,tx1,tx2,
textxoffset=int(tox),textyoffset=int(toy),
alignment=align)

so, in the example above, you could stick the alignment parameter anywhere in the argument list if you prefix the argument value with the name of the arg + '='. the documentation then becomes important so you know the names of the arguments if you call methods using keyword argument lists. keep in mind that not all existing python module objects have been updated to support keyword argument lists though... controlbutton, controlcheckmark, controlfadelabel, and controllabel have support (assuming you have patch 1166891).

note: you can use keyword argument lists, positional argument lists, or even a mix of both (within python's limitations).
Reply

Logout Mark Read Team Forum Stats Members Help
New python controls in cvs0