Get isPlayingAudio - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Get isPlayingAudio (/showthread.php?tid=46486) |
Get isPlayingAudio - XBNIKLASMC - 2009-03-06 Hello! i´m slowly starting to understand some of the aspects of python programming. There is just one thing that is bothering me... if I would like to know if xbmc is playing audio I could write: if xbmc.Player().isPlayingAudio(): *"then do something" but then it has to be in the main loop, could I instead define it as a function of the class "xbmc.Player" and then get xbmc (xbmc.player) to update the function instead of me asking it in the mainloop. I would like to have the same function of "isPlayingAudio" as “onPlaybackStarted” because onPlaybackStarted reports back when it is changed look below.. class MyPlayer(xbmc.Player): def __init__(self): xbmc.Player.__init__(self) def onPlayBackStarted(self): print ("XBMC PbStarted") player=MyPlayer() is it possible? I cant get this to work with “isPlayingAudio”, my guess is that “onPlayback Started” is written to report back with a “return” but isPlayingAudio” is not, is that correct? Thankfull for any replies/ Cheers |