method to get current play time
#1
hey darkie or anyone else reading,
i was just looking through the current methods available to python and noticed something that i'd really like, well something that i'd need if i was to right an audioscrobbler plugin for xbmc, which i was thinking of doing. at least i can't find a method to give this information, if it already exists please let me know.
i'd need a method to get the current play time of the currently playing song, i suppose it would be something like a getplaytime() method in the player class.
if you could find the time to implement this i'd be very grateful.

thank you,
burriko.
Reply
#2
that function would be incredibly useful! hope you get your request!
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#3
still no script for audioscrobbler? =)
Reply
#4
was there any resolution for this? i'm also needing a method to get the current play time.

i also want to get access to the database mechanisms. are any of the xbmc devels reading this forum?
Reply
#5
are you launching the music by yourself in the script ?
or maybe music is already playing when you launch your script ?...

if it is the same script that play and need to know what time is playing, you can do a thread class that will count the time and update a txtlabel every seconds
Reply
#6
that's a neat idea but it would be a hack and it wouldn't be accurate (if another api came in and stopped the playback for example the script wouldn't be aware). it can't be that difficult to just add some functionality to the player class?

when i get some free time i plan on finding the python bindings in the xbmc source and adding this capability as well as database capability (like the javascript web api offers) in. i don't know however how easy it is to get a patch merged into the cvs code so that others can benefit from it.
Reply
#7
Quote:if another api came in and stopped the playback for example the script wouldn't be aware
if the thread (updating each seconds) check for music playing with
isplaying()

you can try to use the player class. it has onplaybackstarted and onplaybackended functions... (the second one is not working very fine. depends on what kind of media player class is playing.)

ok these are 'tricks' but you can try to play with.... but if you can make the player class better ! go for it ! Smile
Reply
#8
[deleted]



Reply

Logout Mark Read Team Forum Stats Members Help
method to get current play time0