2014-10-23, 00:30
I have built an application that will play six hours of mixed media for an old peoples home. Included are videos; music with moving images backgrounds; and quiet times with no sound.
The script for this is based upon some 20 playlists, example entries are:
xbmc.executebuiltin("PlayMedia(/home/pi/.xbmc/userdata/playlists/video/Sect2_vid1.m3u)")
time.sleep(437)
xbmc.executebuiltin("PlayMedia(/home/pi/.xbmc/userdata/playlists/music/Sect2_mus1.m3u)")
xbmc.executebuiltin("SlideShow(/media/TRANS_SD_B/Interlude,recursive,random)")
time.sleep(353)
To start the script I have a line in Home.xml
<onclick>XBMC.RunScript(special://skin/scripts/leonie_script.py)</onclick>
The difficulty is that there seems no easy way of stopping the script short of turning off the Raspberry Pi. Even if I turn off a video that is running, when the next xbmc.executebuiltin comes up, the next item starts running. The script is still running in the background.
I have mapped the '0' button on my remote to 'StopScript', thinking I could have a 'while not StopScript' statement at the top of my leonie_script.py. This is aimed at putting leonie_script.py in a loop waiting for something to happen, while playing the content.
I would very much appreciate assistance with suitable python code to stop the complex leonie_script.py script. I can't find anything after several hours of looking. The skin is Confluence.
The script for this is based upon some 20 playlists, example entries are:
xbmc.executebuiltin("PlayMedia(/home/pi/.xbmc/userdata/playlists/video/Sect2_vid1.m3u)")
time.sleep(437)
xbmc.executebuiltin("PlayMedia(/home/pi/.xbmc/userdata/playlists/music/Sect2_mus1.m3u)")
xbmc.executebuiltin("SlideShow(/media/TRANS_SD_B/Interlude,recursive,random)")
time.sleep(353)
To start the script I have a line in Home.xml
<onclick>XBMC.RunScript(special://skin/scripts/leonie_script.py)</onclick>
The difficulty is that there seems no easy way of stopping the script short of turning off the Raspberry Pi. Even if I turn off a video that is running, when the next xbmc.executebuiltin comes up, the next item starts running. The script is still running in the background.
I have mapped the '0' button on my remote to 'StopScript', thinking I could have a 'while not StopScript' statement at the top of my leonie_script.py. This is aimed at putting leonie_script.py in a loop waiting for something to happen, while playing the content.
I would very much appreciate assistance with suitable python code to stop the complex leonie_script.py script. I can't find anything after several hours of looking. The skin is Confluence.