def __init__(self, application):
        XbmcRemoteObject.__init__(self, application)
        self.xbmc_json = xbmc_json
        self.responder = Thread(target=self.worker, name='Response thread')
        self.responder.daemon = True
        self.songid = -1
        self.control_methods = {
            'play': self.play_pause,
            'next': self.play_next,
            'prev': self.play_previous,
            'start': self.start_playing,
            'pause': self.play_pause,
            'stop': self.stop_playing,
            'artists': self.get_artists,
            'albums': self.get_albums,
            'songs': self.get_songs,
            'state': self.check_state,
            'now_playing': self.get_now_playing,
            'current_position': self.get_position,
            'play_now': self.play_song_now,
            'play_next': self.play_song_next,
            'play_last': self.play_song_last,
            'custom': self.send_custom_request
        }

        self.queue = Queue()

        self.signal_connect('xbmc_control', self._send_control)
        self.signal_connect('xbmc_init', self._start_running)
        self.signal_connect('xbmc_decoded', self._add)
 def __init__(self, application):
     XbmcRemoteObject.__init__(self, application)
     self.loop = None
     self.methods = {}
     self.signal_connect('xbmc_error', self.handle_error)
     self.signal_connect('xbmc_frontend_init', self.thread_loop)
     self.signal_connect('xbmc_response', self.use_response)
     self.signal_connect('xbmc_paused', self.paused)
 def __init__(self, controller):
     XbmcRemoteObject.__init__(self, controller)
     async_chat.__init__(self)
     self.running = False
     self.set_terminator(None)
     self.inbuffer = ''
     self.set_up_thread()
     self.signal_connect('xbmc_init', self.first_connect)
     self.signal_connect('xbmc_reconnect', self.reconnect)
     self.signal_connect('xbmc_connected', self.start)
     self.signal_connect('xbmc_send', self.add)
     self.signal_connect('xbmc_kill', self.kill)
 def __init__(self, application):
     XbmcRemoteObject.__init__(self, application)
     self.decoder = JSONDecoder()
     self.signal_connect("xbmc_received", self.add)