Esempio n. 1
0
 def playerHandler(self, interface, changed, invalidated, path):
     """Handle relevant property change signals"""
     iface = interface[interface.rfind(".") + 1:]
     player_path = path
     if __addon__.getSetting("debug") == "true":
         log("Changed : " + str(changed))
         log("Interface : " + str(interface))
         log("Path : " + str(path))
         log("Player Path : " + str(player_path))
     if iface == "Device1":
         if "Connected" in changed:
             self.connected = changed["Connected"]
     elif iface == "MediaControl1":
         if "Connected" in changed:
             self.connected = changed["Connected"]
             if changed["Connected"]:
                 self.findPlayer()
     elif iface == "MediaTransport1":
         if "State" in changed:
             if not changed["State"] == self.state:
                 self.state = changed["State"]
                 if not self.state == "active":
                     xbmc.stopBTPlayer()
     elif iface == "MediaPlayer1":
         if "Status" in changed:
             if not changed["Status"] == self.status:
                 if changed[
                         "Status"] == "playing" and self.state == "active":
                     xbmc.startBTPlayer(player_path)
Esempio n. 2
0
    def playerHandler(self, interface, changed, invalidated, path):
        """Handle relevant property change signals"""
        iface = interface[interface.rfind(".") + 1:]
        if iface == "Device1":
            if "Connected" in changed:
                self.connected = changed["Connected"]
        elif iface == "MediaControl1":
            if "Connected" in changed:
                self.connected = changed["Connected"]
                if changed["Connected"]:
                    self.findPlayer()
        elif iface == "MediaPlayer1":
            if "Status" in changed:
                if not changed["Status"] == self.status:
                    self.status = changed["Status"]
                    if self.status in ["stopped"]:
                        xbmc.stopBTPlayer()
                        # hack to hide the fact we always get false 'playing' events
                        self.receivedPosition = None

            if "Track" in changed:
                self.track = changed["Track"]
                self.trackChanged()

            # hack to hide the fact we always get false 'playing' events
            if "Position" in changed and not self.status == 'paused':
                newPosition = changed["Position"]
                if self.receivedPosition:
                    if not self.receivedPosition == newPosition:
                        self.trackChanged()
                else:
                     self.receivedPosition = newPosition;
Esempio n. 3
0
 def playerHandler(self, interface, changed, invalidated, path):
     """Handle relevant property change signals"""
     iface = interface[interface.rfind(".") + 1:]
     player_path = path[:path.rfind("/") + 1 ] + "player0"
     if __addon__.getSetting("debug") == "true":
         log("Changed : " + str(changed))
         log("Interface : " + str(interface))
         log("Path : " + str(path))
         log("Player Path : " + str(player_path))
     if iface == "Device1":
         if "Connected" in changed:
             self.connected = changed["Connected"]
     elif iface == "MediaControl1":
         if "Connected" in changed:
             self.connected = changed["Connected"]
             if changed["Connected"]:
                 self.findPlayer()
     elif iface == "MediaTransport1":
         if "State" in changed:
             if not changed["State"] == self.state:
                 if changed["State"] == "active":
                     self.state = changed["State"]
                     xbmc.startBTPlayer(player_path);
                 else:
                     self.state = changed["State"]
                     xbmc.stopBTPlayer()
Esempio n. 4
0
    def playerHandler(self, interface, changed, invalidated, path):
        """Handle relevant property change signals"""
        iface = interface[interface.rfind(".") + 1:]
        if iface == "Device1":
            if "Connected" in changed:
                self.connected = changed["Connected"]
        elif iface == "MediaControl1":
            if "Connected" in changed:
                self.connected = changed["Connected"]
                if changed["Connected"]:
                    self.findPlayer()
        elif iface == "MediaPlayer1":
            if "Status" in changed:
                if not changed["Status"] == self.status:
                    self.status = changed["Status"]
                    if self.status in ["stopped"]:
                        xbmc.stopBTPlayer()
                        # hack to hide the fact we always get false 'playing' events
                        self.receivedPosition = None

            if "Track" in changed:
                self.startBTPlayer()

            # hack to hide the fact we always get false 'playing' events
            if "Position" in changed and not self.status == 'paused':
                newPosition = changed["Position"]
                if self.receivedPosition:
                    if not self.receivedPosition == newPosition:
                        self.startBTPlayer()
                else:
                    self.receivedPosition = newPosition