I'm currently getting tripped up trying to figure out how to write a script that is both the source of an event, but also then reads and reacts to said event. I'm not even sure this is possible with the way EG seems to process things.
The initial action I'm triggering in the script is "Player State" from the "SqueezeboxServer" plugin:
Code: Select all
eg.plugins.SqueezeboxServer.Player_State()My next thought was that maybe the plugin itself could be modified to return a true/false or set a variable that could then be read by the script regardless of when the event fires.
This apprears to be the plugin code in question:
Code: Select all
def __call__(self):
if self.plugin.bSqueezeboxServerObjectCreated:
STATE = self.plugin.sq.get_mode()
if STATE in ('stop', 'pause'):
self.plugin.TriggerEvent("Player Stopped/Paused")
return
else:
if STATE in ('play'):
self.plugin.TriggerEvent("Player Playing")
return
else:
self.plugin.TriggerEvent("Player Not Found")Any suggestions to point me in the right direction would be greatly appreciated.
