vlc.MediaList ============= .. py:class:: vlc.MediaList Bases: :py:obj:`_Ctype` Usage: .. code-block:: python MediaList(list_of_MRLs) See :meth:`Instance.media_list_new` documentation for details. .. py:method:: add_media(mrl) Add :class:`Media` instance to media list. .. note:: The lock should be held upon entering this function. :param mrl: A :class:`Media` instance or a MRL. :return: 0 on success, -1 if the media list is read-only. .. py:method:: count() Get count on media list items The :func:`lock` should be held upon entering this function. :return: number of items in media list. .. py:method:: event_manager() Get libvlc_event_manager from this media list instance. The p_event_manager is immutable, so you don't have to hold the lock :return: libvlc_event_manager. .. py:method:: get_instance() .. py:method:: index_of_item(p_md) Find index position of List media instance in media list. Warning: the function will return the first matched position. The :func:`lock` should be held upon entering this function. :param p_md: media instance. :return: position of media instance or -1 if media not found. .. py:method:: insert_media(p_md, i_pos) Insert media instance in media list on a position The :func:`lock` should be held upon entering this function. :param p_md: a media instance. :param i_pos: position in array where to insert. :return: 0 on success, -1 if the media list is read-only. .. py:method:: is_readonly() This indicates if this media list is read-only from a user point of view :return: 1 on readonly, 0 on readwrite. .. py:method:: item_at_index(i_pos) List media instance in media list at a position The :func:`lock` should be held upon entering this function. :param i_pos: position in array where to insert. :return: media instance at position *i_pos*, or None if not found. In case of success, :func:`media_retain` is called to increase the refcount. on the media. .. py:method:: lock() Get lock on media list items .. py:method:: media() Get media instance from this media list instance. This action will increase the refcount on the media instance. The :func:`lock` should NOT be held upon entering this function. :return: media instance. .. py:method:: release() Release media list created with :func:`new`. .. py:method:: remove_index(i_pos) Remove media instance from media list on a position The :func:`lock` should be held upon entering this function. :param i_pos: position in array where to insert. :return: 0 on success, -1 if the list is read-only or the item was not found. .. py:method:: retain() Retain reference to a media list .. py:method:: set_media(p_md) Associate media instance with this media list instance. If another media instance was present it will be released. The :func:`lock` should NOT be held upon entering this function. :param p_md: media instance to add. .. py:method:: unlock() Release lock on media list items The :func:`lock` should be held upon entering this function.