Exemplo n.º 1
0
 def on(self, event, listener, *user_args):
     if self._sp_playlistcontainer_callbacks is None:
         self._sp_playlistcontainer_callbacks = (
             _PlaylistContainerCallbacks.get_struct())
         lib.sp_playlistcontainer_add_callbacks(
             self._sp_playlistcontainer,
             self._sp_playlistcontainer_callbacks, ffi.NULL)
     if self not in self._session._emitters:
         self._session._emitters.append(self)
     super(PlaylistContainer, self).on(event, listener, *user_args)
Exemplo n.º 2
0
 def on(self, event, listener, *user_args):
     if self._sp_playlistcontainer_callbacks is None:
         self._sp_playlistcontainer_callbacks = (
             _PlaylistContainerCallbacks.get_struct())
         lib.sp_playlistcontainer_add_callbacks(
             self._sp_playlistcontainer,
             self._sp_playlistcontainer_callbacks, ffi.NULL)
     if self not in self._session._emitters:
         self._session._emitters.append(self)
     super(PlaylistContainer, self).on(event, listener, *user_args)
Exemplo n.º 3
0
    def __init__(self, session, sp_playlistcontainer, add_ref=True):
        super(PlaylistContainer, self).__init__()

        self._session = session

        if add_ref:
            lib.sp_playlistcontainer_add_ref(sp_playlistcontainer)
        self._sp_playlistcontainer = ffi.gc(
            sp_playlistcontainer, lib.sp_playlistcontainer_release)

        self._sp_playlistcontainer_callbacks = (
            _PlaylistContainerCallbacks.get_struct())
        lib.sp_playlistcontainer_add_callbacks(
            self._sp_playlistcontainer, self._sp_playlistcontainer_callbacks,
            ffi.NULL)

        # Make sure we remove callbacks in __del__() using the same lib as we
        # added callbacks with.
        self._lib = lib
Exemplo n.º 4
0
    def __init__(self, session, sp_playlistcontainer, add_ref=True):
        super(PlaylistContainer, self).__init__()

        self._session = session

        if add_ref:
            lib.sp_playlistcontainer_add_ref(sp_playlistcontainer)
        self._sp_playlistcontainer = ffi.gc(sp_playlistcontainer,
                                            lib.sp_playlistcontainer_release)

        self._sp_playlistcontainer_callbacks = (
            _PlaylistContainerCallbacks.get_struct())
        lib.sp_playlistcontainer_add_callbacks(
            self._sp_playlistcontainer, self._sp_playlistcontainer_callbacks,
            ffi.NULL)

        # Make sure we remove callbacks in __del__() using the same lib as we
        # added callbacks with.
        self._lib = lib