def onPlayBackStarted( self ):
# only do something if we're playing audio
if self.isPlayingAudio():
# we need to keep track of this bool for stopped/ended notifications
self.Audio = True
# keep track of onPlayBackStarted events http://trac.xbmc.org/ticket/13064
self.Count += 1
log('#DEBUG# onPlayBackStarted: %i' % self.Count)
# tags are not available instantly and we don't what to announce right away as the user might be skipping through the songs
xbmc.sleep(2000)
# don't announce if user already skipped to the next track
if self.Count == 1:
# reset counter
self.Count = 0
# get tags
tags = self._get_tags()
# announce song
self.action(tags, self.service)
else:
# multiple onPlayBackStarted events occurred, only act on the last one
log('#DEBUG# skipping onPlayBackStarted event')
self.Count -= 1
评论列表
文章目录