示例#1
0
 def run(self):
     while not self._stop_event.is_set():
         if not self._notify_apps(
                 'on_playback_tick',
             {'is_playback_paused': self.is_playback_paused}):
             LOG.warn('PlaybackTick: Interrupted due to an error')
             break
         if self._stop_event.wait(self._timeout_secs):
             break  # Stop requested by stop_join
示例#2
0
 def _notify_apps(self, callback_name, data=None):
     if self._active_app is None:
         LOG.warn('Ignored Kodi callback {}, no app currently active',
                  callback_name)
         return False
     self._mutex.acquire()
     LOG.debug('Notify Kodi callback {} to {} with data: {}', callback_name,
               self._active_app.DIAL_APP_NAME, data)
     ret = self._execute_notify(self._active_app, callback_name, data)
     self._mutex.release()
     return ret