2016-08-19, 16:18
Hi @all
>>>> Because my post got blocked, i had to use sl*ep instead of the word with the two e's......
I am currently developing an addon for an internet radio station. This station not only provides audio streams in various bitrates and formats, they provide also a extensive songinfo, a HD-slideshow and a voting system. I have completed the first function, playing the audio stream without any troubles.
Now, the next functionality i wanted to add ist a mechanism to execute different functions periodically on a unix timebase in a grain of one second. My current attempt look like this:
The problem is, that xbmc.sl*ep(msecs) causes kodi to display the "working" notification and it seems that i cant do anything than interrupt the loop. I tried "time.sl*ep(secs)" which throws me some errors.
May it be better to do the timed tasks with a discrete service plugin?
Furthermore, it isnt clear for me how to handle the "background" of the player. Should I do the whole the whole slideshow thing with a discrete vizualisation plugin?
Thanks forward!
selli69
>>>> Because my post got blocked, i had to use sl*ep instead of the word with the two e's......
I am currently developing an addon for an internet radio station. This station not only provides audio streams in various bitrates and formats, they provide also a extensive songinfo, a HD-slideshow and a voting system. I have completed the first function, playing the audio stream without any troubles.
Now, the next functionality i wanted to add ist a mechanism to execute different functions periodically on a unix timebase in a grain of one second. My current attempt look like this:
Code:
while 1
xbmc.sl*ep(1000)
if time() > time_to_execute_slideshow_update:
slideshow_update()
if time() > time_to_execute_some_function:
do_some_other_function()
....etc....
if request_for_voting
do_voting()
if request_for_exit
break
The problem is, that xbmc.sl*ep(msecs) causes kodi to display the "working" notification and it seems that i cant do anything than interrupt the loop. I tried "time.sl*ep(secs)" which throws me some errors.
May it be better to do the timed tasks with a discrete service plugin?
Furthermore, it isnt clear for me how to handle the "background" of the player. Should I do the whole the whole slideshow thing with a discrete vizualisation plugin?
Thanks forward!
selli69