예제 #1
0
파일: player.py 프로젝트: msearra/edus2
    def __init__(self,
                 source,
                 args=[],
                 bus_address_finder=None,
                 Connection=None,
                 dbus_name=None,
                 pause=False):
        logger.debug('Instantiating OMXPlayer')

        self.args = args
        self._is_playing = True
        self._source = source
        self._dbus_name = dbus_name
        self._Connection = Connection if Connection else DBusConnection
        self._bus_address_finder = bus_address_finder if bus_address_finder else BusFinder(
        )

        #: Event called on pause ``callback(player)``
        self.pauseEvent = Event()
        #: Event called on play ``callback(player)``
        self.playEvent = Event()
        #: Event called on stop ``callback(player)``
        self.stopEvent = Event()
        #: Event called on seek ``callback(player, relative_position)``
        self.seekEvent = Event()
        #: Event called on setting position ``callback(player, absolute_position)``
        self.positionEvent = Event()

        self._process = None
        self._connection = None
        self.load(source, pause=pause)
예제 #2
0
    def __init__(self,
                 source,
                 args=None,
                 bus_address_finder=None,
                 Connection=None,
                 dbus_name=None,
                 pause=False,
                 preload=True):
        logger.debug('Instantiating OMXPlayer')

        if args is None:
            self.args = []
        elif isinstance(args, str):
            import shlex
            self.args = shlex.split(args)
        else:
            self.args = list(map(str, args))
        self._is_playing = True
        self._source = Path(source)
        self._dbus_name = dbus_name
        self._Connection = Connection if Connection else DBusConnection
        self._bus_address_finder = bus_address_finder if bus_address_finder else BusFinder(
        )

        #: Event called on pause ``callback(player)``
        self.pauseEvent = Event()
        #: Event called on play ``callback(player)``
        self.playEvent = Event()
        #: Event called on stop ``callback(player)``
        self.stopEvent = Event()
        #: Event called on exit ``callback(player, exit_status)``
        self.exitEvent = Event()
        #: Event called on seek ``callback(player, relative_position)``
        self.seekEvent = Event()
        #: Event called on setting position ``callback(player, absolute_position)``
        self.positionEvent = Event()

        self._process = None
        self._connection = None
        if (preload):
            self.load(source, pause=pause)
예제 #3
0
 def get_address(self):
     bus_finder = BusFinder(path=self.dbus_file_path)
     return bus_finder.get_address()
 def get_address(self):
     bus_finder = BusFinder(path=self.dbus_file_path)
     return bus_finder.get_address()